Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351394 - [Themes] Colors not remembered with non default theme
Summary: [Themes] Colors not remembered with non default theme
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 04:08 EDT by Peter Kullmann CLA
Modified: 2019-11-14 03:32 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kullmann CLA 2011-07-07 04:08:02 EDT
(There have been several bugs with more or less the same problem in earlier versions, eg bug 103907)

In 3.6 and 3.7 a custom definition for a color in a custom theme is not restored. Fonts on the other hand work well. 

I have noticed that ThemeElementHelper.populateRegistry() is called for fonts with the custom theme and the method for colors is called with the default theme and thus missing the values in the preferences. The two calls come from the workbench:

	/*
	 * Initializes the workbench fonts with the stored values.
	 */
	private void initializeFonts() {
		StartupThreading.runWithoutExceptions(new StartupRunnable() {

			public void runWithException() {
				FontDefinition[] fontDefinitions = WorkbenchPlugin.getDefault()
						.getThemeRegistry().getFonts();

				ThemeElementHelper.populateRegistry(getThemeManager()
						.getCurrentTheme(), fontDefinitions, PrefUtil
						.getInternalPreferenceStore());
			}
		});
	}

The second call (using the default theme instead of the current theme):
	/**
	 * Initialize colors defined by the new colorDefinitions extension point.
	 * Note this will be rolled into initializeColors() at some point.
	 * 
	 * @since 3.0
	 */
	private void initializeApplicationColors() {
		StartupThreading.runWithoutExceptions(new StartupRunnable() {

			public void runWithException() {
				ColorDefinition[] colorDefinitions = WorkbenchPlugin
						.getDefault().getThemeRegistry().getColors();
				ThemeElementHelper.populateRegistry(getThemeManager().getTheme(
						IThemeManager.DEFAULT_THEME), colorDefinitions,
						PrefUtil.getInternalPreferenceStore());
			}
		});
	}

Is there a workaround where I could force ThemeElementHelper.populateRegistry() with my custom theme?
Comment 1 Prakash Rangaraj CLA 2011-07-07 23:27:46 EDT
Since Susan is on leave, I'm marking Oleg as QA contact.
Comment 2 Lars Vogel CLA 2019-11-14 03:32:04 EST
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.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.