Package org.w3c.dom.css

Examples of org.w3c.dom.css.ElementCSSInlineStyle


        }
    }

    public void setStyleProperty(Element elem,String name,String value)
    {
        ElementCSSInlineStyle elemCSS = (ElementCSSInlineStyle)elem;
        CSSStyleDeclaration elemStyle = elemCSS.getStyle();
        elemStyle.setProperty(name,value,null);
    }
View Full Code Here


        elemStyle.setProperty(name,value,null);
    }

    public void removeStyleProperty(Element elem,String name)
    {
        ElementCSSInlineStyle elemCSS = (ElementCSSInlineStyle)elem;
        CSSStyleDeclaration elemStyle = elemCSS.getStyle();
        elemStyle.removeProperty(name);
    }
View Full Code Here

    public void handleEvent(Event evt)
    {
        Element currTarget = (Element)evt.getCurrentTarget();

        ElementCSSInlineStyle styleElem = (ElementCSSInlineStyle)currTarget;
        CSSStyleDeclaration cssDec = styleElem.getStyle();

        CSSValueList border = (CSSValueList)cssDec.getPropertyCSSValue("border");
        int len = border.getLength();
        String cssText = "";
        for(int i = 0; i < len; i++)
        {
            CSSValue value = border.item(i);
            if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)
            {
                CSSPrimitiveValue primValue = (CSSPrimitiveValue)value;
                if (primValue.getPrimitiveType() == CSSPrimitiveValue.CSS_RGBCOLOR)
                {
                    RGBColor rgb = primValue.getRGBColorValue();
                    log("Current border color: rgb(" + rgb.getRed().getCssText() + "," + rgb.getGreen().getCssText() + "," + rgb.getBlue().getCssText() + ")");
                }
                else cssText += primValue.getCssText() + " ";
            }
            else cssText += value.getCssText() + " ";
        }
        cssDec.setProperty("border",cssText,null); // Removed border color

        CSS2Properties cssDec2 = (CSS2Properties)styleElem.getStyle();
        String newColor = "rgb(255,100,150)";
        cssDec2.setBorderColor(newColor);// border-color property
        log("New border color: " + cssDec2.getBorderColor());
    }
View Full Code Here

    {
        ItsNatDocument itsNatDoc = itsNatRequest.getItsNatDocument();
        Document doc = itsNatDoc.getDocument();
        Element errorElem = doc.getElementById("errorId");
        ItsNatDOMUtil.setTextContent(errorElem,msg);
        ElementCSSInlineStyle errorCSS = (ElementCSSInlineStyle)errorElem;
        CSSStyleDeclaration style = errorCSS.getStyle();
        style.removeProperty("display"); // makes visible
    }
View Full Code Here

        {
            public void handleEvent(Event evt)
            {
                Element currTarget = (Element)evt.getCurrentTarget(); // Link

                ElementCSSInlineStyle styleElem = (ElementCSSInlineStyle)currTarget;
                CSSStyleDeclaration cssDec = styleElem.getStyle();

                CSSValueList border = (CSSValueList)cssDec.getPropertyCSSValue("border");
                int len = border.getLength();
                String cssText = "";
                for(int i = 0; i < len; i++)
                {
                    CSSValue value = border.item(i);
                    if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)
                    {
                        CSSPrimitiveValue primValue = (CSSPrimitiveValue)value;
                        if (primValue.getPrimitiveType() == CSSPrimitiveValue.CSS_RGBCOLOR)
                        {
                            RGBColor rgb = primValue.getRGBColorValue();
                            System.out.println("Current border color: rgb(" + rgb.getRed().getCssText() + "," + rgb.getGreen().getCssText() + "," + rgb.getBlue().getCssText() + ")");
                        }
                        else cssText += primValue.getCssText() + " ";
                    }
                    else cssText += value.getCssText() + " ";
                }
                cssDec.setProperty("border",cssText,null); // Removed border color

                CSS2Properties cssDec2 = (CSS2Properties)styleElem.getStyle();
                String newColor = "rgb(255,100,150)";
                cssDec2.setBorderColor(newColor); // border-color property
                System.out.println("New border color: " + cssDec2.getBorderColor());
            }
View Full Code Here

        decorateSelection(labelElem,selected);
    }

    public void decorateSelection(Element elem,boolean selected)
    {
        ElementCSSInlineStyle elemCSS = (ElementCSSInlineStyle)elem;
        CSSStyleDeclaration elemStyle = elemCSS.getStyle();

        if (selected)
        {
            elemStyle.setProperty("background","rgb(0,0,255)",null);
            elemStyle.setProperty("color","white",null);
View Full Code Here

        }
    }

    public void setStyleProperty(Element elem,String name,String value)
    {
        ElementCSSInlineStyle elemCSS = (ElementCSSInlineStyle)elem;
        CSSStyleDeclaration elemStyle = elemCSS.getStyle();
        elemStyle.setProperty(name,value,null);
    }
View Full Code Here

        elemStyle.setProperty(name,value,null);
    }

    public void removeStyleProperty(Element elem,String name)
    {
        ElementCSSInlineStyle elemCSS = (ElementCSSInlineStyle)elem;
        CSSStyleDeclaration elemStyle = elemCSS.getStyle();
        elemStyle.removeProperty(name);
    }
View Full Code Here

    {
        ItsNatDocument itsNatDoc = itsNatRequest.getItsNatDocument();
        Document doc = itsNatDoc.getDocument();
        Element errorElem = doc.getElementById("errorId");
        ItsNatDOMUtil.setTextContent(errorElem,msg);
        ElementCSSInlineStyle errorCSS = (ElementCSSInlineStyle)errorElem;
        CSSStyleDeclaration style = errorCSS.getStyle();
        style.removeProperty("display"); // makes visible
    }
View Full Code Here

    public void tests()
    {
        HTMLDocument doc = (HTMLDocument)itsNatDoc.getDocument();
        HTMLElement body = doc.getBody();
        ElementCSSInlineStyle elemCSS = (ElementCSSInlineStyle)body;
        CSSStyleDeclaration props = elemCSS.getStyle();
        body.setAttribute("style","color: red ; border: solid 1.5px ; clip: rect( 1px 2in 3cm 4 ); border-color: #aabbcc; width: 50%; anytext: \"hello guy\" ");

        CSSPrimitiveValue color = (CSSPrimitiveValue)props.getPropertyCSSValue("color");
        TestUtil.checkError(color.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT);
        TestUtil.checkError(color.getStringValue().equals("red"));
View Full Code Here

TOP

Related Classes of org.w3c.dom.css.ElementCSSInlineStyle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.