Skip to main content



      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 03:42 Go to next message
Eclipse UserFriend
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 10:27 Go to previous messageGo to next message
Eclipse UserFriend
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 02:01 Go to previous message
Eclipse UserFriend
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: Sat Jul 12 09:55:58 EDT 2025

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

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

Back to the top