tag:blogger.com,1999:blog-6460870651579501588.post-34532243928153530452008-04-23T10:40:00.003+05:302008-04-23T11:26:30.091+05:30Window Title in an RCP appIn 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.<br /><br />Window title is *not* set on the IWorkbenchWindow. You need to do it on the IWorkbenchWindowConfigurer.<br /><br />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:<br /><br /><span style="font-family: courier new; color: rgb(51, 51, 255);font-size:100%;" >IWorkbenchWindowConfigurer windowConfigurer = ...;<br />String title = Platform.getProduct().getName();<br />if(loggedIn)<br /> title = title + " - " + userName;<br />windowConfigurer.setTitle(title);</span><br /><br /><br />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.<div class="blogger-post-footer"><br/><br/> From <a href="http://blog.cypal-solutions.com/">Eclipse Tips</a> by <a href="http://www.cypal.in/">Cypal Solutions</a> <br/> Like the tip? <a href="http://feeds.feedburner.com/cypal">Subscribe</a> <br/></div>Prakash G.R.http://www.blogger.com/profile/13046268367318873066noreply@blogger.com