Package org.w3c.dom.html

Examples of org.w3c.dom.html.HTMLElement


    }

    private HTMLElement insertElement(int index,String localName,boolean recursive,LinkedList<Node> children)
    {
        if (index < 0) throw new DOMException(DOMException.INDEX_SIZE_ERR,"Index is negative");
        HTMLElement newElem = (HTMLElement)getOwnerDocument().createElementNS(NamespaceUtil.XHTML_NAMESPACE,localName);
        if (children == null) children = getChildrenArray(localName,recursive);
        if (children != null)
        {
            if (index > children.size()) throw new DOMException(DOMException.INDEX_SIZE_ERR,"Index " + index + " is greater than the number of rows: " + children.size());
            HTMLElement elemRef = (HTMLElement)children.get(index);
            insertBefore(newElem,elemRef); // elemRef puede ser null (a�adir al final)
        }
        else  // No hay elementos
        {
            appendChild(newElem);
View Full Code Here


    {
        if (index < 0) throw new DOMException(DOMException.INDEX_SIZE_ERR,"Index is negative");
        if (children != null)
        {
            if (index >= children.size()) throw new DOMException(DOMException.INDEX_SIZE_ERR,"Index " + index + " is equal or greater than the number of rows: " + children.size());
            HTMLElement elem = (HTMLElement)children.get(index);
            removeChild(elem);
        }
        else throw new DOMException(DOMException.INDEX_SIZE_ERR,"Index " + index + " is equal or greater than the number of rows: 0");
    }
View Full Code Here

                boolean hasTBody = (ItsNatTreeWalker.getFirstChildElementWithTagNameNS(table,NamespaceUtil.XHTML_NAMESPACE,"tbody") != null);

                if (!hasTBody)
                {
                    // No tiene TBODY, a�adimos (suponemos que tampoco hay un THEAD etc)
                    HTMLElement tbody = (HTMLElement)doc.createElementNS(NamespaceUtil.XHTML_NAMESPACE,"tbody");
                    // Soportamos la existencia de COLGROUP antes del primer TR, a partir del primer TR
                    // copiaremos todos los nodos que siguen al primer TR bajo TBODY
                    Node child = ItsNatTreeWalker.getFirstChildElementWithTagNameNS(table,NamespaceUtil.XHTML_NAMESPACE,"tr");
                    while(child != null)
                    {
                        Node next = child.getNextSibling();
                        tbody.appendChild(child); // lo quita tambi�n de table
                        child = next;
                    }
                    table.appendChild(tbody);
                }
            }
View Full Code Here

        List<Person> model = new ArrayList<Person>();
        model.add(new Person("John","Smith"));
        model.add(new Person("Bill","Clinton"));

        Document doc = itsNatDoc.getDocument();
        HTMLElement parentElem = (HTMLElement)doc.getElementById("freeListCompoundId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.comp = (ItsNatFreeListMultSel)componentMgr.findItsNatComponent(parentElem);

        DefaultListModel dataModel = new DefaultListModel();
View Full Code Here

    }

    public void load() throws PropertyVetoException
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLElement elem = (HTMLElement)doc.getElementById("labelId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLLabel comp = (ItsNatHTMLLabel)componentMgr.findItsNatComponent(elem);

        comp.setValue(null); // Para probar
        String text = "Label Test";
View Full Code Here

    }

    public void load() throws PropertyVetoException
    {
        org.w3c.dom.Document doc = itsNatDoc.getDocument();
        HTMLElement elem = (HTMLElement)doc.getElementById("freeLabelId");
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatFreeLabel comp = (ItsNatFreeLabel)componentMgr.findItsNatComponent(elem);

        String text = "Free Label Test";
        comp.setValue(text);
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 = (ItsNatFreeButtonNormal)componentMgr.findItsNatComponent(elem);

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

        code = null;
       
        // Es necesario acceder a las tripas de ItsNat para asegurarnos que no est� cacheado
        // pues necesitamos forzar la b�squeda del <body> via path tras la inserci�n del intruso,
        // de otra manera este test no sirve para nada
        HTMLElement body = itsNatDoc.getHTMLDocument().getBody();
        ClientDocumentStfulImpl clientDoc = (ClientDocumentStfulImpl)itsNatDoc.getClientDocumentOwner();
        clientDoc.removeNodeFromCacheAndSendCode(body);
        // Nos aseguramos
        NodeCacheRegistryImpl nodeCache = clientDoc.getNodeCacheRegistry();
        if (nodeCache.getId(body) != null) throw new RuntimeException("Unexpected Error");
View Full Code Here

    }

    public void initTree(String treeId,String addButtonId,String removeButtonId,String reloadButtonId,String joystickCheckboxId)
    {
        Document doc = itsNatDoc.getDocument();
        HTMLElement rootElem = (HTMLElement)doc.getElementById(treeId);
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
        this.comp = (ItsNatFreeTree)componentMgr.findItsNatComponent(rootElem);

        comp.setToggleClickCount(2);
View Full Code Here

    public void init(String id)
    {
        Document doc = itsNatDoc.getDocument();
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();

        HTMLElement elem1 = (HTMLElement)doc.getElementById(id + "1");
        this.radioComp1 = (ItsNatFreeRadioButton)componentMgr.findItsNatComponent(elem1);

        HTMLElement elem2 = (HTMLElement)doc.getElementById(id + "2");
        this.radioComp2 = (ItsNatFreeRadioButton)componentMgr.findItsNatComponent(elem2);

        HTMLElement elem3 = (HTMLElement)doc.getElementById(id + "3");
        this.radioComp3 = (ItsNatFreeRadioButton)componentMgr.findItsNatComponent(elem3);

        ToggleButtonModel dataModel1 = new ToggleButtonModel();
        radioComp1.setButtonModel(dataModel1);
        ToggleButtonModel dataModel2 = new ToggleButtonModel();
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.