Skip to main content



      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 02:29 Go to next message
Eclipse UserFriend
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 09:42 Go to previous message
Eclipse UserFriend
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: Fri Jun 13 10:38:19 EDT 2025

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

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

Back to the top