Eclipse Workbench Modification

Workbench UI Comoponent 

The Eclipse IDE workbench is basically a SWT shell with TrimLayout (internal API).  That is, the UI component in the benchwork can be customised using any SWT widget.  The class which controls the SWT control inside the workbench shell is org.eclipse.ui.internal.WorkbenchWindow.  Assume you want to add a button permanently in the workbench, modify WorkbenchWindow with the following code snippet:

private Composite composite;
protected void createDefaultContents(final Shell shell) {
	...
	composite = new Composite(shell, SWT.NONE);
	composite.setLayout(new FillLayout());
	Button button = new Button(composite, SWT.NONE);
   	Composite workbenchArea = new Composite(composite, SWT.NONE);
        workbenchArea.setLayout(new FillLayout());
        createPageComposite(workbenchArea);
	...
}
private void updateLayoutDataForContents() {
	...
	defaultLayout.setCenterControl(composite);
	...
}

Welcome View Restore

To restore welcome view on every launch,  there are two options available:

Plug-in Overriding 

There are two ways to override the class in plugin org.eclipse.ui.workbench:

   or

The drawback for the first approach is obvious: the IDE needs to maintain and background compile lots of code from the org.eclipse.ui.workbench plug-in.  However, this approach will always work.  The second approach (class override) does not seems to have good support in IDE (at less in Eclipse 3.3).  In this approach, none of other plug-ins in your workspace that depends on org.eclipse.ui.workbench can detect classes from that plug-in.  So, you may need to export that emtpy plug-in and fragment into your target directory first before further development.


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

or Sign Up  

Other Features

Add Content