Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unregistered override services remain cached, preventing restoration of the JFace-backed fallback.
Review effort: Balanced
Findings: 1
What changed in this PR
Moves CSS color/font resolution from the workbench to JFace-backed CSS infrastructure, enabling pure e4 applications.
Changes:
- Adds a JFace registry-backed default provider.
- Treats unresolved color definitions like
unset. - Adds coverage for theme resolution and unresolved colors.
| File | Description |
|---|---|
JFaceThemeTest.java |
Tests current-theme registry resolution. |
ColorDefinitionTest.java |
Tests unresolved color behavior. |
org.eclipse.ui.workbench/META-INF/MANIFEST.MF |
Removes the workbench provider component. |
JFaceColorAndFontProvider.java |
Implements JFace-backed resolution. |
ColorAndFontUtil.java |
Adds default-provider fallback. |
CSSValueSWTColorConverterImpl.java |
Returns null for unresolved definitions. |
CSSSWTColorHelper.java |
Detects unresolved color definitions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vogella
force-pushed
the
lv/color-font-provider-npe
branch
from
October 7, 2026 09:30
01269d7 to
9c3bdda
Compare
vogella
force-pushed
the
lv/color-font-provider-npe
branch
7 times, most recently
from
October 7, 2026 12:26
14662dc to
28e3686
Compare
Comment on lines
+47
to
+49
| if (CSSSWTColorHelper.isUnresolvedColorDefinition(value)) { | ||
| // treated like unset, so the widget keeps its default color instead of black | ||
| return null; |
vogella
force-pushed
the
lv/color-font-provider-npe
branch
from
October 8, 2026 09:41
28e3686 to
4b91688
Compare
The IColorAndFontProvider used by the CSS engine was a DS service in org.eclipse.ui.workbench that read the current workbench theme. In e4 applications that have org.eclipse.ui.workbench on the runtime but no Workbench, for example through the E4 spies, every CSS value referencing a color or font definition failed with a NullPointerException. Without that bundle, no provider existed at all. The CSS engine now falls back to the JFace color and font registries, which the workbench keeps in sync with its current theme, so the workbench service is no longer needed. The workbench updates the JFace registries before it notifies theme listeners, so they see the new theme's values. A color, font or gradient definition that cannot be resolved is treated like unset, so the widget keeps its own color and font instead of turning black, switching to the default font or failing to paint. Assisted-by: multiple AI agents and layers of automated tooling 🤖
vogella
force-pushed
the
lv/color-font-provider-npe
branch
from
October 8, 2026 21:05
4b91688 to
572b025
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The CSS engine resolved color and font definition references (
'#org-eclipse-...') only through a DS service inorg.eclipse.ui.workbenchthat read the current workbench theme. In e4 applications that have that bundle on the runtime but no Workbench, for example through the E4 spies, every such CSS value failed with a NullPointerException, filling the log with hundreds of "Failed to apply CSS property" entries during startup. This change moves the lookup intoorg.eclipse.e4.ui.css.swt, backed by the JFace color and font registries, which the workbench already keeps in sync with its current theme, so the IDE resolves the same values as before and pure e4 applications can resolve definitions they register in JFace. A definition that cannot be resolved is now treated likeunset, so the widget keeps its default color instead of turning black. This is also a step toward using the IDE themes in RCP applications.