Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4')
-rw-r--r--bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java
index 7c1b92aa659..ddd420e77ef 100644
--- a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java
+++ b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/helpers/CSSSWTColorHelper.java
@@ -23,8 +23,6 @@ import org.eclipse.e4.ui.css.core.css2.CSS2ColorHelper;
import org.eclipse.e4.ui.css.core.css2.CSS2RGBColorImpl;
import org.eclipse.e4.ui.css.core.dom.properties.Gradient;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
-import org.eclipse.e4.ui.css.core.resources.CSSResourcesHelpers;
-import org.eclipse.e4.ui.css.core.resources.IResourcesRegistry;
import org.eclipse.e4.ui.internal.css.swt.CSSActivator;
import org.eclipse.e4.ui.internal.css.swt.definition.IColorAndFontProvider;
import org.eclipse.swt.SWT;
@@ -236,16 +234,17 @@ public class CSSSWTColorHelper {
return gradient;
}
- public static Color[] getSWTColors(Gradient grad, Display display, CSSEngine engine) {
+ @SuppressWarnings("rawtypes")
+ public static Color[] getSWTColors(Gradient grad, Display display,
+ CSSEngine engine) throws Exception {
List values = grad.getValues();
- IResourcesRegistry registry = engine.getResourcesRegistry();
Color[] colors = new Color[values.size()];
for (int i = 0; i < values.size(); i++) {
CSSPrimitiveValue value = (CSSPrimitiveValue) values.get(i);
//We rely on the fact that when a gradient is created, it's colors are converted and in the registry
//TODO see bug #278077
- Color color = (Color) registry.getResource(Color.class, CSSResourcesHelpers.getCSSPrimitiveValueKey(value));
+ Color color = (Color) engine.convert(value, Color.class, display);
colors[i] = color;
}
return colors;

Back to the top