DESCRIPTION

Bug 516533 - Bug: isEditable="false" colors/fonts can still be edited if
referenced by other colors

Fix to address the  bug report.

1) ThemeElementHelper
Changes here ensure that default is loaded if isEditable=false is set,
rather
than user's previous preference, avoiding a uneditable color situation.

2) ColorsAndFontsPreferencePage
Changes here gray out "Edit Default" and "Go to Default" if
default has isEditable=false set (and is thus not visible).

Test strategy:
- Open Child eclipse
- In "Colors and Fonts" under "Basic", change "Information Background
color" to something else.
- Close child eclipse
- Cherry pick the patch that makes HOVER_ colors not editable:
  https://git.eclipse.org/r/#/c/96889/
- Open child eclipse. Observe issues:
  * Javadoc Background is set to previous "Information" colors,
  * Javadoc Background can edit it's default
  * Javadoc Background has the "go to default" button, that does
nothing.
- Close child eclipse. Cherry pick this fix. Open child Eclipse.
- Observe:
  * Javadoc Background has background of default "Information"
  * Javadoc background's "edit default" and "goto default" buttons
    are grayed out.
  * User can edit Javadoc Background and resetting it resets it to
    "Information" default color.

The logic was copied for Font Definitions. For testing purposes, the
following fonts can be used:
* Basic -> "Text font" (as the default which is to be hidden with patch
above).
* Java -> "Java Editor Text Font" (as the font that references the
default"

Note for tester: There is a slight difference between FontDefintions and
ColorDefinitions.
ColorDefinitions must have either have a value or a 'defaultsTo'.
FontDefinitiosn can be left blank without a value or defaultsTo. So
subsequently
if a font references another one (Java->Basic), if the default is hidden
via isEditable=false, then the reference color (e.g Java's), doesn't
automatically reset back to the default of the original (basic)
font and instead shows "Overrides", because default has no actual value.
However, you can still click on "reset" on it (Java), and it'll reset to
the default (Basic). This is a very small detail and I don't expect it
to be a problem (or even noticeable) by anyone.

Change-Id: Ifa08bf267263642365a636e057a2de67641bc138
Signed-off-by: Natalia Golden xxx@xxx.xxx


COMMENTS

author: Natalia Golden
date: 2017-05-11 20:28:59.000000000

Uploaded patch set 1.

-------------------------------------
author: Natalia Golden
date: 2017-05-11 20:36:14.000000000

Patch Set 1: Code-Review+1

@Dani, when you have time, please kindly review. This is needed for the api color patch to work properly. Which is needed by bunch of the other color fixes...

-------------------------------------
author: Brenden Conley
date: 2017-05-11 20:52:49.000000000

Patch Set 1:

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

-------------------------------------
author: Natalia Golden
date: 2017-05-11 20:54:52.000000000

Patch Set 1:

For 4.7.1 I think...

-------------------------------------
author: Brenden Conley
date: 2017-05-11 21:23:10.000000000

Patch Set 1: Verified+1

Build Successful 

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

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