Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe2010-11-10 23:00:59 +0000
committerBogdan Gheorghe2010-11-10 23:00:59 +0000
commit4c16a238913b434d2b27fbeaf02c0bb523068682 (patch)
tree1c9036f0c2dcd189334766bcf259d0e09541a801 /bundles/org.eclipse.e4.ui.css.swt/src/org
parent7d2f7e21a647e36c8e23b05e114703699a4b5758 (diff)
downloadeclipse.platform.ui-4c16a238913b434d2b27fbeaf02c0bb523068682.tar.gz
eclipse.platform.ui-4c16a238913b434d2b27fbeaf02c0bb523068682.tar.xz
eclipse.platform.ui-4c16a238913b434d2b27fbeaf02c0bb523068682.zip
329961 - [CSS] Add tab outline color property for e4 renderer
Diffstat (limited to 'bundles/org.eclipse.e4.ui.css.swt/src/org')
-rw-r--r--bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertye4TabOutline.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertye4TabOutline.java b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertye4TabOutline.java
new file mode 100644
index 00000000000..7fc567e523e
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/custom/CSSPropertye4TabOutline.java
@@ -0,0 +1,36 @@
+package org.eclipse.e4.ui.css.swt.properties.custom;
+
+import java.lang.reflect.Method;
+import org.eclipse.e4.ui.widgets.CTabFolder;
+import org.eclipse.e4.ui.widgets.CTabFolderRenderer;
+import org.eclipse.swt.graphics.Color;
+
+import org.eclipse.e4.ui.css.core.engine.CSSEngine;
+import org.eclipse.swt.widgets.Control;
+import org.w3c.dom.css.CSSValue;
+
+import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
+
+public class CSSPropertye4TabOutline extends AbstractCSSPropertySWTHandler {
+
+ @Override
+ protected void applyCSSProperty(Control control, String property,
+ CSSValue value, String pseudo, CSSEngine engine) throws Exception {
+ if (!(control instanceof CTabFolder)) return;
+ if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
+ Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay());
+ CTabFolderRenderer renderer = ((CTabFolder) control).getRenderer();
+ if (renderer == null) return;
+ Method m = renderer.getClass().getMethod("setTabOutline", new Class[]{Color.class});
+ m.invoke(renderer, newColor);
+ }
+ }
+
+ @Override
+ protected String retrieveCSSProperty(Control control, String property,
+ String pseudo, CSSEngine engine) throws Exception {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}

Back to the top