This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 431744 - [CSS] Support using multiple CSS engines
Summary: [CSS] Support using multiple CSS engines
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Brian de Alwis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 14:59 EDT by Brian de Alwis CLA
Modified: 2014-04-29 14:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2014-04-01 14:59:30 EDT
I have a prototype of a CSS Engine that I'll be committing to the e4.ui repository shortly.  This engine is analogous to the CSS-SWT engine but it works directly against the E4 Workbench model elements, rather than indirecting through the SWT widget's modelElement/OWNING_ME.  This allows bug 362420 to be addressed with CSS by the toggling the visible flag directly:

   ToolControl#SearchField { visibility: false; }


Issues that arose:

1. CSSEngineImpl's element provider support only walk the object class hierarchy and ignore the interfaces, which doesn't work for EMF-based objects.  I cleaned up CSSEngineImpl by extracting out the registry-based element provider to a separate class, and also added support for walking interfaces.

1.5. The relationship between AbstractCSSEngine's elementProvider and widgetMap was never very clear (viz bug 363053).  And from looking at AbstractCSSEngine#handleWidgetDisposed() the widgetMap looks like it was supposed to be literally a map of widgets to elements, rather than widget classes to element providers.  Since the only other use was for a test case, which was easily rewritten to use an IElementProvider, I've tossed the widgetMap.

2. ThemeEngine missing #getCSSEngines() so as to provide access to the CSS engines being managed; we want a single set of CSS files that can be interpreted as required.  This is only necessary for the CSS Scratchpad
Comment 2 Dani Megert CLA 2014-04-02 05:17:43 EDT
(In reply to Brian de Alwis from comment #1)
> Bumped service release for org.eclipse.e4.ui.css.swt.theme to 201:
> 
>   
> https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=a0929617e9bc0ec46d76d8898739b7450795b942

There are three bugs with that:
1. The version was already correctly incremented for Luna.
2. If at all, the increment would have been +100 (+1 is for service releases).
For more details about version numbering see https://wiki.eclipse.org/Version_Numbering
3. The version must also be updated in the 'pom.xml'.
Hint: The Releng tools plug-in:
http://download.eclipse.org/eclipse/downloads/drops4/S-4.4M6-201403061200/#org.eclipse.releng
offers to do that check for you (see 'POM Version Tool' preference page).


Unfortunately, there's already an I-build produced with the wrong number, so we have to set it to 0.9.300.

Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=
Comment 4 Brian de Alwis CLA 2014-04-02 12:18:00 EDT
Thanks for fixing this Dani.  I have the releng tool installed but discovered that it is defaults to ignore POM version mismatches.
Comment 5 Brian de Alwis CLA 2014-04-29 12:57:43 EDT
Verified still working with I20140428-2000.
Comment 6 Lars Vogel CLA 2014-04-29 13:02:17 EDT
(In reply to Brian de Alwis from comment #5)
> Verified still working with I20140428-2000.

Can you add this development to the N&N M7?
Comment 7 Brian de Alwis CLA 2014-04-29 14:26:42 EDT
There's one little niggling problem that needs to be dealt with first: see bug 433789.  Thanks for reminding me to file the bug.