Package org.eclipse.e4.ui.dialogs.filteredtree

# Class FilteredTable

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.FilteredTable

All Implemented Interfaces:
  `Drawable`

public class FilteredTable extends AbstractFilteredViewerComposite<PatternFilter>
A simple control that provides a text widget and a table viewer. The contents of the text widget are used to drive a TextMatcher that is on the viewer.

Since:
  1.6

## Field Summary

### Fields inherited from class org.eclipse.jface.viewers.AbstractFilteredViewerComposite

`filterComposite, filterText, initialText, parent, showFilterControls`

### Fields inherited from class org.eclipse.swt.widgets.Control

`handle`

### Fields inherited from class org.eclipse.swt.widgets.Widget

`nativeZoom`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`FilteredTable(Composite parent)`
Create a new instance of the receiver.
``
`FilteredTable(Composite parent, int tableStyle, PatternFilter filter)`
Calls `FilteredTable(Composite, int, PatternFilter, long)` with a default refresh time
``
`FilteredTable(Composite parent, int tableStyle, PatternFilter filter, long refreshDelayTime)`
Create a new instance of the receiver.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`createControl(Composite parent, int tableStyle)`
Create the filtered viewer's controls.
`protected void`
`createFilterText(Composite parent)`
Creates the filter text and adds listeners.
`protected Control`
`createTableControl(Composite parent, int style)`
Creates and set up the table and table viewer.
`protected Text`
`doCreateFilterText(Composite parent)`
Creates the text control for entering the filter text.
`protected Job`
`doCreateRefreshJob()`
Creates a workbench job that will refresh the table based on the current filter text.
`protected TableViewer`
`doCreateTableViewer(Composite parent, int style)`
Creates the table viewer.
`static Font`
`getBoldFont(Object element, FilteredTable table, PatternFilter filter)`
Return a bold font if the given element matches the given pattern.
`final PatternFilter`
`getPatternFilter()`
Returns the pattern filter used by this tree.
`TableViewer`
`getViewer()`
Get the structured viewer of the receiver.
`protected void`
`init(int tableStyle, PatternFilter filter)`
Create the filtered viewer.
`boolean`
`isShowFilterControls()`
`void`
`setBackground(Color background)`
Set the background for the widgets that support the filter text area.
`void`
`setShowFilterControls(boolean showFilterControls)`
`protected void`
`textChanged()`
Update the receiver after the text has changed.

### 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, getData, 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, setAutoscalingMode, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setData, 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, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, 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`

## Constructor Details

### FilteredTable

public FilteredTable(Composite parent, int tableStyle, PatternFilter filter, long refreshDelayTime)
Create a new instance of the receiver.

Parameters:
  `parent` - the parent `Composite`
  `tableStyle` - the style bits for the `table`
  `filter` - the filter to be used
  `refreshDelayTime` - refresh delay in ms, the time to expand the table after debounce

### FilteredTable

public FilteredTable(Composite parent, int tableStyle, PatternFilter filter)
Calls `FilteredTable(Composite, int, PatternFilter, long)` with a default refresh time

### FilteredTable

protected FilteredTable(Composite parent)
Create a new instance of the receiver. Subclasses that wish to override the default creation behavior may use this constructor, but must ensure that the `init(composite, int, PatternFilter)` method is called in the overriding constructor.

Parameters:
  `parent` - the parent `Composite`
See Also:
  - `init(int, PatternFilter)`

## Method Details

### init

protected void init(int tableStyle, PatternFilter filter)
Description copied from class: `AbstractFilteredViewerComposite`
Create the filtered viewer.

Overrides:
  `init` in class `AbstractFilteredViewerComposite<PatternFilter>`
Parameters:
  `tableStyle` - the style bits for the viewer's `Control`
  `filter` - the filter to be used

### createControl

protected void createControl(Composite parent, int tableStyle)
Description copied from class: `AbstractFilteredViewerComposite`
Create the filtered viewer's controls. Subclasses should override.

Overrides:
  `createControl` in class `AbstractFilteredViewerComposite<PatternFilter>`
Parameters:
  `parent` - the parent
  `tableStyle` - SWT style bits used to create the control

### createTableControl

protected Control createTableControl(Composite parent, int style)
Creates and set up the table and table viewer. This method calls `doCreateTableViewer(Composite, int)` to create the table viewer. Subclasses should override `doCreateTableViewer(Composite, int)` instead of overriding this method.

Parameters:
  `parent` - parent `Composite`
  `style` - SWT style bits used to create the table
Returns:
  the table

### doCreateTableViewer

protected TableViewer doCreateTableViewer(Composite parent, int style)
Creates the table viewer. Subclasses may override.

Parameters:
  `parent` - the parent composite
  `style` - SWT style bits used to create the table viewer
Returns:
  the table viewer

### doCreateRefreshJob

protected Job doCreateRefreshJob()
Creates a workbench job that will refresh the table based on the current filter text. Subclasses may override.

Returns:
  a job that can be scheduled to refresh the table

### createFilterText

protected void createFilterText(Composite parent)
Creates the filter text and adds listeners. This method calls `doCreateFilterText(Composite)` to create the text control. Subclasses should override `doCreateFilterText(Composite)` instead of overriding this method.

Overrides:
  `createFilterText` in class `AbstractFilteredViewerComposite<PatternFilter>`
Parameters:
  `parent` - `Composite` of the filter text

### doCreateFilterText

protected Text doCreateFilterText(Composite parent)
Description copied from class: `AbstractFilteredViewerComposite`
Creates the text control for entering the filter text. Subclasses may override.

Specified by:
  `doCreateFilterText` in class `AbstractFilteredViewerComposite<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 class `AbstractFilteredViewerComposite<PatternFilter>`

### setBackground

public void setBackground(Color background)
Set the background for the widgets that support the filter text area.

Overrides:
  `setBackground` in class `Control`
Parameters:
  `background` - background `Color` to set

### getPatternFilter

public final PatternFilter getPatternFilter()
Description copied from class: `AbstractFilteredViewerComposite`
Returns the pattern filter used by this tree.

Overrides:
  `getPatternFilter` in class `AbstractFilteredViewerComposite<PatternFilter>`
Returns:
  The pattern filter; never `null`.

### getViewer

public TableViewer getViewer()
Description copied from class: `AbstractFilteredViewerComposite`
Get the structured viewer of the receiver.

Specified by:
  `getViewer` in class `AbstractFilteredViewerComposite<PatternFilter>`
Returns:
  the structured viewer

### getBoldFont

public static Font getBoldFont(Object element, FilteredTable table, PatternFilter filter)
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 table.

Parameters:
  `element` - element for which a match should be determined
  `table` - FilteredTable in which the element resides
  `filter` - PatternFilter which determines a match
Returns:
  bold font

### isShowFilterControls

public boolean isShowFilterControls()

### setShowFilterControls

public void setShowFilterControls(boolean showFilterControls)