From: <lo...@us...> - 2007-03-13 16:22:44
|
Revision: 963 http://svn.sourceforge.net/colorer/?rev=963&view=rev Author: lomecb Date: 2007-03-13 09:22:42 -0700 (Tue, 13 Mar 2007) Log Message: ----------- type filter for tree viewers Modified Paths: -------------- branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/ftpp/FileTypePreferencePage.java branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/view/HRCRegionsTreeView.java Modified: branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/ftpp/FileTypePreferencePage.java =================================================================== --- branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/ftpp/FileTypePreferencePage.java 2007-03-12 18:59:54 UTC (rev 962) +++ branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/ftpp/FileTypePreferencePage.java 2007-03-13 16:22:42 UTC (rev 963) @@ -22,6 +22,8 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Item; @@ -29,6 +31,8 @@ import org.eclipse.swt.widgets.TableColumn; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; /** * Preferences page for specific HRC file type settings @@ -190,16 +194,22 @@ */ public Control createContents(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); - // composite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - // composite.setLayoutData(new FillData()); - composite.setLayout(new FillLayout(SWT.VERTICAL)); + composite.setLayout(new GridLayout()); ParserFactory pf = ColorerPlugin.getDefaultPF(); typePropertiesProvider = new TypeContentProvider(); { - typeTreeViewer = new TreeViewer(composite, - SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION); + PatternFilter patternFilter = new PatternFilter(); + final FilteredTree filter = new FilteredTree(composite, + SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION, + patternFilter); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.minimumHeight = 100; + gd.grabExcessVerticalSpace = true; + filter.setLayoutData(gd); + + typeTreeViewer = filter.getViewer(); typeTreeViewer.setContentProvider(new FileTypesContentProvider()); typeTreeViewer.setLabelProvider(new FileTypesLabelProvider()); @@ -213,8 +223,8 @@ }); } { - typePropertiesViewer = new TableViewer(composite, SWT.V_SCROLL - | SWT.BORDER | SWT.FULL_SELECTION); + typePropertiesViewer = new TableViewer(composite, + SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION); typePropertiesTable = typePropertiesViewer.getTable(); typePropertiesViewer.setContentProvider(typePropertiesProvider); typePropertiesViewer.setLabelProvider(new TypeLabelProvider(typePropertiesProvider)); @@ -230,7 +240,6 @@ .getTable().getColumnCount()]; paramCellEditor = new ComboBoxCellEditor(typePropertiesTable, values_TrueFalseDefault, SWT.READ_ONLY); - // paramCellEditor = new CheckboxCellEditor(typePropertiesTable); cellEditors[1] = paramCellEditor; typePropertiesViewer.setCellEditors(cellEditors); @@ -239,9 +248,11 @@ typePropertiesViewer.setColumnProperties(new String[] { "name", "value" }); - // typePropertiesTable.setLayoutData(new - // GridData(GridData.HORIZONTAL_ALIGN_FILL, - // GridData.VERTICAL_ALIGN_FILL, true, true, 2, 1)); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.heightHint = 100; + gd.grabExcessVerticalSpace = true; + typePropertiesTable.setLayoutData(gd); + typePropertiesTable.setHeaderVisible(true); typePropertiesTable.setLinesVisible(true); Modified: branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/view/HRCRegionsTreeView.java =================================================================== --- branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/view/HRCRegionsTreeView.java 2007-03-12 18:59:54 UTC (rev 962) +++ branches/IRUSSKIH-NEW-ECLIPSE-EDITOR/net.sf.colorer/src/net/sf/colorer/eclipse/view/HRCRegionsTreeView.java 2007-03-13 16:22:42 UTC (rev 963) @@ -43,6 +43,8 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.ui.IActionBars; import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; import org.eclipse.ui.part.ViewPart; /** @@ -134,10 +136,17 @@ composite.setLayout(new GridLayout(1, true)); { final Composite composite_1 = new Composite(composite, SWT.NONE); - composite_1.setLayout(new FillLayout()); + composite_1.setLayout(new GridLayout()); composite_1.setLayoutData(new GridData(GridData.FILL_BOTH)); - treeViewer = new TreeViewer(composite_1, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); + PatternFilter patternFilter = new PatternFilter(); + final FilteredTree filter = new FilteredTree(composite_1, + SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, + patternFilter); + filter.setLayoutData(new GridData(GridData.FILL_BOTH)); + + treeViewer = filter.getViewer(); + treeViewer.setContentProvider(new RegionContentProvider()); treeViewer.setLabelProvider(new RegionTreeLabelProvider()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |