|Providing Images [message #590926]
||Mon, 02 February 2009 08:22
| Damian Philipp
Registered: July 2009
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
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
Powered by FUDForum
. Page generated in 0.01486 seconds