This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 422536 - [CSS] styling for preference values
Summary: [CSS] styling for preference values
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Daniel Rolka CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 430996 (view as bug list)
Depends on:
Blocks: 432959 433475
  Show dependency tree
 
Reported: 2013-11-25 19:00 EST by Lars Vogel CLA
Modified: 2014-04-29 10:09 EDT (History)
7 users (show)

See Also:


Attachments
editor prefs from http://eclipsecolorthemes.org/ (29.75 KB, text/plain)
2014-03-20 14:00 EDT, Paul Webster CLA
no flags Details
Syntax Coloring vs. CSS (69.96 KB, image/png)
2014-03-22 09:52 EDT, Timo Kinnunen CLA
no flags Details
Source 'code' for the mock-up (5.24 KB, text/html)
2014-03-22 10:03 EDT, Timo Kinnunen CLA
no flags Details
CSS style sheet used during testing the patch (6.72 KB, text/plain)
2014-04-01 11:55 EDT, Daniel Rolka CLA
no flags Details
CSS style sheet used during testing the patch (v2) (6.65 KB, text/plain)
2014-04-08 07:58 EDT, Daniel Rolka CLA
no flags Details
Dark editor prefs as CSS (3.31 KB, text/plain)
2014-04-11 17:15 EDT, Paul Webster CLA
no flags Details
Dark editor prefs as CSS (v2) (3.40 KB, text/plain)
2014-04-14 10:24 EDT, Daniel Rolka CLA
no flags Details
CSS style sheet used during testing the patch (v3) (6.65 KB, text/plain)
2014-04-14 10:26 EDT, Daniel Rolka CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2013-11-25 19:00:37 EST
It would be useful if it would be possible to control the system highlighting of the Java source editor (and others) via CSS. Currently you have to do this via the Java preferences located under Java-> Editor -> Syntax Coloring?

Daniel suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=419016#c23 to open a new bug for this feature request.
Comment 1 Lars Vogel CLA 2014-01-27 16:25:07 EST
I think the Eclipse color theme does something similar, it is also EPL. https://github.com/eclipse-color-theme/eclipse-color-theme
Comment 2 Lars Vogel CLA 2014-03-17 07:57:36 EDT
Daniel, it this fix with the new font or color dialog, or is there still something missing?
Comment 3 Daniel Rolka CLA 2014-03-18 04:15:49 EDT
(In reply to Lars Vogel from comment #2)
> Daniel, it this fix with the new font or color dialog, or is there still
> something missing?

It is still unresolved. I think the best option would be modifying the JDT in order to use the 3.x themes. Currently it uses custom Font/Color management and stores/gets resources directly in the Preference store

Daniel
Comment 4 Lars Vogel CLA 2014-03-19 13:42:20 EDT
(In reply to Daniel Rolka from comment #3)

We could support setting preferences via CSS, e.g.,

Preferences {
    org.eclipse.core.resources/refresh.lightweight.enabled:true
}

This would allow to set every preference value via CSS including JDT.
Comment 5 Daniel Rolka CLA 2014-03-20 05:02:45 EDT
(In reply to Lars Vogel from comment #4)
> (In reply to Daniel Rolka from comment #3)
> 
> We could support setting preferences via CSS, e.g.,
> 
> Preferences {
>     org.eclipse.core.resources/refresh.lightweight.enabled:true
> }
> 
> This would allow to set every preference value via CSS including JDT.

I'm not sure if we should modify the preferences via CSS. I think the 'plugin_customization.ini' file is better option in order to do it (http://www.eclipse.org/eclipse/platform-core/documents/user_settings/plugin_customization.html)

Maybe we should reassign the bug to the JDT component and next prepare the proper patch where we add the 3.x theme support for the syntax coloring

Daniel
Comment 6 Lars Vogel CLA 2014-03-20 09:04:35 EDT
(In reply to Daniel Rolka from comment #5)

> I'm not sure if we should modify the preferences via CSS. I think the
> 'plugin_customization.ini' file is better option in order to do it
> (http://www.eclipse.org/eclipse/platform-core/documents/user_settings/
> plugin_customization.html)

The disadvantage is that plugin_customization.ini is global, e.g. the same for all themes. Also I really like that the idea that CSS allows you to tweak everything", e.g., you would be able to activate the "Heap status" with this approach.

> Maybe we should reassign the bug to the JDT component and next prepare the
> proper patch where we add the 3.x theme support for the syntax coloring

I think it would be great if JDT switches to the font and color dialog. Can you open a new bug for JDT? I would like to use this one for the preference setting.
Comment 7 Paul Webster CLA 2014-03-20 09:19:17 EDT
(In reply to Daniel Rolka from comment #5)
> I'm not sure if we should modify the preferences via CSS. I think the
> 'plugin_customization.ini' file is better option in order to do it
> (http://www.eclipse.org/eclipse/platform-core/documents/user_settings/
> plugin_customization.html)

As Lars says, this file is not related to themes and so you can't provide 2 CSS themes with different editor content via plugin_customization.ini

PW
Comment 8 Daniel Rolka CLA 2014-03-20 09:55:23 EDT
(In reply to Lars Vogel from comment #6)
> (In reply to Daniel Rolka from comment #5)
> 
> > I'm not sure if we should modify the preferences via CSS. I think the
> > 'plugin_customization.ini' file is better option in order to do it
> > (http://www.eclipse.org/eclipse/platform-core/documents/user_settings/
> > plugin_customization.html)
> 
> The disadvantage is that plugin_customization.ini is global, e.g. the same
> for all themes. Also I really like that the idea that CSS allows you to
> tweak everything", e.g., you would be able to activate the "Heap status"
> with this approach.

Do you want to override all preferences by the CSS or only the GUI related ones?
For the GUI preferences only I would define the proper CSS properties (similarly as we do it for the MRU support). I think we should follow the CSS standard as much as possible.

> 
> > Maybe we should reassign the bug to the JDT component and next prepare the
> > proper patch where we add the 3.x theme support for the syntax coloring
> 
> I think it would be great if JDT switches to the font and color dialog. Can
> you open a new bug for JDT? I would like to use this one for the preference
> setting.

I've opened the bug 430792 for it

Daniel
Comment 9 Lars Vogel CLA 2014-03-20 11:01:06 EDT
(In reply to Daniel Rolka from comment #8)

> Do you want to override all preferences by the CSS or only the GUI related
> ones?
> For the GUI preferences only I would define the proper CSS properties
> (similarly as we do it for the MRU support). I think we should follow the
> CSS standard as much as possible.

I think we should allow to set all property values. Defining separate entries for all values is not feasible, for example PyDev, JDT, Android, Perl, Git have its own editors and views with properties for their elements. 

Paul and I discussed that on EclipseCon and he suggested we advice using this only for UI related properties but do not limited it to it. For example with this approach you could use CSS to set the default selected buttons in any view, e.g., EGit, Console, History, which I think would be very useful to users and it is UI related.
Comment 10 Daniel Rolka CLA 2014-03-20 11:33:12 EDT
(In reply to Lars Vogel from comment #9)
> (In reply to Daniel Rolka from comment #8)
> 
> > Do you want to override all preferences by the CSS or only the GUI related
> > ones?
> > For the GUI preferences only I would define the proper CSS properties
> > (similarly as we do it for the MRU support). I think we should follow the
> > CSS standard as much as possible.
> 
> I think we should allow to set all property values. Defining separate
> entries for all values is not feasible, for example PyDev, JDT, Android,
> Perl, Git have its own editors and views with properties for their elements. 
> 
> Paul and I discussed that on EclipseCon and he suggested we advice using
> this only for UI related properties but do not limited it to it. For example
> with this approach you could use CSS to set the default selected buttons in
> any view, e.g., EGit, Console, History, which I think would be very useful
> to users and it is UI related.

OK, but maybe instead of the construction: 

Preferences {
	org.eclipse.core.resources/refresh.lightweight.enabled:true
}

we can use the following one:

.MPart#org-eclipse-egit-ui-RepositoriesView {
  color: black;
  border: 1px solid black;
  
  preference: 'org.eclipse.core.resources/refresh.lightweight.enabled=true',
               'otherPropertyName1=value1', 'otherPropertyName2=value2';
}

It better matches the CSS standard and we will be able to override the 'preference' property in other selectors

Daniel
Comment 11 Lars Vogel CLA 2014-03-20 11:44:35 EDT
(In reply to Daniel Rolka from comment #10)
> we can use the following one:
> 
> .MPart#org-eclipse-egit-ui-RepositoriesView {
>   color: black;
>   border: 1px solid black;
>   
>   preference: 'org.eclipse.core.resources/refresh.lightweight.enabled=true',
>                'otherPropertyName1=value1', 'otherPropertyName2=value2';
> }
> 
> It better matches the CSS standard and we will be able to override the
> 'preference' property in other selectors

I like the proposal but preference in Eclipse are global, so I don't know how the rule would select the "best" fitting style. Maybe we can modify your suggestion so that we support properties only for CSS in MApplication? Something like:

 .MApplication{
   preference: 'org.eclipse.core.resources/refresh.lightweight.enabled=true',
               'otherPropertyName1=value1', 'otherPropertyName2=value2';
 }

What do you think?
Comment 12 Daniel Rolka CLA 2014-03-20 11:56:26 EDT
(In reply to Lars Vogel from comment #11)
> What do you think?

Yes, it looks fine for me,

Daniel
Comment 13 Daniel Rolka CLA 2014-03-20 12:07:07 EDT
(In reply to Daniel Rolka from comment #12)
> (In reply to Lars Vogel from comment #11)
> > What do you think?
> 
> Yes, it looks fine for me,
> 
> Daniel

However the selectors that express some application's state (with the tags, i.e. 'active', 'busy', ...) could also modify the properties - for instance we want to display some additional items in GUI (controlled by the preferences) when some .MPart gets some state

Daniel
Comment 14 Paul Webster CLA 2014-03-20 13:55:38 EDT
Is it just another property handler?

<selector> {
  preference: 'org.eclipse.ui/PREF=true', 'org.eclipse.text.editors/A_FONT='name;size';
} 

That looks a mess.  Can it be spread across lines?  
<selector> {
  preference: 'org.eclipse.ui/PREF=true';
  preference: 'org.eclipse.text.editors/A_FONT='font: name;font-size: 8';
}

Since it's primary purpose is for setting colors and fonts (at initially) how would the preference look for setting a font (we just pretend it's an inline style)?

As a property, if you had 2 rules with a preference: wouldn't the CSS engine throw one of them away based on the selectors of the different rules?

What about similar to color and font defs:

org-eclipse-Preference#org-eclipse-ui/PREF {
  value: true;
}

org-eclipse-Preference#org-eclipse-text-editors/A_FONT {
  font: name;
  font-size: 8;
}

PW
Comment 15 Paul Webster CLA 2014-03-20 14:00:40 EDT
Created attachment 241066 [details]
editor prefs from http://eclipsecolorthemes.org/

Here are a list of prefs that we can use to test setting them from the pref page

PW
Comment 16 Daniel Rolka CLA 2014-03-21 07:04:09 EDT
(In reply to Paul Webster from comment #14)
> Is it just another property handler?

Yes. Basically the implementation of the feature doesn't seem to be complicated. We shouldn't have the issues with refreshing after updating the preference store since after the change the proper listeners will be notified. However we will have to fix the preference dialog to allow the users manually modify the preference values exposed by plugins and overridden by the CSS (without this change the CSS will always override the values)

> 
> <selector> {
>   preference: 'org.eclipse.ui/PREF=true',
> 'org.eclipse.text.editors/A_FONT='name;size';
> } 
> 
> That looks a mess.  Can it be spread across lines?  
> <selector> {
>   preference: 'org.eclipse.ui/PREF=true';
>   preference: 'org.eclipse.text.editors/A_FONT='font: name;font-size: 8';
> }

Unfortunately it doesn't work since the first preference will be taken into account by the CSS engine only (actually by the Batik during parsing the style sheet). We have to have the unique property names

> 
> Since it's primary purpose is for setting colors and fonts (at initially)
> how would the preference look for setting a font (we just pretend it's an
> inline style)?
> 
> As a property, if you had 2 rules with a preference: wouldn't the CSS engine
> throw one of them away based on the selectors of the different rules?
> 
> What about similar to color and font defs:
> 
> org-eclipse-Preference#org-eclipse-ui/PREF {
>   value: true;
> }
> 
> org-eclipse-Preference#org-eclipse-text-editors/A_FONT {
>   font: name;
>   font-size: 8;
> }
> 
> PW

It depends on how far we want to go in this feature. Using the syntax above we will be able to override the 
property values per CSS theme. We have to use the similar construction to the ThemesExtension element in 
order to add the new preferences with the CSS (we have to know what we are looking for in the style sheet).

However I would allow to define the preferences per CSS theme and selectors representing the application's 
state (i.e. .MPart.active) since it is more flexible to the user. Besides modifying the 
Colors/Fonts or showing/hiding some GUI items regarding the particular preference value (as I've mentioned in the 
comment 13), they can go further and for instance:

- define some special text and update the proper widgets with it (see the snippet below)
- define special data formatters for the particular state
- limit the numbers of displayed rows in the viewers or highlight some rows that are important for the particular state and so on.

I think, from the RCP developers point of view it can be very valuable feature.


To simplify a bit the CSS syntax for the preferences we can use the following constructions:

<selector> {
	preference: '#org-eclipse-ui/PRE', '#org-eclipse-text-editors/A_FONT'; -> We can use the 'space' as the delimiter of the list. Additionally we can use the new as well as the already existing preferences.

} 

org-eclipse-Preference#org-eclipse-ui/PREF {
	value: true;
}

org-eclipse-Preference#org-eclipse-text-editors/A_FONT {
	font: name;
	font-size: 8;
}

.MPart {
	preference: '#org-eclipse-ui/loadingIdicatorVisible=false';
}
 
.MPart.busy {
	preference: '#org-eclipse-ui/loadingIdicatorText', '#org-eclipse-ui/loadingIdicatorVisible=true';
} 

org-eclipse-Preference#org-eclipse-ui/loadingIdicatorText {
	value: 'Loading data, please wait';
}

Daniel
Comment 17 Daniel Rolka CLA 2014-03-21 07:24:42 EDT
(In reply to Daniel Rolka from comment #16)
> 
> <selector> {
> 	preference: '#org-eclipse-ui/PRE', '#org-eclipse-text-editors/A_FONT'; ->
> We can use the 'space' as the delimiter of the list. Additionally we can use
> the new as well as the already existing preferences.
> 
> } 
> 
> org-eclipse-Preference#org-eclipse-ui/PREF {
> 	value: true;
> }
> 
> org-eclipse-Preference#org-eclipse-text-editors/A_FONT {
> 	font: name;
> 	font-size: 8;
> }
> 
> .MPart {
> 	preference: '#org-eclipse-ui/loadingIdicatorVisible=false';
> }
>  
> .MPart.busy {
> 	preference: '#org-eclipse-ui/loadingIdicatorText',
> '#org-eclipse-ui/loadingIdicatorVisible=true';
> } 
> 
> org-eclipse-Preference#org-eclipse-ui/loadingIdicatorText {
> 	value: 'Loading data, please wait';
> }
> 
> Daniel

I can prepare the initial version of the patch for the feature if we have the final version of the CSS syntax for it

Daniel
Comment 18 Paul Webster CLA 2014-03-21 18:11:44 EDT
(In reply to Daniel Rolka from comment #16)
> Unfortunately it doesn't work since the first preference will be taken into
> account by the CSS engine only (actually by the Batik during parsing the
> style sheet). We have to have the unique property names

So this means we can't really use preference:, since another rule that provided a completely different preference this way would cause the CSS engine to throw it away.

> However I would allow to define the preferences per CSS theme and selectors
> representing the application's 
> state (i.e. .MPart.active) since it is more flexible to the user. Besides
> modifying the 
> Colors/Fonts or showing/hiding some GUI items regarding the particular
> preference value (as I've mentioned in the 
> comment 13), they can go further and for instance:

The only reason I want to enable this feature is so that a CSS theme can set editor preferences, just like eclipsecolorthemes.org.

I don't want people to think CSS is a back door for setting eclipse preferences, since it should only deal with appearance-related preferences.

> To simplify a bit the CSS syntax for the preferences we can use the
> following constructions:
> 
> <selector> {
> 	preference: '#org-eclipse-ui/PRE', '#org-eclipse-text-editors/A_FONT'; ->
> We can use the 'space' as the delimiter of the list. Additionally we can use
> the new as well as the already existing preferences.
> 
> }

This is the one that won't work with CSS cascade rules (it is far too easy for users to break their own preferences or a parent style sheet's preferences.


> 
> org-eclipse-Preference#org-eclipse-ui/PREF {
> 	value: true;
> }
> 
> org-eclipse-Preference#org-eclipse-text-editors/A_FONT {
> 	font: name;
> 	font-size: 8;
> }

This is consistent with our color and font definitions.

> 
> .MPart {
> 	preference: '#org-eclipse-ui/loadingIdicatorVisible=false';
> }
>  
> .MPart.busy {
> 	preference: '#org-eclipse-ui/loadingIdicatorText',
> '#org-eclipse-ui/loadingIdicatorVisible=true';
> } 

I wouldn't want to tie preferences (which are global) to the runtime state of the CSS.  That could cause a lot of thrashing in the system, especially if the same rule was applied to multiple widgets.

PW
Comment 19 Timo Kinnunen CLA 2014-03-22 09:52:07 EDT
Created attachment 241126 [details]
Syntax Coloring vs. CSS

Is there some reason for not just using CSS like it's meant to be used; to put colors and fonts on some texts? You know, the task it was created for? Is inventing a way of styling some SQLite databases with non-standard CSS really easier than doing what someone using HTML & CSS would do: be putting some span:s around text blocks and adding meaningful CSS class combinations to them?

Because I just tried that as a proof-of-concept and don't see any meaningful difference in the attached comparison screenshot between the Syntax Coloring preview window and the HTML+CSS mock-up inside a browser.
Comment 20 Timo Kinnunen CLA 2014-03-22 10:03:48 EDT
Created attachment 241127 [details]
Source 'code' for the mock-up

Here's the self-contained mock-up used in the comparison. Your results may vary based on locally available fonts and system DPI settings, for example.

Take a loot inside anyway, and see the selectors for methods. Where's 'declared static method', for example? If going with preferences you'll have to fight CSS both ways, first to add CSS styling to stored preferences, then adding exclusions for several perfectly reasonable combinations that don't have a setting in preferences.
Comment 21 Paul Webster CLA 2014-03-22 14:05:38 EDT
(In reply to Timo Kinnunen from comment #19)
> Created attachment 241126 [details]
> Syntax Coloring vs. CSS
> 
> Is there some reason for not just using CSS like it's meant to be used; to
> put colors and fonts on some texts?

Any new views and editors are free to do their styling with CSS.  The views and editors that exist today don't, so to style them we can either set the preferences (possible to do in M7) or re-write each individual view/editor styling (possible to do by Mars+1).  So we're looking at updating the existing styling via preferences.

PW
Comment 22 Lars Vogel CLA 2014-03-24 08:08:28 EDT
*** Bug 430996 has been marked as a duplicate of this bug. ***
Comment 23 Daniel Rolka CLA 2014-03-25 09:13:50 EDT
Lars,

Do you work on it or I can take it?

Daniel
Comment 24 Lars Vogel CLA 2014-03-25 10:08:47 EDT
(In reply to Daniel Rolka from comment #23)
> Lars,
> 
> Do you work on it or I can take it?
> 
> Daniel

Please take it.
Comment 25 Daniel Rolka CLA 2014-04-01 11:55:48 EDT
Created attachment 241477 [details]
CSS style sheet used during testing the patch

I've pushed the initial version of the patch to Gerrit: https://git.eclipse.org/r/#/c/24266/

It seems to be working fine, but I have to perform more tests of it (especially the manual overriding of the preferences with the preference dialog)

Unfortunately we are not so flexible with the CSS syntax for it as I was initially thinking - we have to have the fixed CSS property name (i.e. preferences), however we can try to modify the syntax slightly. The separator for the preferences is any valid CSS list separator (i.e. new line, the comma is also accepted)
The preferences listed in the CSS file are in the same form as stored in the workspace (i.e. in the file <WORKSPACE>.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs) -> see the 'CSS style sheet used during testing the patch' attachment

Daniel
Comment 26 Paul Webster CLA 2014-04-01 13:14:40 EDT
(In reply to Daniel Rolka from comment #25)
> Created attachment 241477 [details]
> CSS style sheet used during testing the patch

AFAIK we don't need all that workbench stuff. See how /org.eclipse.e4.core.di.extensions/src/org/eclipse/e4/core/di/internal/extensions/PreferencesObjectSupplier.java deals with preferences, using IEclipsePreferences and org.eclipse.core.runtime.preferences.IPreferencesService

This will allow it to work with Eclipse4 applications.

> 
> I've pushed the initial version of the patch to Gerrit:
> https://git.eclipse.org/r/#/c/24266/

So the proposed style is:
PreferenceNode#org-eclipse-jdt-ui-preferences-JavaEditorColoringPreferencePage {
	preferences: 
		'semanticHighlighting.abstractClass.color=128,255,0'
		'semanticHighlighting.abstractClass.color=128,255,1'
		'semanticHighlighting.abstractClass.enabled=true'		
		'java_bracket=0,255,255'
		'java_bracket_bold=true'
		'java_bracket_italic=true'
		'java_bracket_strikethrough=true'
		'java_bracket_underline=' /*reset to default value*/
}

If we're using the IEclipsePreferences or IPreferencesService it would probably have to be something like:

PreferenceNode#org-eclipse-jdt-ui {
	preferences: 
		'semanticHighlighting.abstractClass.color=128,255,0'
		'semanticHighlighting.abstractClass.color=128,255,1'
		'semanticHighlighting.abstractClass.enabled=true'		
		'java_bracket=0,255,255'
		'java_bracket_bold=true'
		'java_bracket_italic=true'
		'java_bracket_strikethrough=true'
		'java_bracket_underline=' /*reset to default value*/
}

What happens if 2 included style sheets both provide the PreferenceNode#org-eclipse-jdt-ui rule?

PW
Comment 27 Daniel Rolka CLA 2014-04-02 02:03:58 EDT
(In reply to Paul Webster from comment #26)
> (In reply to Daniel Rolka from comment #25)
> > Created attachment 241477 [details]
> > CSS style sheet used during testing the patch
> 
> AFAIK we don't need all that workbench stuff. See how
> /org.eclipse.e4.core.di.extensions/src/org/eclipse/e4/core/di/internal/
> extensions/PreferencesObjectSupplier.java deals with preferences, using
> IEclipsePreferences and
> org.eclipse.core.runtime.preferences.IPreferencesService
> 
> This will allow it to work with Eclipse4 applications.

OK, it sounds good to me. I will update the patch respectively.

> 
> > 
> > I've pushed the initial version of the patch to Gerrit:
> > https://git.eclipse.org/r/#/c/24266/
> 
> So the proposed style is:
> PreferenceNode#org-eclipse-jdt-ui-preferences-
> JavaEditorColoringPreferencePage {
> 	preferences: 
> 		'semanticHighlighting.abstractClass.color=128,255,0'
> 		'semanticHighlighting.abstractClass.color=128,255,1'
> 		'semanticHighlighting.abstractClass.enabled=true'		
> 		'java_bracket=0,255,255'
> 		'java_bracket_bold=true'
> 		'java_bracket_italic=true'
> 		'java_bracket_strikethrough=true'
> 		'java_bracket_underline=' /*reset to default value*/
> }
> 
> If we're using the IEclipsePreferences or IPreferencesService it would
> probably have to be something like:
> 
> PreferenceNode#org-eclipse-jdt-ui {
> 	preferences: 
> 		'semanticHighlighting.abstractClass.color=128,255,0'
> 		'semanticHighlighting.abstractClass.color=128,255,1'
> 		'semanticHighlighting.abstractClass.enabled=true'		
> 		'java_bracket=0,255,255'
> 		'java_bracket_bold=true'
> 		'java_bracket_italic=true'
> 		'java_bracket_strikethrough=true'
> 		'java_bracket_underline=' /*reset to default value*/
> }
> 
> What happens if 2 included style sheets both provide the
> PreferenceNode#org-eclipse-jdt-ui rule?

They will be merged in such case (the cascading policy)

> 
> PW

Daniel
Comment 28 Daniel Rolka CLA 2014-04-08 07:58:12 EDT
Created attachment 241722 [details]
CSS style sheet used during testing the patch (v2)
Comment 29 Daniel Rolka CLA 2014-04-11 09:58:57 EDT
(In reply to Daniel Rolka from comment #25)
> Created attachment 241477 [details]
> CSS style sheet used during testing the patch
> 
> I've pushed the initial version of the patch to Gerrit:
> https://git.eclipse.org/r/#/c/24266/
> 

I've pushed the 2nd part of the patch to Gerrit - https://git.eclipse.org/r/#/c/24860/

Daniel
Comment 30 Paul Webster CLA 2014-04-11 17:15:11 EDT
Created attachment 241905 [details]
Dark editor prefs as CSS

I tested by adding the above content to the CSS editor in the Appearance pref page.

PW
Comment 31 Daniel Rolka CLA 2014-04-14 10:24:49 EDT
Created attachment 241964 [details]
Dark editor prefs as CSS (v2)
Comment 32 Daniel Rolka CLA 2014-04-14 10:26:14 EDT
Created attachment 241965 [details]
CSS style sheet used during testing the patch (v3)
Comment 34 Paul Webster CLA 2014-04-15 11:17:00 EDT
We need some minimal test cases for this new functionality.

PW
Comment 35 Daniel Rolka CLA 2014-04-16 11:12:52 EDT
(In reply to Paul Webster from comment #34)
> We need some minimal test cases for this new functionality.
> 
> PW

Released as: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7d632536353ddbe645c85afd75a328b5e35dfd7a

Daniel
Comment 36 Paul Webster CLA 2014-04-16 16:06:13 EDT
From Daniel about firing the Theme event in the PartRenderingEngine:

It works fine in my local env (Windows 7). I think I've seen the similar issue working on the version of the patch with the Addons, but the latest version always worked for me as expected. Anyway, I've prepared two patches that should solve the issue in better way:

1) https://git.eclipse.org/r/#/c/25159/ - I assume that we don't have all pieces in place during 1st 'IThemeEngine.Events.THEME_CHANGED' event, sent during processing the 'themeEngine.restore(cssTheme)' method. So maybe the patch will be sufficient

2) https://git.eclipse.org/r/#/c/25158/ - we can send some extra event when we are initializing the styling and style the preferences first time, handling it. The StylingPreferencesHandler will be invoked 2nd time when the event 'IThemeEngine.Events.THEME_CHANGED' occurs, but there won't be modified any preferences since all changes will be already in place after considered extra event. The 2nd run will be treat as the modification of the preferences by the user so it is not so bad

Please check if the patches work for you and let me know if you would like to apply one of them.
Comment 37 Paul Webster CLA 2014-04-16 16:08:21 EDT
(In reply to Paul Webster from comment #36)
> From Daniel about firing the Theme event in the PartRenderingEngine:
> 
> It works fine in my local env (Windows 7). I think I've seen the similar
> issue working on the version of the patch with the Addons, but the latest
> version always worked for me as expected. Anyway, I've prepared two patches
> that should solve the issue in better way:

If it works fine in both cases (new workspace with prefs in the default css and used workspace with the prefs added after the fact) without that call then why not remove it.

PW
Comment 39 Daniel Rolka CLA 2014-04-29 09:47:18 EDT
Verified in the build: I20140428-2000

There is small refreshing issue that was reported with the Bug 433765

Daniel
Comment 40 Lars Vogel CLA 2014-04-29 10:09:36 EDT
We also have a consumer in the platform, in the dark theme I use it to style org.eclipse.ui. UI relevant preference values for the dark theme.