Customizing the UI in small RCP Projects
16. April 2007
The presentation framework provided by Eclipse gives you the possibility to customize the UI and the behavior of graphical elements. A good example for UI-customization is the Lotus Nodes Client “Hannover”. But what do you do If you don’t have the budget, time or the skill set to implement such an excessive UI-customization like the guys from “Hannover”? Especially for small RCP applications with a handful views and the wish that your product should not look like a “typical Eclipse Client” it is probably better to use alternative possibilities to create an individual looking RCP. The following article will give an example how to customize your UI easily without using any special framework or extension-point.
Product branding with Eclipse RCP
Since it is possible to build RCP applications with Eclipse, the possibilities to give your application a more personal touch through the PDE have also increased. Typical elements are for example splash-screens, program-icons or welcome-screens. But in the most cases that is not enough. The customer often has a corporate identity with logos, special colors, fonts,etc. which must be also integrated within the application.
Step 1: Implementing a banner with integrated Toolbar
An often required UI-element is a banner on top of your views with a company logo or the name of your product and a toolbar where the key features of the application are accessible. This is possible if your overwrite the method WorkbenchWindowAdvisor#createWindowContents(Shell shell). Eclipse layouts and creates typical elements of your workbench like the Coolbar, MenuBar and the Statusline. If you overwrite this method you have the freedom to arrange the content of your window but you also have to care for the correct initialization of all UI-elements needed. This step is very effective and your application looks much more personalized (see picture).

Part of the banner with a two-buttons toolbar
Step 2: Implement your own Viewpart-Title Area
The most characteristic element to indicate a “typical Eclipse application” is the look of a viewpart with the curved title and the appended action bar.
With the form enhancements in Eclipse 3.3M5 and the features with custom titles a new and interesting possibility is provided to use this feature also as title in your viewparts. You just have to add the views as standalone views to your perspective layout and implement the title in your viewpart. With the ability to customize the colors (see org.eclipse.ui.forms.FormColors) you can show up views that nobody would associate with a “typical Eclipse application” (see Image).

Viewparts with Form-Headings and Actionbar (on the right: with Subheader)
Step 3: Move your Progress Indicator
This is an optional step, depending on your requirements. In nearly every application you have jobs for background-processes where you need a progress indicator to give the user a feedback about the job-status. The default-location of the progress indicator is on the bottom of your application window outside the page contents. It doesn’t make sense in small applications, that this little, but important widget needs the whole bottom of your workbench-window, especially if you don’t have a status-bar. So why not place the progress-bar somewhere else, e.g. in a viewpart?- In spite of the “Discouraged Access Warning” you can implement the org.eclipse.ui.internal.progress.ProgressRegion wherever you want (see picture).

Progress Region in a viewpart
Example
I have implemented a small RCP application, which uses the mentioned UI-customizations (see picture). Check it out (or download) to see, how easyily an individual UI can be implemented. But remember: The discussed issues can be realized only for a special type of RCPs. If you have to customize your “Next generation IDE” with 100 views and editors, please use the presentation framework.
Conclusion
There are many ways to customize your Eclipse RCP Application. Based on the special requirements of your personal application you have to choose the best toolkit to reach your goal.
Maybe you also have a simple way to customize your RCP product. Let me know.
Downloads
Download the UI Customization Example as RCP (Source included - 11 Mbyte)
CVS-Checkout (more info)


Note that overriding the WorkbenchWindowAdvisor#createWindowContents(Shell shell) method has some disadvantages, as discussed in this bug[1].
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=73821
Comment by Kris — 16. April 2007 @ 17:13
And overriding the WorkbenchWindowAdvisor#createWindowContents(Shell shell) does not allow to use “Welcome” view because your banner will be always on top. In this case you should to hide banner manually because eclipse api hides only coolbar.
Comment by MByte — 17. April 2007 @ 08:37
I could not find the source code in the example that I downloaded.
Where is it?
Comment by bharat — 26. July 2007 @ 19:30
The source code is located in the de.spiritlink.custom.ui plugin. Alternatively you can download the source via CVS. See http://www.richclient2.eu/cvs
Comment by Tom Seidel — 26. July 2007 @ 19:45
THANKS ALOT
BUT WHEN I TRY TO UNJAR THE FILE IT SAYS ACCESS IS DENIED
PLZZZ HELP!!!
Comment by bharat — 26. July 2007 @ 20:04
Thanks for this great article.
Your createWindowContents method seems to lack a call to configurer.createStatusLineControl to work properly with components that make use of the status line.
Something like :
configurer.createStatusLineControl(getWindowConfigurer().getWindow().getShell()) ;
Comment by oualid — 20. January 2009 @ 17:59
i can’t add the svn source. Is there the source code anywhere else? or, better, is there a tutorial
?
Comment by Daniele — 5. June 2009 @ 10:56
Hi, thanks a lot for the article.
Is it possible to have a menubar and a banner on the same rcp? I didn“t found the method to initialize the menubar in the createWindowContents Method.
Thanks Chris
Comment by Clay — 19. June 2009 @ 12:31
Hi, thanks a lot for everithing you do,
Is it possible to customize simple RCP views and not forms?
Comment by papaetoo — 10. July 2009 @ 17:40
Thanks a lot for sharing. Was an interesting article.
Comment by Dimitri Koami Missoh — 9. October 2009 @ 11:21