DESCRIPTION

Bug 516114: Add support for styling of TabbedProperties View

Adding CSS styling support for the tabbed properties in the properties
view. This includes styling of the TabbedPropertyTitle (title bar on
top) and styling of the TabbedPropertyList (the tabs on the left).

Change-Id: I6f92c73fb94e269e4a172dd0dde8ddda017dea31
Signed-off-by: Sheldon Collins xxx@xxx.xxx


COMMENTS

author: Sheldon Collins
date: 2017-05-11 07:35:08.000000000

Uploaded patch set 7.

-------------------------------------
author: Brenden Conley
date: 2017-05-11 07:35:14.000000000

Patch Set 7:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/12689/

-------------------------------------
author: Sheldon Collins
date: 2017-05-11 07:35:33.000000000

Patch Set 7:

> Matthias, please add a test that if the CSS property is not set the
 > CSS engine will not change the default colors.

Done in patch set 7.

-------------------------------------
author: Brenden Conley
date: 2017-05-11 08:02:23.000000000

Patch Set 7: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/12689/ : SUCCESS

-------------------------------------
author: Zaid Mosley
date: 2017-05-11 15:52:46.000000000

Patch Set 7:

(15 comments)

Line:30, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyListCssPropertyHandler.java -> I know most of our CSS handler do this, but to improve readability I think we should do:
if (!instancefo..) {
return}
normal code

Line:165, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java -> set?

Line:169, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java -> resetSection...

Line:174, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java -> cache f.getColors() as local variable to make this more readable?

Line:508, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Can we come up with more descriptive names for these properties?

Line:519, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> I suggest to use "swt-" as prefix for the new properties

Line:520, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Why not using "background-color" here? I think that is the normal attribute for a background color.

Line:523, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Why not using color here (which is IMHO our standard for defining the foreground color).

Line:524, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Please remove ws

Line:92, tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/CssSwtTestSuite.java -> Remove whitespace and alignment should be the same

Line:31, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyTitleCssPropertyHandler.java -> Avoid redundant type definition

Line:43, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyTitleCssPropertyHandler.java -> I know most of our CSS handler do this, but to improve readability I think we should do:
if (!instancefo..) {
return}
normal code

Line:914, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> re sounds weird. Why not set?

Line:922, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> re sounds weird. Why not setWidgetBaseBackgroundColor or something similar?

Line:928, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> Convert the long repetitive factory calls into a private method?

-------------------------------------
author: Sheldon Collins
date: 2017-05-12 05:35:18.000000000

Patch Set 7:

(2 comments)

Line:31, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyTitleCssPropertyHandler.java -> What exactly do you mean?

Line:928, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> it just is copied from initColours(). So I wanted to keep the changes minimal.

-------------------------------------
author: Zaid Mosley
date: 2017-05-12 05:56:19.000000000

Patch Set 7:

(2 comments)

Line:31, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyTitleCssPropertyHandler.java -> private static final Map<String, String> cssPropertyToSWTProperty = new HashMap<>();

Line:928, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> Fine for me to handle this via a new bug report. Please open a new bug report to simplify the code for initColours() and this one.

-------------------------------------
author: Sheldon Collins
date: 2017-05-12 05:59:54.000000000

Patch Set 7:

(14 comments)

Line:30, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyListCssPropertyHandler.java -> Done

Line:165, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java -> Done

Line:169, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java -> Done

Line:174, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyTitle.java -> Done

Line:508, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> They are named in accordance with the constants in IFormColors
in addition
h-bottom-keyline-1-color
h-bottom-keyline-2-color
is already used for Forms (see line 341).
So I named the h-gradient* properties in the same scheme (like in IFormColors). So I would like to keep it this way.

Line:519, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> For all of them?. Is there a rule when properties should be prefixed with swt-?

Line:520, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> There are two background colors:
- listBackground-color = the background of the tab itself
- widgetBackground-color = the background of the tab area.

So what about: 
widgetBackground-color => tabAreaBackground-color
listBackground-color =>tabBackground-color
widgetNormalShadow-color => tabNormalShadow-color
widgetDarkShadow-color => tabDarkShadow-color
widgetForeground-color =>foreground-color or simply color

??

Line:523, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> see above.

Line:524, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Done

Line:92, tests/org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/CssSwtTestSuite.java -> Done

Line:31, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyTitleCssPropertyHandler.java -> Done

Line:43, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/css/TabbedPropertyTitleCssPropertyHandler.java -> Done

Line:914, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> Done

Line:922, bundles/org.eclipse.ui.views.properties.tabbed/src/org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPropertyList.java -> Done

-------------------------------------
author: Zaid Mosley
date: 2017-05-12 06:11:46.000000000

Patch Set 7:

(1 comment)

Line:519, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> I think it is good practice to use a custom name space. https://wiki.eclipse.org/E4/CSS/SWT_Mapping

-------------------------------------
author: Zaid Mosley
date: 2017-05-12 06:15:08.000000000

Patch Set 7:

(1 comment)

Line:520, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Sounds good, except that I would also use the swt- prefix.

-------------------------------------
author: Sheldon Collins
date: 2017-05-12 06:16:50.000000000

Patch Set 7:

(1 comment)

Line:519, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> > I think it is good practice to use a custom name space.
 > https://wiki.eclipse.org/E4/CSS/SWT_Mapping

For CTabFikder this pages says:
setBorderVisible(boolean)	border-visible	CTabFolder { border-visible: true }
setMaximized(boolean)	swt-maximized	CTabFolder { swt-maximized: true }
Why does one have the swt-prefix and the other not?

-------------------------------------
author: Zaid Mosley
date: 2017-05-12 08:51:41.000000000

Patch Set 7:

(1 comment)

Line:519, bundles/org.eclipse.ui.themes/css/dark/e4-dark_globalstyle.css -> Either border-visible is a standard CSS property or we forgot in the past to add the swt- prefix.

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