Class FilteredTree
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.jface.viewers.AbstractFilteredViewerComposite<PatternFilter>
org.eclipse.e4.ui.dialogs.filteredtree.FilteredTree
- All Implemented Interfaces:
Drawable
Based on org.eclipse.ui.dialogs.FilteredTree.
- Since:
- 1.2
-
Field Summary
Fields inherited from class org.eclipse.jface.viewers.AbstractFilteredViewerComposite
filterComposite, filterText, initialText, parent, showFilterControlsFields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFilteredTree(Composite parent) Create a new instance of the receiver.FilteredTree(Composite parent, int treeStyle, PatternFilter filter) CallsFilteredTree(Composite, int, PatternFilter, long)with a default refresh timeFilteredTree(Composite parent, int treeStyle, PatternFilter filter, long refreshDelayTime) Create a new instance of the receiver. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateControl(Composite parent, int treeStyle) Create the filtered viewer's controls.protected voidcreateFilterText(Composite parent) Creates the filter text and adds listeners.protected ControlcreateTreeControl(Composite parent, int style) Creates and set up the tree and tree viewer.protected TextdoCreateFilterText(Composite parent) Creates the text control for entering the filter text.protected BasicUIJobCreates a workbench job that will refresh the tree based on the current filter text.protected TreeViewerdoCreateTreeViewer(Composite parent, int style) Creates the tree viewer.static FontgetBoldFont(Object element, FilteredTree tree, PatternFilter filter) Return a bold font if the given element matches the given pattern.final PatternFilterReturns the pattern filter used by this tree.Get the structured viewer of the receiver.protected voidinit(int treeStyle, PatternFilter filter) Create the filtered viewer.booleanvoidsetBackground(Color background) Set the background for the widgets that support the filter text area.voidsetShowFilterControls(boolean showFilterControls) protected voidUpdate the receiver after the text has changed.protected voidupdateToolbar(boolean visible) Methods inherited from class org.eclipse.jface.viewers.AbstractFilteredViewerComposite
clearText, createFilterControls, getFilterControl, getFilterString, getInitialText, getRefreshJobDelay, selectAll, setFilterText, setInitialTextMethods 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, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods 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, 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, updateMethods 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, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Constructor Details
-
FilteredTree
Create a new instance of the receiver.- Parameters:
parent- the parentCompositetreeStyle- the style bits for theTreefilter- the filter to be usedrefreshDelayTime- refresh delay in ms, the time to expand the tree after debounce- Since:
- 1.5
-
FilteredTree
CallsFilteredTree(Composite, int, PatternFilter, long)with a default refresh time -
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.- Parameters:
parent- the parentComposite- See Also:
-
-
Method Details
-
init
Description copied from class:AbstractFilteredViewerCompositeCreate the filtered viewer.- Overrides:
initin classAbstractFilteredViewerComposite<PatternFilter>- Parameters:
treeStyle- the style bits for the viewer'sControlfilter- the filter to be used
-
createControl
Description copied from class:AbstractFilteredViewerCompositeCreate the filtered viewer's controls. Subclasses should override.- Overrides:
createControlin 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- parentCompositestyle- 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) -
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:
createFilterTextin classAbstractFilteredViewerComposite<PatternFilter>- Parameters:
parent-Compositeof the filter text
-
doCreateFilterText
Description copied from class:AbstractFilteredViewerCompositeCreates the text control for entering the filter text. Subclasses may override.- Specified by:
doCreateFilterTextin classAbstractFilteredViewerComposite<PatternFilter>- Parameters:
parent- the parent composite- Returns:
- the text widget
-
textChanged
protected void textChanged()Description copied from class:AbstractFilteredViewerCompositeUpdate the receiver after the text has changed.- Specified by:
textChangedin classAbstractFilteredViewerComposite<PatternFilter>
-
setBackground
Set the background for the widgets that support the filter text area.- Overrides:
setBackgroundin classControl- Parameters:
background- backgroundColorto set
-
getPatternFilter
Description copied from class:AbstractFilteredViewerCompositeReturns the pattern filter used by this tree.- Overrides:
getPatternFilterin classAbstractFilteredViewerComposite<PatternFilter>- Returns:
- The pattern filter; never
null.
-
getViewer
Description copied from class:AbstractFilteredViewerCompositeGet the structured viewer of the receiver.- Specified by:
getViewerin classAbstractFilteredViewerComposite<PatternFilter>- Returns:
- the structured viewer
-
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
-
isShowFilterControls
public boolean isShowFilterControls() -
setShowFilterControls
public void setShowFilterControls(boolean showFilterControls)
-