Project: Eclipse_Platform_UI
Bug 56484 [Fonts/Colors] Theme API cannot rely on JFaceResources.
Reported: 2004-03-27 18:47:30 | Status: closed fixed

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.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/StringConverter.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IThemePreview.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ExtensionEventHandler.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/Theme.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeElementCategory.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeElementHelper.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ThemeRegistry.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/WorkbenchPreview.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/WorkbenchThemeManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/ITheme.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/IThemeManager.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/themes/IThemePreview.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/UiTestSuite.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/JFaceThemeTest.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/TestColorFactory.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemeAPITest.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemePropertyListener.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemeTest.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/themes/ThemesTestSuite.java