In order to add a new page to the the JSDL editor the following steps should be
performed:
- Create a new class under eu.geclipse.ui.internal.pages that extends
the eu.geclipse.jsdl.ui.internal.page.JsdlFormPage class.
- 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";
- The class constructor must call the super class constructor as follows:
public NewPage( final FormEditor editor ) {
super( editor, PAGE_ID, Messages.getString( "New_PageTitle" ) );
}
- 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.
- Override the setActive() method for performing any necessary operations
when the new page becomes active.
- 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";
}
- 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.
- Create a protected Composite variable for the form body composite.
- 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;
}
- In the eu.geclipse.jsdl.ui.editors.JsdlEditor class do the following:
- Create a new instance of the newly created page as follows:
NewPage newJsdlEditorPage = new NewPage(this);
- In the addPages() method add the newly created page by calling the
addPage() method.
- Set the dirty state of the new page to false in the cleanDirtyState()
method.
- In pushContentToPages() method call the setPageContent()
method of the new page as follows:
if( this.newJsdlEditorPage != null ) {
this.newJsdlEditorPage.setPageContent( this.jobDefType, isModelRefreshed() );
}