Using the Eclipse 2.1 Look and Feel in RCP

As illustrated by the following snippet, RCP apps can invoke the Eclipse 2.1 theme programatically via the preference settings:

IPreferenceStore apiStore = PrefUtil.getAPIPreferenceStore();
IPreferenceStore internalStore = PrefUtil.getInternalPreferenceStore();
apiStore.setValue(IWorkbenchPreferenceConstants.PRESENTATION_FACTORY_ID,
                  "org.eclipse.ui.internal.r21presentationFactory");
internalStore.setValue(IPreferenceConstants.VIEW_TAB_POSITION, SWT.BOTTOM);
apiStore.setValue(IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR, "");
apiStore.setValue(IWorkbenchPreferenceConstants.INITIAL_FAST_VIEW_BAR_LOCATION,
                  "left");
apiStore.setValue(IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR,
                  false);

Make sure this code gets called from:

WorkbenchAdvisor.preWindowOpen()

This tip originally was posted on the eclipsepowered-discussion mailing list by James Willans [jwillans at cs.york.ac.uk] who reports that he got it from Andrew Eidsness.

~~LINKBACK~~ ~~DISCUSSION:closed~~