Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Mayer2016-05-10 16:33:51 +0000
committerAndreas Mayer2016-05-11 08:04:30 +0000
commit19ed239d114d195c2fa0637936fc1e0184bded1d (patch)
tree2a1cb3189d4b0e3b7d3ec7a850a979c70cc31e44
parentc9f7fb1bd7a0d197e15fd4bb11d30796e938d3e1 (diff)
downloadeclipse.platform.ui-19ed239d114d195c2fa0637936fc1e0184bded1d.tar.gz
eclipse.platform.ui-19ed239d114d195c2fa0637936fc1e0184bded1d.tar.xz
eclipse.platform.ui-19ed239d114d195c2fa0637936fc1e0184bded1d.zip
Bug 493361 - Fix preference page for color definitions with defaultsTo
isAvailableInCurrentTheme(ThemeElementDefinition) now correctly handles color definitions that use another definition as default instead of defining their own value. Change-Id: I72bdb76254dcbd041292185239b457ed984dfeac Signed-off-by: Andreas Mayer <anma-e@gmx.de>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
index 5459575abd3..2e5ffa2c929 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/themes/ColorsAndFontsPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2015 IBM Corporation and others.
+ * Copyright (c) 2003, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2218,9 +2218,12 @@ getPreferenceStore(),
private boolean isAvailableInCurrentTheme(ThemeElementDefinition definition) {
if (definition instanceof ColorDefinition) {
- RGB value = ((ColorDefinition) definition).getValue();
- return value != null && value != EMPTY_COLOR_VALUE
- && colorRegistry.get(definition.getId()) != null;
+ ColorDefinition colorDef = (ColorDefinition) definition;
+ RGB value = colorDef.getValue();
+ if ((value == null || value == EMPTY_COLOR_VALUE) && colorDef.getDefaultsTo() == null) {
+ return false;
+ }
+ return colorRegistry.get(definition.getId()) != null;
}
return true;
}

Back to the top