In order to add a new section to a new or existing page of the JSDL editor the following steps should be performed:
public NewPageSection( final Composite parent, final FormToolkit toolkit ){
createSection( parent, toolkit );
}
private void createSection( final Composite parent, final FormToolkit toolkit ) {
String sectionTitle = Messages.getString( "Page_NewPageSectionTitle" );
String sectionDescription = Messages.getString( "Page_SectionDescription" );
Composite client = FormSectionFactory.createGridStaticSection( toolkit,
parent,
sectionTitle,
sectionDescription,
2 );
...
toolkit.paintBordersFor( client );
}
@Override
protected void createFormContent( final IManagedForm managedForm ) {
ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
form.setText( Messages.getString( "Page_Title" ) );
this.body = form.getBody();
this.body.setLayout( FormLayoutFactory.createFormTableWrapLayout( false, 2 ) );
...
}
this.newSectionComposit = toolkit.createComposite( this.body ); this.newSectionComposit.setLayout( FormLayoutFactory.createFormPaneTableWrapLayout( false, 1 ) ); this.newSectionComposit.setLayoutData( new TableWrapData( TableWrapData.FILL_GRAB ) ); this.newSection = new ApplicationSection( this.newSectionComposit, toolkit); this.newSection.setInput( this.jobDefinitionType ); this.newSection.addListener( this );