Example usage for org.w3c.dom.css CSSValue CSS_VALUE_LIST

List of usage examples for org.w3c.dom.css CSSValue CSS_VALUE_LIST

Introduction

In this page you can find the example usage for org.w3c.dom.css CSSValue CSS_VALUE_LIST.

Prototype

short CSS_VALUE_LIST

To view the source code for org.w3c.dom.css CSSValue CSS_VALUE_LIST.

Click Source Link

Document

The value is a CSSValue list and an instance of the CSSValueList interface can be obtained by using binding-specific casting methods on this instance of the CSSValue interface.

Usage

From source file:org.akrogen.tkui.css.swt.properties.css2.CSSPropertyBackgroundSWTHandler.java

@Override
public void applyCSSPropertyBackgroundColor(Object element, CSSValue value, String pseudo, CSSEngine engine)
        throws Exception {
    Control control = (Control) element;
    if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
        Color newColor = (Color) engine.convert(value, Color.class, control.getDisplay());
        if (control instanceof CTabFolder && "selected".equals(pseudo)) {
            ((CTabFolder) control).setSelectionBackground(newColor);
        } else {/*from   w w  w.ja va 2s .  co  m*/
            control.setBackground(newColor);
        }
    } else if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
        Gradient grad = (Gradient) engine.convert(value, Gradient.class, control.getDisplay());
        GradientBackgroundListener.handle(control, grad);
    }
}