Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Load image based on Eclipse theme
Load image based on Eclipse theme [message #1859066] Wed, 10 May 2023 07:42 Go to next message
Dan Moldoveanu is currently offline Dan MoldoveanuFriend
Messages: 4
Registered: May 2023
Junior Member
Hi everyone,

I am developing a plugin for Eclipse IDE which now needs to have 2 different loading spinners based on the theme of the IDE that he's running on.

Is there any way to get the current theme of the IDE and see that I have "Light" or "Classic" or "Dark" or whatever?

The only way I found to do this is by getting the colorRegistry and see its RGBA color model (which is not really enough) by doing this:
PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);

Thanks! :)
Re: Load image based on Eclipse theme [message #1859077 is a reply to message #1859066] Wed, 10 May 2023 14:27 Go to previous messageGo to next message
Dan Moldoveanu is currently offline Dan MoldoveanuFriend
Messages: 4
Registered: May 2023
Junior Member
I was able to check the current theme by using
Display.getDefault().getData("org.eclipse.e4.ui.css.swt.theme").getActiveTheme().getLabel();

Thanks! :)
Re: Load image based on Eclipse theme [message #1859258 is a reply to message #1859077] Wed, 24 May 2023 06:01 Go to previous message
Joseph Adriane Cabrera is currently offline Joseph Adriane CabreraFriend
Messages: 5
Registered: January 2022
Junior Member
Hello,

I have the same problem.

Quote:
Is there any way to get the current theme of the IDE and see that I have "Light" or "Classic" or "Dark" or whatever?


I tried the following but I could not get the current theme of the workbench:
1. (WorkbenchThemeManager) themeManager.getTheme("org.eclipse.e4.ui.css.theme.e4_dark");
2. themeManager.getCurrentTheme().getLabel();
3. Display.isSystemDarkTheme();
4. OS.IsAppThemed();


Previous Topic:Custom Eclipse Plugin compatibility issues due to changes in EclipseLauncher class
Next Topic:RCP Application - Unresolved requirement
Goto Forum:
  


Current Time: Fri Sep 20 22:05:35 GMT 2024

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

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

Back to the top