### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.ui Index: ui/org/eclipse/jdt/internal/ui/text/AbstractInformationControl.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/AbstractInformationControl.java,v retrieving revision 1.50 diff -u -r1.50 AbstractInformationControl.java --- ui/org/eclipse/jdt/internal/ui/text/AbstractInformationControl.java 28 Jun 2006 12:20:51 -0000 1.50 +++ ui/org/eclipse/jdt/internal/ui/text/AbstractInformationControl.java 27 Sep 2006 08:58:10 -0000 @@ -53,7 +53,6 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.text.IInformationControl; import org.eclipse.jface.text.IInformationControlExtension; @@ -71,6 +70,8 @@ import org.eclipse.ui.commands.IKeySequenceBinding; import org.eclipse.ui.commands.Priority; import org.eclipse.ui.contexts.IWorkbenchContextSupport; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; import org.eclipse.ui.keys.KeySequence; import org.eclipse.jdt.core.IJavaElement; @@ -89,13 +90,38 @@ */ public abstract class AbstractInformationControl extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener { + private class FilteredOutlineTree extends FilteredTree { + AbstractInformationControl fControl; + public FilteredOutlineTree(AbstractInformationControl control, Composite parent, int treeStyle, PatternFilter filter) { + super(parent); + fControl= control; + init(parent, treeStyle, filter); + } + + /* + * @see org.eclipse.ui.dialogs.FilteredTree#doCreateTreeViewer(org.eclipse.swt.widgets.Composite, int) + * @since 3.3 + */ + protected TreeViewer doCreateTreeViewer(Composite viewerParent, int style) { + return fControl.createTreeViewer(viewerParent, style); + } + + /* + * @see org.eclipse.ui.dialogs.FilteredTree#doCreateFilterText(org.eclipse.swt.widgets.Composite) + * @since 3.3 + */ + protected Text doCreateFilterText(Composite parent) { + return fControl.createFilterText(parent); + } + } + /** * The NamePatternFilter selects the elements which * match the given string patterns. * * @since 2.0 */ - protected class NamePatternFilter extends ViewerFilter { + protected class NamePatternFilter extends PatternFilter { public NamePatternFilter() { } @@ -103,7 +129,7 @@ /* (non-Javadoc) * Method declared on ViewerFilter. */ - public boolean select(Viewer viewer, Object parentElement, Object element) { + public boolean isElementVisible(Viewer viewer, Object element) { StringMatcher matcher= getMatcher(); if (matcher == null || !(viewer instanceof TreeViewer)) return true; @@ -128,7 +154,7 @@ } /** The control's text widget */ - private Text fFilterText; + protected Text fFilterText; /** The control's tree widget */ private TreeViewer fTreeViewer; /** The current string matcher */ @@ -199,8 +225,13 @@ * @since 3.2 */ protected Control createDialogArea(Composite parent) { - fTreeViewer= createTreeViewer(parent, fTreeStyle); - + PatternFilter filter= new NamePatternFilter(); + + FilteredOutlineTree filteredTree= new FilteredOutlineTree(this, parent, fTreeStyle, filter); + + fTreeViewer= filteredTree.getViewer(); + fFilterText= filteredTree.getFilterControl(); + fCustomFiltersActionGroup= new CustomFiltersActionGroup(getId(), fTreeViewer); final Tree tree= fTreeViewer.getTree(); @@ -754,7 +785,7 @@ // underneath the title and menu area. if (hasHeader()) { - fFilterText= createFilterText(parent); +// fFilterText= createFilterText(parent); } // Create a key binding for showing the dialog menu @@ -786,22 +817,11 @@ * @since 3.2 */ protected Control createTitleControl(Composite parent) { - if (hasHeader()) { - return super.createTitleControl(parent); - } - fFilterText= createFilterText(parent); - return fFilterText; +// if (hasHeader()) { +// return super.createTitleControl(parent); +// } +// fFilterText= createFilterText(parent); + return parent; } - /* - * @see org.eclipse.jface.dialogs.PopupDialog#setTabOrder(org.eclipse.swt.widgets.Composite) - */ - protected void setTabOrder(Composite composite) { - if (hasHeader()) { - composite.setTabList(new Control[] { fFilterText, fTreeViewer.getTree() }); - } else { - fViewMenuButtonComposite.setTabList(new Control[] { fFilterText }); - composite.setTabList(new Control[] { fViewMenuButtonComposite, fTreeViewer.getTree() }); - } - } }