Developing an Editor

The editor for a component is provided by composing a Java class to serve as a wrapper to your interface. The interface your editor provides will be embedded in a standard dialog box that Isight uses to display the editor.

The main requirement that must be adhered to is that your editor must ultimately implement an Isight-provided interface com.engineous.desktop.sdk.DesktopEditor. However, the Isight SDK also provides an abstract class, com.engineous.desktop.sdk.AbstractDesktopEditor, that you can extend to allow you to implement only the methods you need.

The primary methods that must be implemented are:

  • open. Called when the editor is opened by the user. This method is where you will create the GUI if it is not already created.

  • apply. Called when the editor “Apply” button is selected. This method typically involves getting property values from the GUI or back-end application and setting them in the corresponding Isight component property.

The following methods are also available to implement depending on whether or not you need them (all are optional):

  • cancel. Called when the editor “Cancel” button is selected.

  • closeRequest. Called to check if the editor can close (you might decide that the editor should not be able to close if certain information is missing or incorrect).

  • close. Called when the editor is closed (occurs after apply/cancel).

  • navigateTo. Called to open the editor to a specific location from a validation “Go To” request.

  • initEditor. Called to initialize the editor with component property/parameter information and to give a handle to the component object.

  • destroy. Called to destroy the editor (allowing you to perform any necessary clean-up, possibly shutting down a back-end application).

These methods are called in the following order:

  1. initEditor (only one time)
  2. open (every time it is opened)
  3. apply (when OK or Apply is clicked)
  4. cancel (only if Cancel is clicked)
  5. closeRequest (just before closing the interface using the OK button)
  6. close (when closing the interface using the OK and Cancel buttons)
  7. destroy (when component is deleted or model is closed)