Package org.itsnat.comp.table

Examples of org.itsnat.comp.table.ItsNatHTMLTableUI


    {
        if (row < 0) return;
        TableModel dataModel = tableComp.getTableModel();
        if (row >= dataModel.getRowCount()) return;

        ItsNatHTMLTableUI tableUI = tableComp.getItsNatHTMLTableUI();
        int first = getFirstContiguousEqual(row,0,dataModel);
        if (first == -1)
            first = row;

        int last = getLastContiguousEqual(first,0,dataModel);
        if (last == -1)
            last = first;
        int rowSpan = last - first + 1;

        HTMLTableCellElement cell = tableUI.getHTMLTableCellElementAt(first,0);
        if (cell.getParentNode() == null)
        {
            HTMLTableCellElement cellNext = tableUI.getHTMLTableCellElementAt(first, 1 );
            cellNext.getParentNode().insertBefore(cell,cellNext);
        }

        if (rowSpan > 1)
            cell.setAttribute("rowspan",Integer.toString(rowSpan));
        else if (cell.hasAttribute("rowspan"))
            cell.removeAttribute("rowspan");

        if (first != last)
        {
            for(int i = first + 1; i <= last; i++)
            {
                cell = tableUI.getHTMLTableCellElementAt(i,0);
                if (cell.getParentNode() != null)
                    cell.getParentNode().removeChild(cell);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.itsnat.comp.table.ItsNatHTMLTableUI

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.