Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Can anybody clarify how to use color themes in plug-in code?
Can anybody clarify how to use color themes in plug-in code? [message #1155317] Fri, 25 October 2013 17:10
Jeff Johnston is currently offline Jeff Johnston
Messages: 169
Registered: July 2009
Senior Member
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?
Previous Topic:TreeViewer with huge amount of data
Next Topic:Store Preferences within PostContextCreate
Goto Forum:
  


Current Time: Fri Apr 18 17:06:39 EDT 2014

Powered by FUDForum. Page generated in 0.01467 seconds