public class FilteredTreeComposite
extends org.eclipse.swt.widgets.Composite
PatternFilter
Modifier and Type | Class and Description |
---|---|
(package private) class |
FilteredTreeComposite.NotifyingTreeViewer
Custom tree viewer subclass that clears the caches in patternFilter on any change to the tree.
|
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.swt.widgets.Composite |
filterComposite
The Composite on which the filter controls are created.
|
protected org.eclipse.swt.widgets.Text |
filterText
The filter text widget to be used by this tree.
|
protected org.eclipse.jface.action.ToolBarManager |
filterToolBar
The control representing the clear button for the filter text entry.
|
protected java.lang.String |
initialText
The text to initially show in the filter text control.
|
protected org.eclipse.swt.widgets.Composite |
parent
The parent composite of the filtered tree.
|
protected boolean |
showFilterControls
Whether or not to show the filter controls (text and clear button).
|
protected org.eclipse.swt.widgets.Composite |
treeComposite |
protected org.eclipse.jface.viewers.TreeViewer |
treeViewer
The viewer for the filtered tree.
|
Modifier | Constructor and Description |
---|---|
protected |
FilteredTreeComposite(org.eclipse.swt.widgets.Composite parent)
Create a new instance of the receiver.
|
|
FilteredTreeComposite(org.eclipse.swt.widgets.Composite parent,
int treeStyle,
PatternFilter filter)
Create a new instance of the receiver.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearText()
Clears the text in the filter text widget.
|
protected void |
createControl(org.eclipse.swt.widgets.Composite parent,
int treeStyle)
Create the filtered tree's controls.
|
protected org.eclipse.swt.widgets.Composite |
createFilterControls(org.eclipse.swt.widgets.Composite parent)
Create the filter controls.
|
protected void |
createFilterText(org.eclipse.swt.widgets.Composite parent)
Creates the filter text and adds listeners.
|
protected org.eclipse.swt.widgets.Control |
createTreeControl(org.eclipse.swt.widgets.Composite parent,
int style)
Creates and set up the tree and tree viewer.
|
protected org.eclipse.swt.widgets.Text |
doCreateFilterText(org.eclipse.swt.widgets.Composite parent)
Creates the text control for entering the filter text.
|
protected XViewerWorkbenchJob |
doCreateRefreshJob()
Creates a workbench job that will refresh the tree based on the current filter text.
|
protected org.eclipse.jface.viewers.TreeViewer |
doCreateTreeViewer(org.eclipse.swt.widgets.Composite parent,
int style)
Creates the tree viewer.
|
static org.eclipse.swt.graphics.Font |
getBoldFont(java.lang.Object element,
FilteredTreeComposite tree,
PatternFilter filter)
Return a bold font if the given element matches the given pattern.
|
org.eclipse.swt.widgets.Text |
getFilterControl()
Get the filter text for the receiver, if it was created.
|
protected java.lang.String |
getFilterString()
Convenience method to return the text of the filter control.
|
protected java.lang.String |
getInitialText()
Get the initial text for the receiver.
|
PatternFilter |
getPatternFilter()
Returns the pattern filter used by this tree.
|
org.eclipse.jface.viewers.TreeViewer |
getViewer()
Get the tree viewer of the receiver.
|
protected void |
init(int treeStyle,
PatternFilter filter)
Create the filtered tree.
|
protected void |
selectAll()
Select all text in the filter text field.
|
void |
setBackground(org.eclipse.swt.graphics.Color background)
Set the background for the widgets that support the filter text area.
|
protected void |
setFilterText(java.lang.String string)
Set the text in the filter control.
|
void |
setInitialText(java.lang.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) |
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
protected org.eclipse.swt.widgets.Text filterText
null
if there is no filter widget,
or if the controls have not yet been created.protected org.eclipse.jface.action.ToolBarManager filterToolBar
null
if no
such button exists, or if the controls have not yet been created.protected org.eclipse.jface.viewers.TreeViewer treeViewer
null
after the widget creation methods
are complete.protected org.eclipse.swt.widgets.Composite filterComposite
protected java.lang.String initialText
protected org.eclipse.swt.widgets.Composite parent
protected boolean showFilterControls
protected org.eclipse.swt.widgets.Composite treeComposite
public FilteredTreeComposite(org.eclipse.swt.widgets.Composite parent, int treeStyle, PatternFilter filter)
parent
- the parent Composite
treeStyle
- the style bits for the Tree
filter
- the filter to be usedprotected FilteredTreeComposite(org.eclipse.swt.widgets.Composite parent)
init(composite, int, PatternFilter)
method is called in the
overriding constructor.parent
- the parent Composite
init(int, PatternFilter)
protected void init(int treeStyle, PatternFilter filter)
treeStyle
- the style bits for the Tree
filter
- the filter to be usedprotected void createControl(org.eclipse.swt.widgets.Composite parent, int treeStyle)
protected org.eclipse.swt.widgets.Composite createFilterControls(org.eclipse.swt.widgets.Composite parent)
parent
- parent Composite
of the filter controlsComposite
that contains the filter controlsprotected org.eclipse.swt.widgets.Control createTreeControl(org.eclipse.swt.widgets.Composite parent, int style)
doCreateTreeViewer(Composite, int)
to
create the tree viewer. Subclasses should override doCreateTreeViewer(Composite, int)
instead of
overriding this method.parent
- parent Composite
style
- SWT style bits used to create the treeprotected org.eclipse.jface.viewers.TreeViewer doCreateTreeViewer(org.eclipse.swt.widgets.Composite parent, int style)
parent
- the parent compositestyle
- SWT style bits used to create the tree viewerprotected XViewerWorkbenchJob doCreateRefreshJob()
protected void updateToolbar(boolean visible)
protected void createFilterText(org.eclipse.swt.widgets.Composite parent)
doCreateFilterText(Composite)
to create the
text control. Subclasses should override doCreateFilterText(Composite)
instead of overriding this method.parent
- Composite
of the filter textprotected org.eclipse.swt.widgets.Text doCreateFilterText(org.eclipse.swt.widgets.Composite parent)
parent
- the parent compositeprotected void textChanged()
public void setBackground(org.eclipse.swt.graphics.Color background)
setBackground
in class org.eclipse.swt.widgets.Control
background
- background Color
to setprotected void clearText()
protected void setFilterText(java.lang.String string)
public final PatternFilter getPatternFilter()
null
.public org.eclipse.jface.viewers.TreeViewer getViewer()
public org.eclipse.swt.widgets.Text getFilterControl()
null
.protected java.lang.String getFilterString()
public void setInitialText(java.lang.String text)
text
- initial text to appear in text fieldprotected void selectAll()
protected java.lang.String getInitialText()
public static org.eclipse.swt.graphics.Font getBoldFont(java.lang.Object element, FilteredTreeComposite tree, PatternFilter filter)
element
- element for which a match should be determinedtree
- FilteredTree in which the element residesfilter
- PatternFilter which determines a match