Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 56484

Summary: [Fonts/Colors] Theme API cannot rely on JFaceResources.
Product: [Eclipse Project] Platform Reporter: Kim Horne <eclipse>
Component: UIAssignee: Kim Horne <eclipse>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: michaelvanmeekeren, n.a.edgar, Tod_Creasey
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483359
Whiteboard:
Attachments:
Description Flags
Work in progress none

Description Kim Horne CLA 2004-03-27 18:47:30 EST
I've been poking around and it seems like the theme code would be much better
off living in JFace.  We currently have a lot of JFace code that directly
accesses JFaceResources.blah() and thereby bypasses the theme logic entirely. 
Certain dialogs wont respond to theme changes because of this.  However, if we
moved the bulk of the theme API into JFace we'd be able to make use of it there
as well.  We could remove all of our internal references to JFaceResources. 
Additionally, we could hook JfaceResources into themes itself...have
getColor/FontRegistyr return the registry associated with the current theme.  By
doing this everyone who makes use of JFaceResources wouldn't have to change any
code to make use of themes.

The big drawback to this is that anyone who's currently using themes (ie:
importing from the org.eclipse.ui.themes package) would be broken.  There aren't
too many people that are doing this (if any, besides us) so we can probably do
this with the minimum of fuss.

Comments?  If we're going to do this we should do it ASAP.  The further into M9
we get the more likely it is that themes will have itself clients.
Comment 1 Kim Horne CLA 2004-04-08 10:56:58 EDT
As per discussion with NE:

The easiest (and most transparent) way to make JFace theme enabled is to have
workbench populate it's own Font/Color registries for the "base" theme instead
of relying on JFaces'.  The currently active theme would be mirrored in the
JFace registries.  When the theme changes, new values are pushed into the JFace
registries.  This allows listeners on the JFace registries to get the latest
theme specific data as well as recieve events of changes.
Comment 2 Kim Horne CLA 2004-04-08 11:47:01 EDT
Created attachment 9331 [details]
Work in progress
Comment 3 Kim Horne CLA 2004-04-10 19:49:03 EDT
Fix in HEAD.
Comment 4 Kim Horne CLA 2004-05-19 09:08:38 EDT
Verified in 200405190010 using the test suites.
Comment 5 Kim Horne CLA 2004-07-06 09:29:50 EDT
Closing to keep a tidy house.  Pardon the spam.