Class FilteredTableBaseHandler
- All Implemented Interfaces:
IHandler
,IHandler2
,IExecutableExtension
- Direct Known Subclasses:
CycleEditorHandler
,CyclePerspectiveHandler
,CycleViewHandler
,WorkbookEditorsHandler
Table
.- Since:
- 4.6.2
- See Also:
-
and CycleBaseHandler
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class used to store items to be displayed -
Field Summary
Modifier and TypeFieldDescriptionprotected ParameterizedCommand
protected ParameterizedCommand
protected Shell
protected boolean
protected WorkbenchPage
protected Object
protected IWorkbenchWindow
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate
(IWorkbenchPage page, Object selectedItem) Activate the selected item.protected void
addKeyListener
(Table table, Shell dialog) Add Keylistener to the table, user actions can influence the dialog.protected void
addKeyListener
(Text text) Add Key Listener to the search text. manage key events on search textprotected void
addModifyListener
(Text text) Add modify listener to the search text, trigger search each time text changes.protected void
addMouseListener
(Table table, Shell dialog) Add mouse listener to the table closing it when the mouse is pressed.protected final void
addTraverseListener
(Table table) Adds a listener to the given table that blocks all traversal operations.protected void
Close the dialog and set selection to null.protected void
Clears the forward and backward trigger sequences.execute
(ExecutionEvent event) Executes with the map of parameter values by name.protected Color
protected abstract ParameterizedCommand
Get the backward command.protected ColumnLabelProvider
Default ColumnLabelProvider.protected int
Get the index of the current item (not valid if there are no items).protected ViewerFilter
Return the filter to use.protected Color
protected abstract ParameterizedCommand
Get the forward command.protected abstract Object
getInput
(WorkbenchPage page) Add all items to the dialog in the activation orderprotected String
getTableHeader
(IWorkbenchPart activePart) Get TableHeader, return title for non-filtered lists.protected void
Fetch the key bindings for the forward and backward commands.protected String
Returns the text for the givenWorkbenchPartReference
protected boolean
True to show search text and enable filtering.protected void
Intended to be overwritten by test classes so the handler won't block the UI threadprotected void
Close the dialog saving the selectionvoid
openDialog
(WorkbenchPage page, IWorkbenchPart activePart) protected void
setDialogLocation
(Shell dialog, IWorkbenchPart activePart) Sets the dialog's location on the screen.void
setInitializationData
(IConfigurationElement config, String propertyName, Object data) This method is called by the implementation of the methodIConfigurationElement.createExecutableExtension
on a newly constructed extension, passing it its relevant configuration information.protected void
setLabelProvider
(TableViewerColumn tableViewerColumn) Sets the label provider for the only column visible in the table.protected void
setMatcherString
(String pattern) Set the filter text entered by the User, does nothing by defaultMethods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.core.commands.IHandler
getHandlerLabel
-
Field Details
-
window
-
page
-
gotoDirection
protected boolean gotoDirection -
commandBackward
-
commandForward
-
result
-
dialog
-
-
Constructor Details
-
FilteredTableBaseHandler
public FilteredTableBaseHandler()
-
-
Method Details
-
getCurrentItemIndex
protected int getCurrentItemIndex()Get the index of the current item (not valid if there are no items). -
execute
Description copied from interface:IHandler
Executes with the map of parameter values by name.- Specified by:
execute
in interfaceIHandler
- Parameters:
event
- An event containing all the information about the current state of the application; must not benull
.- Returns:
- the result of the execution. Reserved for future use, must be
null
. - Throws:
ExecutionException
- if an exception occurred during execution.
-
openDialog
-
keepOpen
Intended to be overwritten by test classes so the handler won't block the UI thread -
setDialogLocation
Sets the dialog's location on the screen. -
clearTriggers
protected void clearTriggers()Clears the forward and backward trigger sequences. -
getTriggers
protected void getTriggers()Fetch the key bindings for the forward and backward commands. They will not change while the dialog is open, but the context will. Bug 55581. -
addModifyListener
Add modify listener to the search text, trigger search each time text changes. After the search the first matching result is selected. -
addKeyListener
Add Key Listener to the search text. manage key events on search text -
getForeground
-
getBackground
-
addKeyListener
Add Keylistener to the table, user actions can influence the dialog. -
addTraverseListener
Adds a listener to the given table that blocks all traversal operations.- Parameters:
table
- The table to which the traversal suppression should be added; must not benull
.
-
activate
Activate the selected item.- Parameters:
page
- the pageselectedItem
- the selected item
-
cancel
Close the dialog and set selection to null. -
ok
Close the dialog saving the selection -
addMouseListener
Add mouse listener to the table closing it when the mouse is pressed. -
isFiltered
protected boolean isFiltered()True to show search text and enable filtering. False by default -
getFilter
Return the filter to use. Null by default -
setMatcherString
Set the filter text entered by the User, does nothing by default- Parameters:
pattern
- may be used in overrides
-
getWorkbenchPartReferenceText
Returns the text for the givenWorkbenchPartReference
-
setLabelProvider
Sets the label provider for the only column visible in the table. Subclasses can override this method to style the table, using a StyledCellLabelProvider. -
getColumnLabelProvider
Default ColumnLabelProvider. The table has only one column -
getInput
Add all items to the dialog in the activation order -
getBackwardCommand
Get the backward command. -
getForwardCommand
Get the forward command. -
getTableHeader
Get TableHeader, return title for non-filtered lists. By default returns an empty String. Subclasses can use the active part to detect the type of object.- Parameters:
activePart
- may be used in overrides
-
getSelection
-
getWindow
-
getBackwardTriggerSequences
-
getForwardTriggerSequences
-
setInitializationData
Description copied from interface:IExecutableExtension
This method is called by the implementation of the methodIConfigurationElement.createExecutableExtension
on a newly constructed extension, passing it its relevant configuration information. Most executable extensions only make use of the first two call arguments.Regular executable extensions specify their Java implementation class name as an attribute of the configuration element for the extension. For example
<action run="com.example.BaseAction"/>
In the above example, this method would be called with a reference to the
<action>
element (first argument), and"run"
as the name of the attribute that defined this executable extension (second argument).The last parameter is for the specific use of extension adapters and is typically not used by regular executable extensions.
There are two supported ways of associating additional adapter-specific data with the configuration in a way that is transparent to the extension point implementor:
(1) by specifying adapter data as part of the implementation class attribute value. The Java class name can be followed by a ":" separator, followed by any adapter data in string form. For example, if the extension point specifies an attribute
"run"
to contain the name of the extension implementation, an adapter can be configured as<action run="com.example.ExternalAdapter:./cmds/util.exe -opt 3"/>
(2) by converting the attribute used to specify the executable extension to a child element of the original configuration element, and specifying the adapter data in the form of xml markup. Using this form, the example above would become
<action> <run class="com.xyz.ExternalAdapter"> <parameter name="exec" value="./cmds/util.exe"/> <parameter name="opt" value="3"/> </run> </action>
Form (2) will typically only be used for extension points that anticipate the majority of extensions configured into it will in fact be in the form of adapters.
In either case, the specified adapter class is instantiated using its 0-argument public constructor. The adapter data is passed as the last argument of this method. The data argument is defined as Object. It can have the following values:
null
, if no adapter data was supplied- in case (1), the initialization data string is passed as a
String
- in case (2), the initialization data is passed as a
Hashtable
containing the actual parameter names and values (bothString
s)
- Specified by:
setInitializationData
in interfaceIExecutableExtension
- Parameters:
config
- the configuration element used to trigger this execution. It can be queried by the executable extension for specific configuration propertiespropertyName
- the name of an attribute of the configuration element used on thecreateExecutableExtension(String)
call. This argument can be used in the cases where a single configuration element is used to define multiple executable extensions.data
- adapter data in the form of aString
, aHashtable
, ornull
.- See Also:
-