Package org.w3c.dom.html

Examples of org.w3c.dom.html.HTMLElement


    }

    public void initTable()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement tableElem = (HTMLElement)doc.getElementById("freeTableId2");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatFreeTable comp = (ItsNatFreeTable)componentMgr.findItsNatComponent(tableElem);
        initTable(comp,"addRowFreeTableId2","removeRowFreeTableId2","joystickModeFreeTableId2");
    }
View Full Code Here


    }

    public void initCombo()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement parentElem = (HTMLElement)doc.getElementById("freeComboId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.combo = (ItsNatFreeComboBox)componentMgr.findItsNatComponent(parentElem);

        combo.addEventListener("click",this);
View Full Code Here

    }

    public void init(String id)
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement elem = (HTMLElement)doc.getElementById(id);
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.button = (ItsNatFreeCheckBox)componentMgr.findItsNatComponent(elem);

        ToggleButtonModel dataModel = new ToggleButtonModel();
        button.setButtonModel(dataModel);
View Full Code Here

    }

    public void initTable()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement tableElem = (HTMLElement)doc.getElementById("freeTableId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatFreeTable comp = (ItsNatFreeTable)componentMgr.findItsNatComponent(tableElem);
        initTable(comp,"addRowFreeTableId","removeRowFreeTableId","joystickModeFreeTableId");
    }
View Full Code Here

    }

    public void initListMultiple()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement parentElem = (HTMLElement)doc.getElementById("freeListMultipleId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.comp = (ItsNatFreeListMultSel)componentMgr.findItsNatComponent(parentElem);

        super.initListMultiple();
View Full Code Here


    public ItsNatLabel getItsNatLabel(String id)
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement labelElem = (HTMLElement)doc.getElementById(id);
        ItsNatHTMLComponentManager componentMgr = itsNatDoc.getItsNatHTMLComponentManager();
        return (ItsNatLabel)componentMgr.findItsNatComponent(labelElem);
    }
View Full Code Here

        // El S60WebKit (FP 1) mueve los <style> bajo <body> a <head>
        // Sabemos que en este contexto los mutation events est�n desactivados

        HTMLHeadElement head = DOMUtilHTML.getHTMLHead(doc);
        replaceComments(head,"style");
        HTMLElement body = doc.getBody();
        replaceComments(body,"span");

        return !comments.isEmpty(); // Si false es que no hay ningun comentario, no se ha hecho nada
    }
View Full Code Here

    }

    public void initListMultiple()
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement parentElem = (HTMLElement)doc.getElementById("freeListMultipleId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.comp = (ItsNatFreeListMultSel)componentMgr.createItsNatComponent(parentElem);
        comp.setJoystickMode(true);

        super.initListMultiple();
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"));
        color.setStringValue(CSSPrimitiveValue.CSS_IDENT," blue ");
        TestUtil.checkError(color.getStringValue().equals("blue"));
        color.setCssText(" red "); // Restauramos el valor original

        CSSValue border = props.getPropertyCSSValue("border");
        TestUtil.checkError(border.getCssValueType() == CSSValue.CSS_VALUE_LIST);
        CSSValueList borderList = (CSSValueList)border;
        TestUtil.checkError(borderList.getLength() == 2);

        CSSPrimitiveValue borderType = (CSSPrimitiveValue)borderList.item(0);
        TestUtil.checkError(borderType.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT);
        TestUtil.checkError(borderType.getStringValue().equals("solid"));
        borderType.setStringValue(CSSPrimitiveValue.CSS_IDENT,"dotted");
        TestUtil.checkError(borderType.getStringValue().equals("dotted"));
        TestUtil.checkError(body.getAttribute("style").equals("color: red ;border:dotted 1.5px;clip: rect( 1px 2in 3cm 4 );border-color: #aabbcc;width: 50%;anytext: \"hello guy\" "));
        borderType.setStringValue(CSSPrimitiveValue.CSS_IDENT,"solid"); // restaurar

        CSSPrimitiveValue borderWidth = (CSSPrimitiveValue)borderList.item(1);
        TestUtil.checkError(borderWidth.getPrimitiveType() == CSSPrimitiveValue.CSS_PX);
        TestUtil.checkError(borderWidth.getFloatValue(CSSPrimitiveValue.CSS_PX) == 1.5);
        borderWidth.setFloatValue(CSSPrimitiveValue.CSS_IN,(float)2.5);
        TestUtil.checkError(borderWidth.getPrimitiveType() == CSSPrimitiveValue.CSS_IN);
        TestUtil.checkError(borderWidth.getFloatValue(CSSPrimitiveValue.CSS_IN) == 2.5);
        borderWidth.setFloatValue(CSSPrimitiveValue.CSS_PX,(float)1.5); // Restaurar

        CSSValue clip = props.getPropertyCSSValue("clip");
        TestUtil.checkError(clip.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE);
        CSSPrimitiveValue clipValue = (CSSPrimitiveValue)clip;
        Rect clipRect = clipValue.getRectValue();
        CSSPrimitiveValue top = clipRect.getTop();
        TestUtil.checkError(top.getPrimitiveType() == CSSPrimitiveValue.CSS_PX);
        TestUtil.checkError(top.getFloatValue(CSSPrimitiveValue.CSS_PX) == 1);
        top.setFloatValue(CSSPrimitiveValue.CSS_IN,(float)3.5);
        TestUtil.checkError(top.getPrimitiveType() == CSSPrimitiveValue.CSS_IN);
        TestUtil.checkError(top.getFloatValue(CSSPrimitiveValue.CSS_IN) == 3.5);
        TestUtil.checkError(body.getAttribute("style").equals("color: red ;border:solid 1.5px;clip:rect(3.5in,2in,3cm,4);border-color: #aabbcc;width: 50%;anytext: \"hello guy\" "));
        top.setFloatValue(CSSPrimitiveValue.CSS_PX,(float)1); // restaurar

        // HACER test de valores: #rgb y #rrggbb
        CSSPrimitiveValue borderColor = (CSSPrimitiveValue)props.getPropertyCSSValue("border-color");
        CSSPrimitiveValue red = borderColor.getRGBColorValue().getRed();
        TestUtil.checkError(red.getCssText().equals("170"))// aa
        CSSPrimitiveValue green = borderColor.getRGBColorValue().getGreen();
        TestUtil.checkError(green.getCssText().equals("187"))// bb
        CSSPrimitiveValue blue = borderColor.getRGBColorValue().getBlue();
        TestUtil.checkError(blue.getCssText().equals("204"))// cc


        CSSPrimitiveValue width = (CSSPrimitiveValue)props.getPropertyCSSValue("width");
        TestUtil.checkError(width.getPrimitiveType() == CSSPrimitiveValue.CSS_PERCENTAGE);
        TestUtil.checkError(width.getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) == 50);
        width.setFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE,(float)25);
        TestUtil.checkError(width.getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) == 25);
        TestUtil.checkError(width.getCssText().equals("25.0%"));
        width.setCssText(" 50%"); // Restauramos el valor original


        CSSPrimitiveValue anytext = (CSSPrimitiveValue)props.getPropertyCSSValue("anytext");
        TestUtil.checkError(anytext.getStringValue().equals("hello guy"));
        anytext.setStringValue(CSSPrimitiveValue.CSS_STRING,"hello girl");
        TestUtil.checkError(anytext.getStringValue().equals("hello girl"));
        TestUtil.checkError(anytext.getCssText().equals("\"hello girl\""));

        body.removeAttribute("style");
    }
View Full Code Here

        }
        else if (currTarget == addItemElem)
        {
            Document doc = itsNatDoc.getDocument();
            HTMLCollection col = selectElem.getOptions();
            HTMLElement option;

            HTMLElement firstOpt = (HTMLElement)col.item(0); // puede ser null
            option = (HTMLElement)doc.createElement("option");
            option.appendChild(doc.createTextNode(Integer.toString(col.getLength())));
            selectElem.add(option, firstOpt);

            option = (HTMLElement)doc.createElement("option");
View Full Code Here

TOP

Related Classes of org.w3c.dom.html.HTMLElement

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.