RFR: 7056: Fix dark mode

Brice Dutheil duke at openjdk.java.net
Mon Jan 17 11:55:55 UTC 2022


On Sun, 16 Jan 2022 15:32:33 GMT, Brice Dutheil <duke at openjdk.java.net> wrote:

> This change allows a user of the JMC RCP application to switch the appearance with the default Eclipse themes.
> 
> Those are shipped via the `org.eclipse.ui.themes` and `org.eclipse.e4.ui.css.swt.theme` plugin.
> In order to activate them all that is is required is to add the above in the application feature file, and to declare them in the application manifest file.
> 
> 
> 
> **After**
> ![Screenshot 2022-01-16 at 16 23 46](https://user-images.githubusercontent.com/803621/149666554-3016effc-b527-4dd7-aa6b-baa07a9569ad.png)
> ![Screenshot 2022-01-16 at 16 26 21](https://user-images.githubusercontent.com/803621/149666560-cab76fc9-dd9a-4977-9fe7-0a7dc99335c5.png)
> 
> 
> 
> **Before**
> ![Screenshot 2022-01-16 at 16 24 45](https://user-images.githubusercontent.com/803621/149666542-b8e22717-a797-44b6-9805-30b9c14fb9fa.png)
> There's no theme, as such the combo box doesn't open either.

Note this PR doesn't fix the graph issues mentioned in [JMC-7056](https://bugs.openjdk.java.net/browse/JMC-7056).

For JMC-7056, I'm not quite sure how to fix that yet, but using the following APIs might prove useful:

* `PlatformUI.getWorkbench().getThemeManager().getCurrentTheme()` gets an `ITheme`
* `theme.getColorRegistry().get(String)` gets the `Color` or a symbolic name

It makes sense, let's fix those.

-------------

PR: https://git.openjdk.java.net/jmc/pull/362


More information about the jmc-dev mailing list