public static class TestToolsTest.ExamplePlugInWithDialog extends AbstractPlugIn implements ThreadedPlugIn
Configuration: #execute(PlugInContext)
shows a MultiInputDialog
, in which the user can set field values. The dialog uses static
fields with strings from I18N
to name its fields. When the dialog is
closed it contains the execution parameters to provide them for operations.
Programmatic configuration: Calling #execute(PlugInContext)
can be omitted by providing the execution parameters directly as a new dialog
instance using TestTools.configurePlugIn(PlugIn, java.util.Map, boolean)
.
The keys in the map are the names from the static I18N
fields.
Execution: All operations take place in #run(TaskMonitor,
PlugInContext)
which uses the execution parameters provided by the dialog.
That means that this method has a dependency to the dialog. To execute operations
without showing the user dialog use TestTools.executePlugIn(PlugIn,
WorkbenchContext)
after the parameters in the dialog were configured.
The only methods allowed to be called on the dialog within the #run
method are getText()
, getDouble()
, getInteger()
,
getLayer()
and getBoolean()
in order to use the operations
without showing the user dialog.
shortcutKeys, shortcutModifiers
Constructor and Description |
---|
TestToolsTest.ExamplePlugInWithDialog() |
Modifier and Type | Method and Description |
---|---|
boolean |
execute(PlugInContext context)
Configures plugin.
|
void |
run(TaskMonitor monitor,
PlugInContext context)
Executes operations.
|
addParameter, createName, execute, execute, fetchShortcutEnabledPlugins, getBooleanParam, getDoubleParam, getEnableCheck, getEnableCheck, getIcon, getIcon, getIntegerParam, getName, getParameter, getParameters, getShortcutKeys, getShortcutKeyStroke, getShortcutModifiers, getStringParam, initialize, isRollingBackInvalidEdits, isShortcutEnabled, registerShortcuts, reportNothingToUndoYet, setParameters, setShortcutKeys, setShortcutModifiers, toActionListener, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, initialize
public TestToolsTest.ExamplePlugInWithDialog()
public boolean execute(PlugInContext context) throws java.lang.Exception
execute
in interface PlugIn
execute
in class AbstractPlugIn
java.lang.Exception
- if a problem occurs during plug-in executionThreadedPlugIn
public void run(TaskMonitor monitor, PlugInContext context) throws java.lang.Exception
run
in interface ThreadedPlugIn
monitor
- context to which this task can report its progress and
check whether a party has requested its cancellationjava.lang.Exception