[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Multipage XML editor

Check with the forms plugin for creating a multipage editor similar what the plugin.xml provides.

Create a MultiPageEditor class which extends org.eclipse.ui.forms.editor.FormEditor class. Within this class add the method

protected void addPages() {
  // org.eclipse.ui.forms.editor.FormPage or subclass instances
  addPage(  /* instance */ );
  addPage(  /* instance */ );
  addPage(  /* instance */ );
}

Within each FormPage class override the method

  protected void createFormContent(IManagedForm managedForm) {
     ScrolledForm form = managedForm.getForm();
     FormToolkit toolkit = managedForm.getToolkit();
     form.setText( getResourceString( Constants.CONFIG_TITLE ) );
     form.setBackgroundImage( getImage(IMG_FORM_BANNER ) );
     toolkit.createCompositeSeparator( form );
		
     GridLayout layout = new GridLayout();
     layout.numColumns = 1;
     layout.marginWidth = 10;
     form.getBody().setLayout(layout);
   }

Hope this helps.