Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Window icons in several sizes
Window icons in several sizes [message #986670] Wed, 21 November 2012 10:41 Go to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1412
Registered: July 2012
Senior Member
Hi,

I started my Eclipse 4 application in the context of Eclipse 4.3 M3. As described in another topic, configuring the window icon in the application model will now show the window icon correctly in the window itself.

Now there is still the issue that it is not possible to supply multiple sizes/resolutions for window icons, like it was possible in Eclipse 3.x via product branding. For example, on Windows 7 the icon shown in the task bar is the same as used within the window itself. You can expect that this looks really ugly as the icon shown in the task bar is bigger than in the window.

For me it looks like the configuration of the product branding isn't evaluated in Eclipse 4. Is this correct?

I can remember that the bug for missing window icons is refering to this issue as well. Am I correct that this is still open?

After doing a bit more research, yes this bug seems to be still open:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=280825

Greez,
Dirk

[Updated on: Wed, 21 November 2012 10:50]

Report message to a moderator

Re: Window icons in several sizes [message #987085 is a reply to message #986670] Fri, 23 November 2012 11:36 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1412
Registered: July 2012
Senior Member
Is there some workaround on this issue? Because looking at the Eclipse IDE itself, there are window icons in several sizes. I know it uses the compatibility layer, but maybe there is an option to do this now on Eclipse 4 I haven't found yet?
Re: Window icons in several sizes [message #987093 is a reply to message #987085] Fri, 23 November 2012 12:28 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Hi Dirk,

the code in WBWRenderer, which is responsible to set the image looks like this:
if (wbwModel.getIconURI() != null && wbwModel.getIconURI().length() > 0) {
	wbwShell.setImage(getImage(wbwModel));
} else {
	wbwShell.setImages(Window.getDefaultImages());
}

I haven't tried it, but imho as a workaround you can leave the icon field in the model empty and use Window.setDefaultImages(Image[] images) to set the images for example on @PostContextCreate in your life cycle handler.

Hope that helps
Christoph
Re: Window icons in several sizes [message #987098 is a reply to message #987093] Fri, 23 November 2012 13:11 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1412
Registered: July 2012
Senior Member
Hi Christoph,

thanks for that tipp. Indeed this workaround is working. Smile

Greez,
Dirk
Re: Window icons in several sizes [message #1005804 is a reply to message #987098] Mon, 28 January 2013 19:35 Go to previous messageGo to next message
Rafael Fogel is currently offline Rafael FogelFriend
Messages: 21
Registered: January 2013
Junior Member
Christoph, can you post a more complete code? I am facing the same problem and I didn't understand what you said.

Thanks.
Re: Window icons in several sizes [message #1005829 is a reply to message #1005804] Mon, 28 January 2013 21:21 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Hi Rafael

I don't have any code ready, since I am happy with a single icon which I define in the application model (Bug 280825 has been fixed).

Otherwise, you can use the API in JFace 'Window' class to set the multiple images. Maybe Dirk has some sample code for you?

If you want to know what is happening under the covers, put a breakpoint in WBWRenderer.

Greetings
Christoph
Re: Window icons in several sizes [message #1005876 is a reply to message #1005829] Tue, 29 January 2013 07:39 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1412
Registered: July 2012
Senior Member
Hi,

yes I have a sample code. I created a lifecycle hook and implemented the following method:

@PostContextCreate
public void postContextCreate() {
	Window.setDefaultImages(new Image[] { //add your images here });
}


Hope that helps,
Dirk
Re: Window icons in several sizes [message #1008724 is a reply to message #1005876] Wed, 13 February 2013 18:12 Go to previous messageGo to next message
Rafael Fogel is currently offline Rafael FogelFriend
Messages: 21
Registered: January 2013
Junior Member
Hi Dirk, can you tell me how you are loading those images? The setImage function doesn't accept any image I load.
Re: Window icons in several sizes [message #1008950 is a reply to message #1008724] Thu, 14 February 2013 07:44 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1412
Registered: July 2012
Senior Member
I load Images like explained here http://www.vogella.com/articles/Eclipse3RCP/article.html#tips_loadimages
Re: Window icons in several sizes [message #1009109 is a reply to message #1008950] Thu, 14 February 2013 13:04 Go to previous message
Rafael Fogel is currently offline Rafael FogelFriend
Messages: 21
Registered: January 2013
Junior Member
Thank you very much Dirk. Working beautifully now.
Previous Topic:Getting the application Shell at start?
Next Topic:IEventBroker inside of the LifeCycle?
Goto Forum:
  


Current Time: Fri Nov 28 18:31:07 GMT 2014

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

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