Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Implementing the Job Entry Settings Dialog Box

JobEntryDialogInterface is the Java interface that implements the settings dialog of a job entry plugin.

Maintain the Dialog for Job Entry Settings

The dialog class is responsible for constructing and opening the settings dialog for the job entry. When you open the job entry settings in Spoon, the system instantiates the dialog class passing in the JobEntryInterface object and calling the open() method on the dialog. SWT is the native windowing environment of Spoon and the framework used for implementing job entry dialogs. 

public JobEntryInterface 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 JobEntryInterface object must be updated to reflect the new settings
    • If you changed any settings, the Changed flag of the JobEntryInterface object must be set to true
    • open() returns the JobEntryInterface object
  • If the dialog is cancelled
    • The JobEntryInterface object must not be changed
    • The Changed flag of theJobEntryInterface object must be set to the value it had at the time the dialog opened
    • open() must return null

The JobEntryInterface object has an internal Changed flag that is accessible using hasChanged() and setChanged(). Spoon decides whether the job has unsaved changes based on the Changed flag, so it is important for the dialog to set the flag appropriately. 

Additionally, the job entry dialog must make sure that the job entry name is not set to be empty. The dialog may be confirmed only after a non-empty name is set.

The sample Job Entry plugin project has an implementation of the dialog class that is consistent with these rules and is a good basis for creating your own dialogs.