Package org.itsnat.core.domutil

Examples of org.itsnat.core.domutil.ElementTable


        ItsNatDocument itsNatDoc = getItsNatDocument();
        Document doc = itsNatDoc.getDocument();

        Element parent = doc.getElementById(tableId);
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable elemTable = factory.createElementTable(parent,true,customStructure,customRenderer);
        elemTable.setColumnCount(3);
        elemTable.addRow(new String[] {"Madrid","Plaza Mayor","Palacio Real"});
        elemTable.addRow(new String[] {"Sevilla","Plaza de Espa�a","Giralda"});
        elemTable.addRow(new String[] {"Segovia","Plaza del Azoguejo","Acueducto Romano"});
    }
View Full Code Here


        ItsNatDocument itsNatDoc = null;
        Document doc = itsNatDoc.getDocument();

        Element parent = doc.getElementById("tableId");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable elemTable = factory.createElementTable(parent,true);
        elemTable.setColumnCount(3);
        elemTable.addRow(new String[] {"Madrid","Plaza Mayor","Palacio Real"});
        elemTable.addRow(new String[] {"Sevilla","Plaza de Espa�a","Giralda"});
        elemTable.addRow(new String[] {"Segovia","Plaza del Azoguejo","Acueducto Romano"});
    }
View Full Code Here

            }
        };

        Element parent = doc.getElementById("tableId2");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable elemTable = factory.createElementTable(parent,true,null,customRenderer);

    }
View Full Code Here

            }
        };

        Element parent = doc.getElementById("tableId3");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable elemTable = factory.createElementTable(parent,true,customStructure,customRenderer);

    }
View Full Code Here

        ItsNatDocument itsNatDoc = null;
        Document doc = itsNatDoc.getDocument();

        Element parent = doc.getElementById("tableId4");
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable elemTable = factory.createElementTable(parent,true);
    }
View Full Code Here

    public void initTable(String tableId)
    {
        Document doc = itsNatDoc.getDocument();
        Element tableParent = doc.getElementById(tableId);
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable table = factory.createElementTable(tableParent,false);

        TestUtil.checkError(table.getColumnCount() == 2);

        // En este ejemplo nos basamos en las filas y columnas originales y a�adimos m�s,
        // el patr�n de las 2 primeras celdas de la primera fila se conservar�
        table.addColumn()// El patr�n ser� el del primer elemento (el 0,0 o 1,1 visualmente)
        table.addRow(new String[]{"Item 2,1","Item 2,2","Item 2,3"});
        table.addRow(new String[]{"Item 3,1","Item 3,2","Item 3,3"});

        TestUtil.checkError(table.getRowCount() == 3);
    }
View Full Code Here

    public void initTable(String tableId,ElementTableStructure structure)
    {
        Document doc = itsNatDoc.getDocument();
        Element tableParent = doc.getElementById(tableId);
        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementTable table = factory.createElementTable(tableParent,true,structure,null);

        table.removeAllColumns();
        // table.removeAllRows();
        table.addColumn(); // Se a�ade al patr�n pues no hay filas
        table.addColumn(); // "
        table.addRow(new String[]{"Item 0,0","Item 0,1"}); // Fila con dos columnas
        table.addRow(new String[]{"Item 1,0","Item 1,1"}); // "
        table.addColumn(                  new String[]{"Item 0,2","Item 1,2"}); // A�ade una columna a las dos filas
        table.addRow(new String[]{"Item 2,0","Item 2,1","Item 2,2"}); // Nueva fila con tres columnas
        TestUtil.checkError(table.getColumnCount() == 3);
        TestUtil.checkError(table.getRowCount() == 3);
        TestUtil.checkError(table.getCellElementAt(2,2) != null);

        table.setUsePatternMarkupToRender(true);
        table.setCellValueAt(0,0,"BAD Item 0,0");
        table.setCellValueAt(0,0,"Item 0,0");

        Element cellElem0 = table.getCellElementAt(0,0);
        Element cellElem1 = table.getCellElementAt(1,0);
        Element cellElem2 = table.getCellElementAt(2,0);
        table.moveRow(0,1,1); // Desplaza las dos primeras filas a ser las dos finales
        TestUtil.checkError(table.getCellElementAt(0,0) == cellElem2);
        TestUtil.checkError(table.getCellElementAt(1,0) == cellElem0);
        TestUtil.checkError(table.getCellElementAt(2,0) == cellElem1);
        table.moveRow(1,2,0); // Las deja como estaba
        TestUtil.checkError(table.getCellElementAt(0,0) == cellElem0);
        TestUtil.checkError(table.getCellElementAt(1,0) == cellElem1);
        TestUtil.checkError(table.getCellElementAt(2,0) == cellElem2);
        TestUtil.checkError(table.getRowCount() == 3);


        Element colElem = table.getCellElementAt(0,0);
        table.moveColumn(0,2);
        TestUtil.checkError(table.getCellElementAt(0,2) == colElem);
        table.moveColumn(2,0); // La dejamos en su sitio de nuevo
        TestUtil.checkError(table.getCellElementAt(0,0) == colElem);
        TestUtil.checkError(table.getColumnCount() == 3);

        table.setColumnCount(5);
        TestUtil.checkError(table.getColumnCount() == 5);

        table.setColumnCount(3); // restauramos quitando las dos �ltimas
        TestUtil.checkError(table.getColumnCount() == 3);

        table.setRowCount(5);
        TestUtil.checkError(table.getRowCount() == 5);

        table.setRowCount(3); // restauramos quitando las dos �ltimas
        TestUtil.checkError(table.getRowCount() == 3);
    }
View Full Code Here

TOP

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

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.