|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.ui.dialogs.FilteredTree
A simple control that provides a text widget and a tree viewer. The contents of the text widget are used to drive a PatternFilter that is on the viewer.
PatternFilter
Field Summary | |
---|---|
protected Composite |
filterComposite
The Composite on which the filter controls are created. |
protected Text |
filterText
The filter text widget to be used by this tree. |
protected ToolBarManager |
filterToolBar
The control representing the clear button for the filter text entry. |
protected String |
initialText
The text to initially show in the filter text control. |
protected boolean |
showFilterControls
Whether or not to show the filter controls (text and clear button). |
protected TreeViewer |
treeViewer
The viewer for the filtered tree. |
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
FilteredTree(Composite parent,
int treeStyle,
PatternFilter filter)
Create a new instance of the receiver. |
Method Summary | |
---|---|
protected void |
clearText()
Clears the text in the filter text widget. |
protected void |
createControl(Composite parent,
int treeStyle)
Create the filtered tree's controls. |
protected Composite |
createFilterControls(Composite parent)
Create the filter controls. |
protected void |
createFilterText(Composite parent)
Create the filter text and adds listeners. |
protected Control |
createTreeControl(Composite parent,
int style)
Create the tree. |
static Font |
getBoldFont(Object element,
FilteredTree tree,
PatternFilter filter)
Return a bold font if the given element matches the given pattern. |
Text |
getFilterControl()
Get the filter text for the receiver, if it was created. |
protected String |
getFilterString()
Convenience method to return the text of the filter control. |
protected String |
getInitialText()
Get the initial text for the receiver. |
PatternFilter |
getPatternFilter()
Returns the pattern filter used by this tree. |
TreeViewer |
getViewer()
Get the tree viewer of the receiver. |
protected void |
selectAll()
Select all text in the filter text field. |
void |
setBackground(Color background)
Set the background for the widgets that support the filter text area. |
protected void |
setFilterText(String string)
Set the text in the filter control. |
void |
setInitialText(String text)
Set the text that will be shown until the first focus. |
protected void |
textChanged()
Update the receiver after the text has changed. |
protected void |
updateToolbar(boolean visible)
|
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Text filterText
null
if there is no filter widget, or if the controls have
not yet been created.
protected ToolBarManager filterToolBar
null
if no such button exists, or if the
controls have not yet been created.
protected TreeViewer treeViewer
null
after the widget creation methods are complete.
protected Composite filterComposite
protected String initialText
protected boolean showFilterControls
Constructor Detail |
public FilteredTree(Composite parent, int treeStyle, PatternFilter filter)
parent
- parent Composite
treeStyle
- the style bits for the Tree
filter
- the filter to be usedMethod Detail |
protected void createControl(Composite parent, int treeStyle)
parent
- treeStyle
- protected Composite createFilterControls(Composite parent)
parent
- parent Composite
of the filter controls
Composite
that contains the filter controlsprotected Control createTreeControl(Composite parent, int style)
parent
- parent Composite
style
- SWT style bits used to create the tree
protected void updateToolbar(boolean visible)
protected void createFilterText(Composite parent)
parent
- Composite
of the filter textprotected void textChanged()
public void setBackground(Color background)
setBackground
in class Control
background
- background Color
to setprotected void clearText()
protected void setFilterText(String string)
string
- public final PatternFilter getPatternFilter()
null
.public TreeViewer getViewer()
public Text getFilterControl()
null
.
protected String getFilterString()
public void setInitialText(String text)
text
- initial text to appear in text fieldprotected void selectAll()
protected String getInitialText()
public static Font getBoldFont(Object element, FilteredTree tree, PatternFilter filter)
element
- element for which a match should be determinedtree
- FilteredTree in which the element residesfilter
- PatternFilter which determines a match
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.