Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Providing Images
Providing Images [message #43657] Mon, 02 February 2009 10:33 Go to next message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

i just realized that the swt group is actually a better place for this,
so here goes the cross-post.


As I got my plugin mostly working, now there is a desire for some sleek
looks. Thus, I need to add some images. I came across the interesting
article at
http://www.eclipse.org/articles/Article-Using%20Images%20In% 20Eclipse/Using%20Images%20In%20Eclipse.html

which mentions, that each AbstractUIPlugin has an ImageRegistry built-in
and all I need to do is initialize it.

However, attempting to do this yielded some trouble. I tried
initializing the ImageRegistry in
AbstractUIPlugin#initializeImageRegistry(ImageRegistry) as recommended
in the JavaDoc but got stuck when I discovered that ImageDescriptor is
abstract and no implementation is available.

There is an Implementation FileImageDescriptor, but its Package-Private.
Is there any reason for this? The class appears to be rather
straugt-forward, copying it to my own plugin showed no errors. Can this
class be made public?


Additionally, I gave some thought to this image-situation. Is there any
particular reason, why there is no extension point to add Images
declaratively to the platform ImageRegistry or at least the plugin
ImageRegistry? An ID, the plugin ID (in case of platform registry) and
the path within the plugin should be sufficient to be able to
automatically create an ImageDescriptor for every Image specified.

When implemented in
AbstractUIPlugin#initializeImageRegistry(ImageRegistry) this should not
break any existing functionality. Anyone wishing to use the new
extension point just has to add a call to super.

Specifying a few icons seems like a fairly common use-case, especially
since eclipse doesn't provide much of its own Icons. (Every once in a
while I come across a site offering all the current eclipse icons for
download and inclusion in custom plugins - most IDE-Icons are missing
from API).

Regards
Damian Philipp
Re: Providing Images [message #43686 is a reply to message #43657] Mon, 02 February 2009 13:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6599
Registered: July 2009
Senior Member
ImageDescriptor has some static methods to load images.

Tom

Damian Philipp schrieb:
> Hello,
>
> i just realized that the swt group is actually a better place for this,
> so here goes the cross-post.
>
>
> As I got my plugin mostly working, now there is a desire for some sleek
> looks. Thus, I need to add some images. I came across the interesting
> article at
> http://www.eclipse.org/articles/Article-Using%20Images%20In% 20Eclipse/Using%20Images%20In%20Eclipse.html
>
> which mentions, that each AbstractUIPlugin has an ImageRegistry built-in
> and all I need to do is initialize it.
>
> However, attempting to do this yielded some trouble. I tried
> initializing the ImageRegistry in
> AbstractUIPlugin#initializeImageRegistry(ImageRegistry) as recommended
> in the JavaDoc but got stuck when I discovered that ImageDescriptor is
> abstract and no implementation is available.
>
> There is an Implementation FileImageDescriptor, but its Package-Private.
> Is there any reason for this? The class appears to be rather
> straugt-forward, copying it to my own plugin showed no errors. Can this
> class be made public?
>
>
> Additionally, I gave some thought to this image-situation. Is there any
> particular reason, why there is no extension point to add Images
> declaratively to the platform ImageRegistry or at least the plugin
> ImageRegistry? An ID, the plugin ID (in case of platform registry) and
> the path within the plugin should be sufficient to be able to
> automatically create an ImageDescriptor for every Image specified.
>
> When implemented in
> AbstractUIPlugin#initializeImageRegistry(ImageRegistry) this should not
> break any existing functionality. Anyone wishing to use the new
> extension point just has to add a call to super.
>
> Specifying a few icons seems like a fairly common use-case, especially
> since eclipse doesn't provide much of its own Icons. (Every once in a
> while I come across a site offering all the current eclipse icons for
> download and inclusion in custom plugins - most IDE-Icons are missing
> from API).
>
> Regards
> Damian Philipp


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Providing Images [message #43748 is a reply to message #43686] Mon, 02 February 2009 16:11 Go to previous messageGo to next message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

Tom Schindl schrieb:
> ImageDescriptor has some static methods to load images.

Whops, sorry. I should have seen that.

I still think that specifying images for the ImageResigtry declaratively
would be a good idea though.

Regards
Damian Philipp
Re: Providing Images [message #43792 is a reply to message #43748] Mon, 02 February 2009 16:48 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6599
Registered: July 2009
Senior Member
By the way you can easily load images using the
AbstractUIPlugin#imageDescriptorFromPlugin!

Tom

Damian Philipp schrieb:
> Hello,
>
> Tom Schindl schrieb:
>> ImageDescriptor has some static methods to load images.
>
> Whops, sorry. I should have seen that.
>
> I still think that specifying images for the ImageResigtry declaratively
> would be a good idea though.
>
> Regards
> Damian Philipp


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Providing Images [message #44001 is a reply to message #43748] Tue, 03 February 2009 05:52 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
There is a bug open already to add images to SharedImages thru plugin.xml.
Hopefully it should make it into 3.5 M6

- Prakash
--

http://blog.eclipse-tips.com
"Damian Philipp" <damian.philipp@flexis.de> wrote in message
news:gm75vg$nbq$1@build.eclipse.org...
> Hello,
>
> Tom Schindl schrieb:
>> ImageDescriptor has some static methods to load images.
>
> Whops, sorry. I should have seen that.
>
> I still think that specifying images for the ImageResigtry declaratively
> would be a good idea though.
>
> Regards
> Damian Philipp
Re: Providing Images [message #44029 is a reply to message #43792] Tue, 03 February 2009 07:10 Go to previous messageGo to next message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

Tom Schindl schrieb:
> By the way you can easily load images using the
> AbstractUIPlugin#imageDescriptorFromPlugin!

judging from the JavaDoc, if I create images from ImageDescriptors
obtained this way, I have to dispose of them myself. I was trying to
avoid having to do that by using the ImageRegistry.

Regards
Damian Philipp
Re: Providing Images [message #44061 is a reply to message #44029] Tue, 03 February 2009 09:09 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6599
Registered: July 2009
Senior Member
You load the descriptor and put it into the registery you obtained
previously.

Tom

Damian Philipp schrieb:
> Hello,
>
> Tom Schindl schrieb:
>> By the way you can easily load images using the
>> AbstractUIPlugin#imageDescriptorFromPlugin!
>
> judging from the JavaDoc, if I create images from ImageDescriptors
> obtained this way, I have to dispose of them myself. I was trying to
> avoid having to do that by using the ImageRegistry.
>
> Regards
> Damian Philipp


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Providing Images [message #590976 is a reply to message #43657] Mon, 02 February 2009 13:03 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6599
Registered: July 2009
Senior Member
ImageDescriptor has some static methods to load images.

Tom

Damian Philipp schrieb:
> Hello,
>
> i just realized that the swt group is actually a better place for this,
> so here goes the cross-post.
>
>
> As I got my plugin mostly working, now there is a desire for some sleek
> looks. Thus, I need to add some images. I came across the interesting
> article at
> http://www.eclipse.org/articles/Article-Using%20Images%20In% 20Eclipse/Using%20Images%20In%20Eclipse.html
>
> which mentions, that each AbstractUIPlugin has an ImageRegistry built-in
> and all I need to do is initialize it.
>
> However, attempting to do this yielded some trouble. I tried
> initializing the ImageRegistry in
> AbstractUIPlugin#initializeImageRegistry(ImageRegistry) as recommended
> in the JavaDoc but got stuck when I discovered that ImageDescriptor is
> abstract and no implementation is available.
>
> There is an Implementation FileImageDescriptor, but its Package-Private.
> Is there any reason for this? The class appears to be rather
> straugt-forward, copying it to my own plugin showed no errors. Can this
> class be made public?
>
>
> Additionally, I gave some thought to this image-situation. Is there any
> particular reason, why there is no extension point to add Images
> declaratively to the platform ImageRegistry or at least the plugin
> ImageRegistry? An ID, the plugin ID (in case of platform registry) and
> the path within the plugin should be sufficient to be able to
> automatically create an ImageDescriptor for every Image specified.
>
> When implemented in
> AbstractUIPlugin#initializeImageRegistry(ImageRegistry) this should not
> break any existing functionality. Anyone wishing to use the new
> extension point just has to add a call to super.
>
> Specifying a few icons seems like a fairly common use-case, especially
> since eclipse doesn't provide much of its own Icons. (Every once in a
> while I come across a site offering all the current eclipse icons for
> download and inclusion in custom plugins - most IDE-Icons are missing
> from API).
>
> Regards
> Damian Philipp


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Providing Images [message #591003 is a reply to message #43686] Mon, 02 February 2009 16:11 Go to previous message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

Tom Schindl schrieb:
> ImageDescriptor has some static methods to load images.

Whops, sorry. I should have seen that.

I still think that specifying images for the ImageResigtry declaratively
would be a good idea though.

Regards
Damian Philipp
Re: Providing Images [message #591016 is a reply to message #43748] Mon, 02 February 2009 16:48 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6599
Registered: July 2009
Senior Member
By the way you can easily load images using the
AbstractUIPlugin#imageDescriptorFromPlugin!

Tom

Damian Philipp schrieb:
> Hello,
>
> Tom Schindl schrieb:
>> ImageDescriptor has some static methods to load images.
>
> Whops, sorry. I should have seen that.
>
> I still think that specifying images for the ImageResigtry declaratively
> would be a good idea though.
>
> Regards
> Damian Philipp


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Providing Images [message #591099 is a reply to message #43748] Tue, 03 February 2009 05:52 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
There is a bug open already to add images to SharedImages thru plugin.xml.
Hopefully it should make it into 3.5 M6

- Prakash
--

http://blog.eclipse-tips.com
"Damian Philipp" <damian.philipp@flexis.de> wrote in message
news:gm75vg$nbq$1@build.eclipse.org...
> Hello,
>
> Tom Schindl schrieb:
>> ImageDescriptor has some static methods to load images.
>
> Whops, sorry. I should have seen that.
>
> I still think that specifying images for the ImageResigtry declaratively
> would be a good idea though.
>
> Regards
> Damian Philipp
Re: Providing Images [message #591109 is a reply to message #43792] Tue, 03 February 2009 07:10 Go to previous message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
Hello,

Tom Schindl schrieb:
> By the way you can easily load images using the
> AbstractUIPlugin#imageDescriptorFromPlugin!

judging from the JavaDoc, if I create images from ImageDescriptors
obtained this way, I have to dispose of them myself. I was trying to
avoid having to do that by using the ImageRegistry.

Regards
Damian Philipp
Re: Providing Images [message #591114 is a reply to message #44029] Tue, 03 February 2009 09:09 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6599
Registered: July 2009
Senior Member
You load the descriptor and put it into the registery you obtained
previously.

Tom

Damian Philipp schrieb:
> Hello,
>
> Tom Schindl schrieb:
>> By the way you can easily load images using the
>> AbstractUIPlugin#imageDescriptorFromPlugin!
>
> judging from the JavaDoc, if I create images from ImageDescriptors
> obtained this way, I have to dispose of them myself. I was trying to
> avoid having to do that by using the ImageRegistry.
>
> Regards
> Damian Philipp


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:How do I update an Eclipse template variable at runtime?
Next Topic:PDE-Build against a target platform
Goto Forum:
  


Current Time: Wed Jun 16 01:38:36 GMT 2021

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

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

Back to the top