Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Change view icon programmatically
Change view icon programmatically [message #527298] Wed, 14 April 2010 17:25 Go to next message
Ken is currently offline KenFriend
Messages: 36
Registered: July 2009
Member
I'd like to change my view's icon at runtime during startup. I can overrride
getTitleImage in the ViewPart, but that will only work if the view becomes
active. If it is hidden behind another view it will still use what is
defined in the plugin.xml. Does anyone have any idea how to set this? I
would think it has to be some higher level than the ViewPart since that
isn't until the view becomes active.

Thanks!

- Ken
Re: Change view icon programmatically [message #527347 is a reply to message #527298] Wed, 14 April 2010 22:01 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 418
Registered: July 2009
Senior Member
Hi Ken,

This might be is just a thought experiment and ugly but try to get the
iviewdescriptor and create the view.

PlatformUI.getWorkbench().getViewRegistry().find("id.view").createView();

This should call your method.

--

Best Regards,
Wim Jongman
-- Who's General Failure & why is he reading my disk?
(Eclipse Old Skool Quote Service)

> I'd like to change my view's icon at runtime during startup. I can
overrride
> getTitleImage in the ViewPart, but that will only work if the view becomes
> active. If it is hidden behind another view it will still use what is
> defined in the plugin.xml. Does anyone have any idea how to set this? I
> would think it has to be some higher level than the ViewPart since that
> isn't until the view becomes active.
>
> Thanks!
>
> - Ken
Re: Change view icon programmatically [message #527516 is a reply to message #527298] Thu, 15 April 2010 13:55 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Ken Prole wrote:
> I'd like to change my view's icon at runtime during startup. I can
> overrride getTitleImage in the ViewPart, but that will only work if the
> view becomes active. If it is hidden behind another view it will still
> use what is defined in the plugin.xml. Does anyone have any idea how to
> set this? I would think it has to be some higher level than the ViewPart
> since that isn't until the view becomes active.

No, you can't see the icon on an IViewReference (see another thread on
this that was active in the last week).

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Change view icon programmatically [message #527589 is a reply to message #527516] Thu, 15 April 2010 17:09 Go to previous messageGo to next message
Ken is currently offline KenFriend
Messages: 36
Registered: July 2009
Member
What's the date and subject of this message?

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:hq75ql$i82$1@build.eclipse.org...
> Ken Prole wrote:
>> I'd like to change my view's icon at runtime during startup. I can
>> overrride getTitleImage in the ViewPart, but that will only work if the
>> view becomes active. If it is hidden behind another view it will still
>> use what is defined in the plugin.xml. Does anyone have any idea how to
>> set this? I would think it has to be some higher level than the ViewPart
>> since that isn't until the view becomes active.
>
> No, you can't see the icon on an IViewReference (see another thread on
> this that was active in the last week).
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
> http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: Change view icon programmatically [message #527633 is a reply to message #527589] Thu, 15 April 2010 19:42 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Change EditorReference image, April 10,12

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:RCP plugins session management?
Next Topic:XWT + RCP
Goto Forum:
  


Current Time: Sun Dec 21 23:51:52 GMT 2014

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

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