Skip to main content
Pentaho Documentation

Implementing the Partitioner Settings Dialog Box

StepDialogInterface is the Java interface that implements the settings dialog of a partitioner plugin.

Maintain the Dialog for Partitioner Settings

The dialog class is responsible for constructing and opening the settings dialog for the partitioner. When you open the partitioning settings in Spoon, the system instantiates the dialog class passing in a StepPartitioningMeta object. Retrieve the Partitioner object by calling getPartitioner() and call the open() method on the dialog. SWT is the native windowing environment of Spoon and the framework used for implementing 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 Partition object must be updated to reflect the new settings
    • If you changed any settings, the StepPartitioningMeta object Changed flag must be set to true
    • open() returns the name of the step to which the partitioning is applied—use the stepname field inherited from BaseStepDialog
  • If the dialog is cancelled
    • The Partition object must not be changed
    • The StepPartitioningMeta object Changed flag must be set to the value it had at the time the dialog opened
    • open() must return null

The StepPartitioningMeta 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 Partitioner plugin project has an implementation of the dialog class that is consistent with the these rules and is a good basis for creating your own dialogs.