org.openjump.test
Class TestToolsTest.ExamplePlugInWithFields

java.lang.Object
  extended by com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
      extended by org.openjump.test.TestToolsTest.ExamplePlugInWithFields
All Implemented Interfaces:
PlugIn, ThreadedPlugIn
Enclosing class:
TestToolsTest

public static class TestToolsTest.ExamplePlugInWithFields
extends AbstractPlugIn
implements ThreadedPlugIn

Fixture that outlines a plugin which accepts parameters in instance fields. Both an user dialog and a map can be used to provide execution parameters.

Configuration: #execute(PlugInContext) shows a MultiInputDialog, in which the user can set field values. When the dialog is closed these values are assigned as execution parameters to the instance fields #parameter1 and #parameter2. The dialog is used only within this method.

Programmatic configuration: Calling #execute(PlugInContext) can be omitted by providing the execution parameters directly to the instance fields using TestTools.configurePlugIn(PlugIn, java.util.Map).

Execution: All operations take place in #run(TaskMonitor, PlugInContext) which uses the execution parameters. To execute operations without the need of an user dialog use TestTools.executePlugIn(PlugIn, WorkbenchContext) after the parameters were configured.

See Also:
TestTools.configurePlugIn(PlugIn, java.util.Map), TestTools.executePlugIn(PlugIn, WorkbenchContext)

Constructor Summary
TestToolsTest.ExamplePlugInWithFields()
           
 
Method Summary
 boolean execute(PlugInContext context)
          Configures plugin.
 void run(TaskMonitor monitor, PlugInContext context)
          Executes operations.
 
Methods inherited from class com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
createName, execute, execute, getName, initialize, isRollingBackInvalidEdits, reportNothingToUndoYet, toActionListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vividsolutions.jump.workbench.plugin.PlugIn
getName, initialize
 

Constructor Detail

TestToolsTest.ExamplePlugInWithFields

public TestToolsTest.ExamplePlugInWithFields()
Method Detail

execute

public boolean execute(PlugInContext context)
                throws java.lang.Exception
Configures plugin.

Specified by:
execute in interface PlugIn
Overrides:
execute in class AbstractPlugIn
Returns:
true if the action completed, false if it was aborted. Used by ThreadedPlugIns to indicate that their #run method needn't be called next.
Throws:
java.lang.Exception - if a problem occurs during plug-in execution
See Also:
ThreadedPlugIn

run

public void run(TaskMonitor monitor,
                PlugInContext context)
         throws java.lang.Exception
Executes operations.

Specified by:
run in interface ThreadedPlugIn
Parameters:
monitor - context to which this task can report its progress and check whether a party has requested its cancellation
Throws:
java.lang.Exception