In Eclipse IDE, you can see the window title in the format: perspective - editPart name - Eclipse SDK - workspace. But in an RCP app, the title is usually the Product Name defined in the *.product file. This tip explains how to change it dynamically like IM clients - where the window title should be product name - user name.
Window title is *not* set on the IWorkbenchWindow. You need to do it on the IWorkbenchWindowConfigurer.
Whenever the user performs a login/logout, you need to set the window title. The details are sketchy, as its left to you whether to pass the instance of the windowConfigurer to the Login/LogoutAction or implement some sort of event listener for login/logout and do the title change there. But in general:
IWorkbenchWindowConfigurer windowConfigurer = ...;
String title = Platform.getProduct().getName();
if(loggedIn)
title = title + " - " + userName;
windowConfigurer.setTitle(title);
In case you were wondering where to get the instance of the windowConfigurer, it will be passed to your application thru the WorkbenchAdvisor.createWorkbenchWindowAdvisor() method.
Apr 23, 2008
Window Title in an RCP app
This blog has moved. Click here for an updated version of this blog entry
Posted by
Prakash G. R.
at
10:40 AM
Labels: guidelines, RCP
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment