Lines 53-59
Link Here
|
53 |
import org.eclipse.jface.viewers.StructuredSelection; |
53 |
import org.eclipse.jface.viewers.StructuredSelection; |
54 |
import org.eclipse.jface.viewers.TreeViewer; |
54 |
import org.eclipse.jface.viewers.TreeViewer; |
55 |
import org.eclipse.jface.viewers.Viewer; |
55 |
import org.eclipse.jface.viewers.Viewer; |
56 |
import org.eclipse.jface.viewers.ViewerFilter; |
|
|
57 |
|
56 |
|
58 |
import org.eclipse.jface.text.IInformationControl; |
57 |
import org.eclipse.jface.text.IInformationControl; |
59 |
import org.eclipse.jface.text.IInformationControlExtension; |
58 |
import org.eclipse.jface.text.IInformationControlExtension; |
Lines 71-76
Link Here
|
71 |
import org.eclipse.ui.commands.IKeySequenceBinding; |
70 |
import org.eclipse.ui.commands.IKeySequenceBinding; |
72 |
import org.eclipse.ui.commands.Priority; |
71 |
import org.eclipse.ui.commands.Priority; |
73 |
import org.eclipse.ui.contexts.IWorkbenchContextSupport; |
72 |
import org.eclipse.ui.contexts.IWorkbenchContextSupport; |
|
|
73 |
import org.eclipse.ui.dialogs.FilteredTree; |
74 |
import org.eclipse.ui.dialogs.PatternFilter; |
74 |
import org.eclipse.ui.keys.KeySequence; |
75 |
import org.eclipse.ui.keys.KeySequence; |
75 |
|
76 |
|
76 |
import org.eclipse.jdt.core.IJavaElement; |
77 |
import org.eclipse.jdt.core.IJavaElement; |
Lines 89-101
Link Here
|
89 |
*/ |
90 |
*/ |
90 |
public abstract class AbstractInformationControl extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener { |
91 |
public abstract class AbstractInformationControl extends PopupDialog implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, DisposeListener { |
91 |
|
92 |
|
|
|
93 |
private class FilteredOutlineTree extends FilteredTree { |
94 |
AbstractInformationControl fControl; |
95 |
public FilteredOutlineTree(AbstractInformationControl control, Composite parent, int treeStyle, PatternFilter filter) { |
96 |
super(parent); |
97 |
fControl= control; |
98 |
init(parent, treeStyle, filter); |
99 |
} |
100 |
|
101 |
/* |
102 |
* @see org.eclipse.ui.dialogs.FilteredTree#doCreateTreeViewer(org.eclipse.swt.widgets.Composite, int) |
103 |
* @since 3.3 |
104 |
*/ |
105 |
protected TreeViewer doCreateTreeViewer(Composite viewerParent, int style) { |
106 |
return fControl.createTreeViewer(viewerParent, style); |
107 |
} |
108 |
|
109 |
/* |
110 |
* @see org.eclipse.ui.dialogs.FilteredTree#doCreateFilterText(org.eclipse.swt.widgets.Composite) |
111 |
* @since 3.3 |
112 |
*/ |
113 |
protected Text doCreateFilterText(Composite parent) { |
114 |
return fControl.createFilterText(parent); |
115 |
} |
116 |
} |
117 |
|
92 |
/** |
118 |
/** |
93 |
* The NamePatternFilter selects the elements which |
119 |
* The NamePatternFilter selects the elements which |
94 |
* match the given string patterns. |
120 |
* match the given string patterns. |
95 |
* |
121 |
* |
96 |
* @since 2.0 |
122 |
* @since 2.0 |
97 |
*/ |
123 |
*/ |
98 |
protected class NamePatternFilter extends ViewerFilter { |
124 |
protected class NamePatternFilter extends PatternFilter { |
99 |
|
125 |
|
100 |
public NamePatternFilter() { |
126 |
public NamePatternFilter() { |
101 |
} |
127 |
} |
Lines 103-109
Link Here
|
103 |
/* (non-Javadoc) |
129 |
/* (non-Javadoc) |
104 |
* Method declared on ViewerFilter. |
130 |
* Method declared on ViewerFilter. |
105 |
*/ |
131 |
*/ |
106 |
public boolean select(Viewer viewer, Object parentElement, Object element) { |
132 |
public boolean isElementVisible(Viewer viewer, Object element) { |
107 |
StringMatcher matcher= getMatcher(); |
133 |
StringMatcher matcher= getMatcher(); |
108 |
if (matcher == null || !(viewer instanceof TreeViewer)) |
134 |
if (matcher == null || !(viewer instanceof TreeViewer)) |
109 |
return true; |
135 |
return true; |
Lines 128-134
Link Here
|
128 |
} |
154 |
} |
129 |
|
155 |
|
130 |
/** The control's text widget */ |
156 |
/** The control's text widget */ |
131 |
private Text fFilterText; |
157 |
protected Text fFilterText; |
132 |
/** The control's tree widget */ |
158 |
/** The control's tree widget */ |
133 |
private TreeViewer fTreeViewer; |
159 |
private TreeViewer fTreeViewer; |
134 |
/** The current string matcher */ |
160 |
/** The current string matcher */ |
Lines 199-206
Link Here
|
199 |
* @since 3.2 |
225 |
* @since 3.2 |
200 |
*/ |
226 |
*/ |
201 |
protected Control createDialogArea(Composite parent) { |
227 |
protected Control createDialogArea(Composite parent) { |
202 |
fTreeViewer= createTreeViewer(parent, fTreeStyle); |
228 |
PatternFilter filter= new NamePatternFilter(); |
203 |
|
229 |
|
|
|
230 |
FilteredOutlineTree filteredTree= new FilteredOutlineTree(this, parent, fTreeStyle, filter); |
231 |
|
232 |
fTreeViewer= filteredTree.getViewer(); |
233 |
fFilterText= filteredTree.getFilterControl(); |
234 |
|
204 |
fCustomFiltersActionGroup= new CustomFiltersActionGroup(getId(), fTreeViewer); |
235 |
fCustomFiltersActionGroup= new CustomFiltersActionGroup(getId(), fTreeViewer); |
205 |
|
236 |
|
206 |
final Tree tree= fTreeViewer.getTree(); |
237 |
final Tree tree= fTreeViewer.getTree(); |
Lines 754-760
Link Here
|
754 |
// underneath the title and menu area. |
785 |
// underneath the title and menu area. |
755 |
|
786 |
|
756 |
if (hasHeader()) { |
787 |
if (hasHeader()) { |
757 |
fFilterText= createFilterText(parent); |
788 |
// fFilterText= createFilterText(parent); |
758 |
} |
789 |
} |
759 |
|
790 |
|
760 |
// Create a key binding for showing the dialog menu |
791 |
// Create a key binding for showing the dialog menu |
Lines 786-807
Link Here
|
786 |
* @since 3.2 |
817 |
* @since 3.2 |
787 |
*/ |
818 |
*/ |
788 |
protected Control createTitleControl(Composite parent) { |
819 |
protected Control createTitleControl(Composite parent) { |
789 |
if (hasHeader()) { |
820 |
// if (hasHeader()) { |
790 |
return super.createTitleControl(parent); |
821 |
// return super.createTitleControl(parent); |
791 |
} |
822 |
// } |
792 |
fFilterText= createFilterText(parent); |
823 |
// fFilterText= createFilterText(parent); |
793 |
return fFilterText; |
824 |
return parent; |
794 |
} |
825 |
} |
795 |
|
826 |
|
796 |
/* |
|
|
797 |
* @see org.eclipse.jface.dialogs.PopupDialog#setTabOrder(org.eclipse.swt.widgets.Composite) |
798 |
*/ |
799 |
protected void setTabOrder(Composite composite) { |
800 |
if (hasHeader()) { |
801 |
composite.setTabList(new Control[] { fFilterText, fTreeViewer.getTree() }); |
802 |
} else { |
803 |
fViewMenuButtonComposite.setTabList(new Control[] { fFilterText }); |
804 |
composite.setTabList(new Control[] { fViewMenuButtonComposite, fTreeViewer.getTree() }); |
805 |
} |
806 |
} |
807 |
} |
827 |
} |