Bug 70814 - [Themes] Themes should handle images
Summary: [Themes] Themes should handle images
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-07-26 09:47 EDT by Kim Horne CLA
Modified: 2019-09-06 16:12 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Horne CLA 2004-07-26 09:47:48 EDT
We didn't manage to include images in the 3.0 theme work although the intention
was there.  The original idea was to provide add <imageDefinition> and
<imageOverride> elements to the themes extension point, along with an
ImageRegistry that mirrored the existing support for colours and fonts.  Whether
the existing JFace ImageRegistry can be used for this is a question that needs
to be answered - the javadoc states that images cannot be replaced.  In order to
be in line with the other theme registries this can't be the case.

In addition to the explicitly declared images, it would be good if we could
override ANY image that is accessable via some central authority (such as the
plugin ImageRegistry or imageDescriptorFromPlugin on AbstractUIPlugin). 
imageOverride elements could be specified by key (referring to imageDefinition
elements), by plugin/key combinations (referring to plugin ImageRegistry
objects) or by platform URL (available from imageDescriptorFromPlugin).  This
would allow themes to customize all workbench and plugin images.

In addition to specific overrides, we could allow themes to specify an
<imageTransformer> element.  When accessing images in a given theme, the
transformer would be run over all images as appropriate.  These transformers
could apply color/sizing transformations on the entire image set.  The initial
cost of this would be quite high, but the results could be cached.

Opinions?
Comment 1 Nick Edgar CLA 2005-02-01 00:20:20 EST
I'm very much in favour of this.  Just the other day I had a request from an RCP
app developer who wanted to know whether it's possible to override the icon used
for Open Perspective (in the perspective switcher).  The best I could offer was
to replace the corresponding file under org.eclipse.ui/icons.

Comment 2 Stefan Xenos CLA 2005-03-12 04:39:42 EST
I'd suggest making sure that the theme only returns ImageDescriptors and never
Images. 

- Clients can easily convert ImageDescriptors into shared Image instances using
JFaceResources.getResources().createImage(...) 
- Any Image instance that is ever directly exposed through API is hard to
dispose safely. 
- ImageDescriptors are device-independent (ie: could be used with a printer).
Comment 3 Kim Horne CLA 2005-03-14 08:02:16 EST
I'd like to go one step further and deprecate the jface font and color
registries on Themes for just that same reason and look into using your new
style of registry.  Perhaps we could talk about that at some point.
Comment 4 Boris Bokowski CLA 2009-11-17 11:33:10 EST
Susan is now responsible for watching the [Themes] category.
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:12:09 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.