Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » perform URL resource loading inside IElementUpdater.updateElement(UIElement, Map)
perform URL resource loading inside IElementUpdater.updateElement(UIElement, Map) [message #512748] Sun, 07 February 2010 07:29 Go to next message
Philipp Kursawe is currently offline Philipp Kursawe
Messages: 135
Registered: July 2009
Senior Member
Hello,

I would like to set the UIElement's icon to a favorite icon loaded from
a remote URL. The javadoc for this method say, that I should not hold
onto UIElement as it can go away any time. But could I spawn a
Dislay.asyncExec to load the image for that UIElement?

Phil
Re: perform URL resource loading inside IElementUpdater.updateElement(UIElement, Map) [message #513004 is a reply to message #512748] Mon, 08 February 2010 14:42 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Philipp Kursawe wrote:
> Hello,
>
> I would like to set the UIElement's icon to a favorite icon loaded from
> a remote URL. The javadoc for this method say, that I should not hold
> onto UIElement as it can go away any time. But could I spawn a
> Dislay.asyncExec to load the image for that UIElement?

It would be better if you could load the image, and then call
ICommandService.refreshElements(*) for that command in an async as you
would only be handed valid elements.

You can try loading and then setting in an asyncExec(*) but you would
have to protect your call to the UIElement by catching (potentially)
RuntimeExceptions (it's matching widget could be disposed, the UI
element might have cleared enough of its fields that it might NPE, etc).

Later,
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:Separation of Java and Eclipse Worlds
Next Topic:Contributing editor actions to specific place in the toolbar
Goto Forum:
  


Current Time: Tue Sep 16 15:44:33 GMT 2014

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

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