Class FilteredTree
- All Implemented Interfaces:
Drawable
- Since:
- 3.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Control
Deprecated, for removal: This API element is subject to removal in a future version.As of 4.13 not used anymoreprotected ToolBarManager
Deprecated, for removal: This API element is subject to removal in a future version.As of 4.13 not used anymoreprotected Composite
protected TreeViewer
The viewer for the filtered tree.Fields inherited from class org.eclipse.jface.viewers.AbstractFilteredViewerComposite
filterComposite, filterText, initialText, parent, showFilterControls
Fields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FilteredTree
(Composite parent) Deprecated.As of 3.116, replaced byFilteredTree(Composite, boolean, boolean)
protected
FilteredTree
(Composite parent, boolean useNewLook) Deprecated.As of 3.116, replaced byFilteredTree(Composite, int, PatternFilter, boolean, boolean)
FilteredTree
(Composite parent, boolean useNewLook, boolean useFastHashLookup) Create a new instance of the receiver.FilteredTree
(Composite parent, int treeStyle, PatternFilter filter) Deprecated.As of 3.116, replaced byFilteredTree(Composite, int, PatternFilter, boolean, boolean)
FilteredTree
(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) Deprecated.As of 3.116, replaced byFilteredTree(Composite, int, PatternFilter, boolean, boolean)
FilteredTree
(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook, boolean useFastHashLookup) CallsFilteredTree(Composite, int, PatternFilter, boolean, boolean, long)
with a default refresh timeFilteredTree
(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook, boolean useFastHashLookup, long refreshJobDelayInMillis) Create a new instance of the receiver. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createControl
(Composite parent, int treeStyle) Create the filtered viewer's controls.protected void
createFilterText
(Composite parent) Creates the filter text and adds listeners.protected Control
createTreeControl
(Composite parent, int style) Creates and set up the tree and tree viewer.protected Text
doCreateFilterText
(Composite parent) Creates the text control for entering the filter text.protected WorkbenchJob
Creates a workbench job that will refresh the tree based on the current filter text.protected TreeViewer
doCreateTreeViewer
(Composite parent, int style) Creates the tree viewer.static Font
getBoldFont
(Object element, FilteredTree tree, PatternFilter filter) Return a bold font if the given element matches the given pattern.final PatternFilter
Returns the pattern filter used by this tree.Get the structured viewer of the receiver.protected void
init
(int treeStyle, PatternFilter filter) Create the filtered viewer.void
setQuickSelectionMode
(boolean enabled) Sets whether this filtered tree is used to make quick selections.protected void
Update the receiver after the text has changed.protected void
updateToolbar
(boolean visible) Updates the toolbar.protected void
updateTreeSelection
(boolean setFocus) Updates the selection in the tree, based on the filter text.Methods inherited from class org.eclipse.jface.viewers.AbstractFilteredViewerComposite
clearText, createFilterControls, getFilterControl, getFilterString, getInitialText, getRefreshJobDelay, selectAll, setFilterText, setInitialText
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsMode
Methods inherited from class org.eclipse.swt.widgets.Control
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, setBackground, 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
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Field Details
-
filterToolBar
Deprecated, for removal: This API element is subject to removal in a future version.As of 4.13 not used anymoreNote: As of 4.13 not used anymore
-
clearButtonControl
Deprecated, for removal: This API element is subject to removal in a future version.As of 4.13 not used anymoreNote: As of 4.13 not used anymore
- Since:
- 3.5
-
treeViewer
The viewer for the filtered tree. This value should never benull
after the widget creation methods are complete. -
treeComposite
- Since:
- 3.3
-
-
Constructor Details
-
FilteredTree
Create a new instance of the receiver. Subclasses that wish to override the default creation behavior may use this constructor, but must ensure that theinit(composite, int, PatternFilter)
method is called in the overriding constructor. *WARNING: Passing false as parameter for useFastHashLookup results in a slow performing tree and should not be used if the underlying data model uses a stable and correct hashCode and equals implementation.
- Parameters:
parent
- the parentComposite
useNewLook
- ignored, keep for API complianceuseFastHashLookup
- true, if tree should use fast hashlookup, false, if the tree should be slow but working for data with mutable or broken hashcode implementation. Only used if treeViewer is already initialized- Since:
- 3.116
-
FilteredTree
public FilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook, boolean useFastHashLookup) CallsFilteredTree(Composite, int, PatternFilter, boolean, boolean, long)
with a default refresh time- Since:
- 3.116
-
FilteredTree
public FilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook, boolean useFastHashLookup, long refreshJobDelayInMillis) Create a new instance of the receiver.WARNING: Passing false as parameter for useFastHashLookup results in a slow performing tree and should not be used if the underlying data model uses a stable and correct hashCode and equals implementation.
- Parameters:
parent
- the parentComposite
treeStyle
- the style bits for theTree
filter
- the filter to be useduseNewLook
- ignored, keep for API complianceuseFastHashLookup
- true, if tree should use fast hash lookup, false, if the tree should be slow but working for data with mutable or broken hashcode implementation. Only used if treeViewer is already initializedrefreshJobDelayInMillis
- refresh delay in ms, the time to expand the tree after debounce- Since:
- 3.132
-
FilteredTree
Deprecated.As of 3.116, replaced byFilteredTree(Composite, boolean, boolean)
Create a new instance of the receiver. Subclasses that wish to override the default creation behavior may use this constructor, but must ensure that theinit(composite, int, PatternFilter)
method is called in the overriding constructor.WARNING: Using this constructor results in a slow performing tree and should not be used if the underlying data model uses a stable and correct hashCode and equals implementation. Prefer the usage of
FilteredTree(Composite, boolean, boolean)
if possible.- Parameters:
parent
- the parentComposite
- Since:
- 3.3
- See Also:
-
FilteredTree
Deprecated.As of 3.116, replaced byFilteredTree(Composite, int, PatternFilter, boolean, boolean)
Create a new instance of the receiver. Subclasses that wish to override the default creation behavior may use this constructor, but must ensure that theinit(composite, int, PatternFilter)
method is called in the overriding constructor. *WARNING: Using this constructor results in a slow performing tree and should not be used if the underlying data model uses a stable and correct hashCode and equals implementation. Prefer the usage of
FilteredTree(Composite, int, PatternFilter, boolean, boolean)
if possible.- Parameters:
parent
- the parentComposite
useNewLook
- ignored, look introduced in 3.5 is always used- Since:
- 3.5
- See Also:
-
FilteredTree
Deprecated.As of 3.116, replaced byFilteredTree(Composite, int, PatternFilter, boolean, boolean)
Create a new instance of the receiver.WARNING: Using this constructor results in a slow performing tree and should not be used if the underlying data model uses a stable and correct hashCode and equals implementation. Prefer the usage of
FilteredTree(Composite, int, PatternFilter, boolean, boolean)
if possible.- Parameters:
parent
- the parentComposite
treeStyle
- the style bits for theTree
filter
- the filter to be used
-
FilteredTree
@Deprecated public FilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) Deprecated.As of 3.116, replaced byFilteredTree(Composite, int, PatternFilter, boolean, boolean)
Create a new instance of the receiver.WARNING: Using this constructor results in a slow performing tree and should not be used if the underlying data model uses a stable and correct hashCode and equals implementation. Prefer the usage of
FilteredTree(Composite, int, PatternFilter, boolean, boolean)
if possible- Parameters:
parent
- the parentComposite
treeStyle
- the style bits for theTree
filter
- the filter to be useduseNewLook
- ignored, look introduced in 3.5 is always used- Since:
- 3.5
-
-
Method Details
-
init
Description copied from class:AbstractFilteredViewerComposite
Create the filtered viewer.- Overrides:
init
in classAbstractFilteredViewerComposite<PatternFilter>
- Parameters:
treeStyle
- the style bits for the viewer'sControl
filter
- the filter to be used
-
createControl
Description copied from class:AbstractFilteredViewerComposite
Create the filtered viewer's controls. Subclasses should override.- Overrides:
createControl
in classAbstractFilteredViewerComposite<PatternFilter>
- Parameters:
parent
- the parenttreeStyle
- SWT style bits used to create the control
-
createTreeControl
Creates and set up the tree and tree viewer. This method callsdoCreateTreeViewer(Composite, int)
to create the tree viewer. Subclasses should overridedoCreateTreeViewer(Composite, int)
instead of overriding this method.- Parameters:
parent
- parentComposite
style
- SWT style bits used to create the tree- Returns:
- the tree
-
doCreateTreeViewer
Creates the tree viewer. Subclasses may override.- Parameters:
parent
- the parent compositestyle
- SWT style bits used to create the tree viewer- Returns:
- the tree viewer
- Since:
- 3.3
-
doCreateRefreshJob
Creates a workbench job that will refresh the tree based on the current filter text. Subclasses may override.- Returns:
- a workbench job that can be scheduled to refresh the tree
- Since:
- 3.4
-
updateToolbar
protected void updateToolbar(boolean visible) Updates the toolbar. The default implementation does nothing. Subclasses may override.- Parameters:
visible
- boolean
-
createFilterText
Creates the filter text and adds listeners. This method callsdoCreateFilterText(Composite)
to create the text control. Subclasses should overridedoCreateFilterText(Composite)
instead of overriding this method.- Overrides:
createFilterText
in classAbstractFilteredViewerComposite<PatternFilter>
- Parameters:
parent
-Composite
of the filter text
-
updateTreeSelection
protected void updateTreeSelection(boolean setFocus) Updates the selection in the tree, based on the filter text.- Parameters:
setFocus
-true
if the focus should be set on the tree,false
otherwise- Since:
- 3.105
-
doCreateFilterText
Description copied from class:AbstractFilteredViewerComposite
Creates the text control for entering the filter text. Subclasses may override.- Specified by:
doCreateFilterText
in classAbstractFilteredViewerComposite<PatternFilter>
- Parameters:
parent
- the parent composite- Returns:
- the text widget
-
textChanged
protected void textChanged()Description copied from class:AbstractFilteredViewerComposite
Update the receiver after the text has changed.- Specified by:
textChanged
in classAbstractFilteredViewerComposite<PatternFilter>
-
getPatternFilter
Description copied from class:AbstractFilteredViewerComposite
Returns the pattern filter used by this tree.- Overrides:
getPatternFilter
in classAbstractFilteredViewerComposite<PatternFilter>
- Returns:
- The pattern filter; never
null
.
-
getViewer
Description copied from class:AbstractFilteredViewerComposite
Get the structured viewer of the receiver.- Specified by:
getViewer
in classAbstractFilteredViewerComposite<PatternFilter>
- Returns:
- the structured viewer
-
setQuickSelectionMode
public void setQuickSelectionMode(boolean enabled) Sets whether this filtered tree is used to make quick selections. In this mode the first match in the tree is automatically selected while filtering and the 'Enter' key is not used to move the focus to the tree.By default, this is set to
false
.- Parameters:
enabled
-true
if this filtered tree is used to make quick selections,false
otherwise- Since:
- 3.105
-
getBoldFont
Return a bold font if the given element matches the given pattern. Clients can opt to call this method from a Viewer's label provider to get a bold font for which to highlight the given element in the tree.- Parameters:
element
- element for which a match should be determinedtree
- FilteredTree in which the element residesfilter
- PatternFilter which determines a match- Returns:
- bold font
-