Implement the Step Settings Dialog Box
Java Interface | org.pentaho.di.trans.step.StepDialogInterface |
Base class | org.pentaho.di.ui.trans.step.BaseStepDialog |
StepDialogInterface
is the Java interface that implements the plugin settings dialog.
Maintain the Dialog for Step Settings
The dialog
class is responsible for constructing and opening the settings dialog for the step. Whenever you open the step settings in Spoon, the system instantiates the dialog
class passing in the StepMetaInterface
object and calling open()
on the dialog. SWT is the native windowing environment of Spoon and is the framework used for implementing step dialogs.
public String open()
This method returns only after the dialog has been confirmed or cancelled. The method must conform to these rules.
- If the dialog is confirmed
- The
StepMetaInterface
object must be updated to reflect the new step settings - If you changed any step settings, the Changed flag of the
StepMetaInterface
object flag must be set totrue
open()
returns the name of the step
- The
- If the dialog is cancelled
- The
StepMetaInterface
object must not be changed - The Changed flag of the
StepMetaInterface
object must be set to the value it had at the time the dialog opened open()
must returnnull
- The
The StepMetaInterface
object has an internal Changed flag that is accessible using hasChanged()
and setChanged()
. Spoon decides whether the transformation has unsaved changes based on the Changed flag, so it is important for the dialog to set the flag appropriately.
The sample step plugin project has an implementation of the dialog class that is consistent with these rules and is a good basis for creating your own dialog.