Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Using favicons as title image for MPart in a Stack
Using favicons as title image for MPart in a Stack [message #857589] Thu, 26 April 2012 13:28 Go to next message
Sarah Missing name is currently offline Sarah Missing name
Messages: 4
Registered: July 2009
Junior Member
I am working on an application that has several parts that are basically just browsers that will display a specific web site. For these parts I am wanting to use the favicon of the web site as the title icon for the part. I could just use the address of the favicon as the icon URI when creating the part, but don't want the run the risk of the UI thread blocking when trying to load these images at runtime.

In 3.x, this is accomplished by originally setting the title image of the view to a default resource and loading the favicon resource in a separate job. When the job completed (if a favicon existed) the title image was then reset to the loaded image.

I'd like to do something similar now that we've uplifted to e4 but am unsure on how to best accomplish this. I've been looking at loading the fav icons in a thread and then creating my own ISWTResourceUtilities implementation to check for these preloaded ImageDescriptors before trying to create a new one, but this seems to be an overly complex way of accomplishing what I want.
Re: Using favicons as title image for MPart in a Stack [message #868476 is a reply to message #857589] Tue, 01 May 2012 23:32 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
Messages: 242
Registered: July 2009
Senior Member
You should be able to update the part's iconURI attribute with a URI pointing to the icon (e.g., a local file).

Or you can set the override image for the part with something like the following:

part.getTransientData().set(IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY, image);

But this may not take effect after the part has been rendered, and there's a bug that causes the overridden icon to be ignored after being dragged to a different stack (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=378184),
Re: Using favicons as title image for MPart in a Stack [message #872776 is a reply to message #868476] Wed, 16 May 2012 15:49 Go to previous message
Sarah Missing name is currently offline Sarah Missing name
Messages: 4
Registered: July 2009
Junior Member
Thanks for the suggestions. For the time being I'm going to go with the local file option.
Previous Topic:Testing Eclipse 3.7 RCP app in Eclipse 4.2 - NPE
Next Topic:Eclipse 3.x RCP application on Compatibility Layer - Exceptions
Goto Forum:
  


Current Time: Thu Jul 31 01:24:01 EDT 2014

Powered by FUDForum. Page generated in 0.02012 seconds