Skip to main content

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 21:10
Jeff Johnston is currently offline Jeff JohnstonFriend
Messages: 210
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: Sun Feb 23 00:00:06 GMT 2020

Powered by FUDForum. Page generated in 0.01933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top