This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blog:using_the_eclipse_2.1_look_and_feel_in_rcp [2008/04/26 22:09] djo |
blog:using_the_eclipse_2.1_look_and_feel_in_rcp [2014/10/17 22:08] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 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: | ||
+ | |||
+ | <code java> | ||
+ | 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); | ||
+ | </code> | ||
+ | |||
+ | Make sure this code gets called from: | ||
+ | |||
+ | <code java>WorkbenchAdvisor.preWindowOpen()</code> | ||
+ | |||
+ | 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~~ | ||