|Can anybody clarify how to use color themes in plug-in code? [message #1155317]
||Fri, 25 October 2013 21:10
| Jeff Johnston
Registered: July 2009
Hello, I have a user complaining about the colors in a View when a dark theme is used.|
In this View, the background color of some items are colored slightly differently based on the data. Currently these are hard-coded colors. I realize I need to change this code to use color themes.
I can find lots about setting color themes, but no description on how they should be used by an Eclipse developer.
There is the Eclipse marketplace eclipse-color-themes plugin as well as pages on using e4 css to set the theme and finally, general Eclipse color preferences.
I have found color themes for download that are based on Eclipse preferences that use names such as: "AbstractTextEditor.Color.Foreground" while eclipse-theme-plugin theme.xml files for the same theme use the name "foreground".
I have also found the following code:
IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
ITheme currentTheme = themeManager.getCurrentTheme();
ColorRegistry colorRegistry = currentTheme.getColorRegistry();
for accessing the color registry for the current theme, only I am not certain what values I have to choose from that are consistently going to work and get me colors from the theme.
Can anybody clarify this for me?
Powered by FUDForum
. Page generated in 0.08942 seconds