Adding Pages to the JSDL Editor

In order to add a new page to the the JSDL editor the following steps should be performed:

  1. Create a new class under eu.geclipse.ui.internal.pages that extends the eu.geclipse.jsdl.ui.internal.page.JsdlFormPage class.
  2. Create a protected static final string variable called PAGE_ID that provides a human readable ID of the new page as follows:
    protected static final String PAGE_ID = "NEW_PAGE";
  3. The class constructor must call the super class constructor as follows:
    public NewPage( final FormEditor editor ) {
          super( editor, PAGE_ID, Messages.getString( "New_PageTitle" ) );
         }
  4. Override the dispose() method for disposing any page specific objects. Note: The super class dispose method should be called before any page specific objects are disposed.
  5. Override the setActive() method for performing any necessary operations when the new page becomes active.
  6. Override the getHelpResource()method for linking the page with help system as follows:
      @Override
      protected String getHelpResource() {
        return "/eu.geclipse.doc.user/html/concepts/jobmanagement/editorpages/newpage.html";
      }
    
  7. Override the createFormContent( final IManagedForm managedForm ) method for creating sections on the JSDL page. Go to "Adding Sections to a JSDL Editor page" for more information on this.
  8. Create a protected Composite variable for the form body composite.
  9. Create a public setPageContent() method which takes as parameters objects belonging to class eu.geclipse.jsdl.model.base.JobDefinitionType and a boolean variable indicating whether the page has been refreshed. An exemplary method is given below:
    public void setPageContent( final JobDefinitionType jobDefinitionRoot,
                                     final boolean refreshStatus )
      {
        if( refreshStatus ) {
          this.contentRefreshed = true;
          this.jobDefinitionType = jobDefinitionRoot;
        }
        this.jobDefinitionType = jobDefinitionRoot;      
      }
    
  10. In the eu.geclipse.jsdl.ui.editors.JsdlEditor class do the following:
    1. Create a new instance of the newly created page as follows:
      NewPage newJsdlEditorPage = new NewPage(this);
    2. In the addPages() method add the newly created page by calling the addPage() method.
    3. Set the dirty state of the new page to false in the cleanDirtyState() method.
    4. In pushContentToPages() method call the setPageContent() method of the new page as follows:
       if( this.newJsdlEditorPage != null ) {
            this.newJsdlEditorPage.setPageContent( this.jobDefType, isModelRefreshed() );
          }