Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » View Title
View Title [message #427788] Wed, 04 May 2005 05:28 Go to next message
Eclipse UserFriend
Anyone knows how change a view title in runtime?

Thanks.
Re: View Title [message #427799 is a reply to message #427788] Wed, 04 May 2005 13:09 Go to previous messageGo to next message
Eclipse UserFriend
Oscar wrote:
> Anyone knows how change a view title in runtime?

setPartName() method in org.eclipse.ui.part.ViewPart

....Ron Capelli
Re: View Title [message #427801 is a reply to message #427788] Wed, 04 May 2005 22:15 Go to previous messageGo to next message
Eclipse UserFriend
Most of your recent questions are covered in
http://www.eclipsecon.org/2005/presentations/EclipseCon2005_ Tutorial26Final.pdf

HTH,

PaScaL

Oscar wrote:
> Anyone knows how change a view title in runtime?
>
> Thanks.
>
Re: View Title [message #427807 is a reply to message #427788] Thu, 05 May 2005 08:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jsilva.inf.utfsm.cl

Oscar wrote:
> Anyone knows how change a view title in runtime?
>
> Thanks.
>

Hi Oscar,

I have this method in my WorkbenchWindowAdvisor. Is called every time a
user update the name in the preference page. To achive this i register a
property change listener who call this method, and then i change it.

Probably you only need the (*) part of this code.

public void updateTitleBar() {

IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
StringBuffer title = new StringBuffer();

IPreferenceStore store = ProyectoJPlugin.getDefault()
.getPreferenceStore();


title.append(store.getString(PreferenceConstants.P_PLATFORM_ NAME)); //(*)
configurer.setTitle(title.toString());

}


best regards,
toño.
Re: View Title [message #444013 is a reply to message #427799] Wed, 08 February 2006 05:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexixlebaulois.yahoo.fr

Do you have an example ? I have tried to put this method in my view :
<b>
public void setPartName(String name) {
this.setPartName(name);
}
</b>
then I opened my view in runtime and called my method :
<b>
ViewPart view = (ViewPart)PlatformUI.getWorkbench().getActiveWorkbenchWindow ().getActivePage().showView(viewID);
view.setPartName(name);
</b>
Nothing happened, so an example would be useful
Re: View Title [message #444022 is a reply to message #444013] Wed, 08 February 2006 08:37 Go to previous messageGo to next message
Eclipse UserFriend
alexixlebaulois wrote:
> Do you have an example ? I have tried to put this method in my view :
> <b>
> public void setPartName(String name) {
> this.setPartName(name);
> }
> </b>

This is a recursive call (BAD).

You probably want
public void setPartName(String name) {
super.setPartName(name)
}


> then I opened my view in runtime and called my method :
> <b>
> ViewPart view = (ViewPart)PlatformUI.getWorkbench().getActiveWorkbenchWindow ().getActivePage().showView(viewID);
> view.setPartName(name);
> </b>
> Nothing happened, so an example would be useful

This code doesn't compile (unless you're in view code), since
ViewPart#setPartName(*) is protected. You would normally check that
it's an instance of your class and then cast it to your view class.

Later,
PW
Re: View Title [message #444170 is a reply to message #444022] Fri, 10 February 2006 05:41 Go to previous message
Eclipse UserFriend
Originally posted by: alexixlebaulois.yahoo.fr

thank you for your useful advices. It works well now :)
Previous Topic:Launcher is not exported on Linux
Next Topic:Feature List
Goto Forum:
  


Current Time: Sat Jul 05 09:04:41 EDT 2025

Powered by FUDForum. Page generated in 0.04192 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top