Package org.itsnat.core.domutil

Examples of org.itsnat.core.domutil.ElementTableFree


    public void initTable()
    {
        Document doc = itsNatDoc.getDocument();
        Element tableParent = doc.getElementById("tableFreeSlaveId");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTableFree table = factory.createElementTableFree(tableParent,false);

        tableParent.appendChild(createRow(doc,0));
        tableParent.appendChild(createRow(doc,1));
        tableParent.appendChild(createRow(doc,2));

        TestUtil.checkError(table.getRowCount() == 3);

        tableParent.removeChild(table.getRowElementAt(1));
        tableParent.insertBefore(createRow(doc,1),table.getRowElementAt(1)); // Insertamos de nuevo

        TestUtil.checkError(table.getRowCount() == 3);

        // En las siguientes sentencias no se opera directamente con el DOM
        // pero simplemente para ver si funcionan en modo slave
        testShared(table,doc);
    }
View Full Code Here


    {
        ItsNatDocument itsNatDoc = null;
        Document doc = itsNatDoc.getDocument();
        Element tableParent = doc.getElementById("elementTableId");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTableFree table = factory.createElementTableFree(tableParent,true);

        Element rowElem;
        Element cellElem;

        rowElem = doc.createElement("div");

            cellElem = doc.createElement("span");
            cellElem.appendChild(doc.createTextNode("Cell 0,0"));
            rowElem.appendChild(cellElem);

            cellElem = doc.createElement("span");
            cellElem.appendChild(doc.createTextNode("Cell 0,1"));
            rowElem.appendChild(cellElem);

        table.addRow(rowElem);

        rowElem = doc.createElement("div");

            cellElem = doc.createElement("span");
            cellElem.appendChild(doc.createTextNode("Cell 1,0"));
            rowElem.appendChild(cellElem);

            cellElem = doc.createElement("span");
            cellElem.appendChild(doc.createTextNode("Cell 1,1"));
            rowElem.appendChild(cellElem);

        table.addRow(rowElem);
    }
View Full Code Here

    public void initTable()
    {
        Document doc = itsNatDoc.getDocument();
        Element tableParent = doc.getElementById("tableFreeMasterId");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTableFree table = factory.createElementTableFree(tableParent,true);

        table.addRow(createRow(doc,0));
        table.addRow(createRow(doc,1));
        table.addRow(createRow(doc,2));

        TestUtil.checkError(table.getRowCount() == 3);

        table.removeRowAt(1);
        table.insertRowAt(1,createRow(doc,1)); // Insertamos de nuevo

        TestUtil.checkError(table.getRowListElementInfoAt(2).getIndex() == 2); // para ver si se ha actualizado bien

        TestUtil.checkError(table.getRowCount() == 3);

        testShared(table,doc);
    }
View Full Code Here

TOP

Related Classes of org.itsnat.core.domutil.ElementTableFree

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.