View RSS Feed

My Java Tips

RCP Custom Look and Feel

Rate this Entry
by , 11-14-2011 at 04:40 PM (1220 Views)
The presentation of your Rich Client Platform application can be changed using the org.eclipse.ui.presentationFactories extension point.


This example will show how to use the R2.1 presentation, provided by the org.eclipse.ui.presentations.r21 plugin, in the RCP Browser Example application. Here is a screen shot of the browser example using the R2.1 presentation.




The following steps will deploy the plugin into the RCP application and activate it by setting some preferences.

- Deploy the RCP browser example by following these instructions.
- Build and deploy the org.eclipse.ui.presentations.r21 plugin.
- Copy the file eclipse/plugins/org.eclipse.ui.presentations.r21_3.1.0/r21presentation.ini into the directory eclipse/plugins/org.eclipse.ui.examples.rcp.browser_3.1.0.
- Edit eclipse/plugins/org.eclipse.ui.examples.rcp.browser_3.1.0/plugin.xml so that the products extension looks like:

Java Code:
 <extension
         point="org.eclipse.core.runtime.products"
         id="product"&gt;
<product
            name="%productName"
            application="org.eclipse.ui.examples.rcp.browser.app"&gt;
<property
               name="appName"
               value="%swtAppName"/&gt;
<property
               name="windowImages"
               value="icons/eclipse.gif,icons/eclipse32.gif"/&gt;
<property
               name="aboutText"
               value="%aboutText"/&gt;
<property
               name="aboutImage"
               value="icons/eclipse_lg.gif"/&gt;
<property
               name="preferenceCustomization"
               value="r21presentation.ini"/&gt;

</property
</property
</property
</property
</property
</product
</extension
- If you are not using the update configurator, then remember to edit the osgi.bundles property (in ./eclipse/configuration/config.ini) to include the new plug-in.
- Run: eclipse.exe -clean (the -clean argument forces eclipse to check for newly installed or removed plug-ins)

<strong>Custom window layout</strong>

It is also possible to have a custom layout of the overall workbench window, by overriding WorkbenchWindowAdvisor.createWindowContents(Shell) . For example, some applications use this to add a branding banner at the top. Note that this mechanism is independent of the presentation mechanism described above.

Submit "RCP Custom Look and Feel" to Facebook Submit "RCP Custom Look and Feel" to Digg Submit "RCP Custom Look and Feel" to del.icio.us Submit "RCP Custom Look and Feel" to StumbleUpon Submit "RCP Custom Look and Feel" to Google

Comments