| Providing Images [message #43657] | 
Mon, 02 February 2009 05:33   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 08:03    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 #44061 is a reply to message #44029] | 
Tue, 03 February 2009 04:09   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 08:03   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 11:11   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 11:48   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 00:52   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 02:10   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 04:09   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 
 ------------------------------------------------------------ --------
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.06044 seconds