Search in sources :

Example 1 with ElementCSSInlineStyle

use of org.w3c.dom.css.ElementCSSInlineStyle in project webtools.sourceediting by eclipse.

the class BUG124835SetStyleAttributeValueTest method setInlineStyle.

private void setInlineStyle(Element element, String name, String value) {
    ICSSStyleDeclaration decl = null;
    try {
        decl = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
    } catch (ClassCastException ex) {
    // do nothing
    }
    if (decl != null) {
        String priority = decl.getPropertyPriority(name);
        decl.setProperty(name, value, priority);
    }
}
Also used : ElementCSSInlineStyle(org.w3c.dom.css.ElementCSSInlineStyle) ICSSStyleDeclaration(org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration)

Example 2 with ElementCSSInlineStyle

use of org.w3c.dom.css.ElementCSSInlineStyle in project webtools.sourceediting by eclipse.

the class BUG124835SetStyleAttributeValueTest method getInlineStyle.

private String getInlineStyle(Element element, String name) {
    String value = null;
    ICSSStyleDeclaration decl = null;
    try {
        decl = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
    } catch (ClassCastException ex) {
    // do nothing
    }
    if (decl != null) {
        value = decl.getPropertyValue(name);
    }
    return value;
}
Also used : ElementCSSInlineStyle(org.w3c.dom.css.ElementCSSInlineStyle) ICSSStyleDeclaration(org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration)

Aggregations

ICSSStyleDeclaration (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration)2 ElementCSSInlineStyle (org.w3c.dom.css.ElementCSSInlineStyle)2