Package org.odftoolkit.odfdom.doc.table

Examples of org.odftoolkit.odfdom.doc.table.OdfTableRow


                    if (nextRow > lastRow) {
                        return null;
                    }

                    List<Object> cells = new ArrayList<Object>();
                    OdfTableRow row = table.getRowByIndex(nextRow++);
                    if (row != null) {
                        int lastCell = row.getCellCount();
                        for (int cellIndex = 0; cellIndex <= lastCell; cellIndex++) {
                            Cell cell = null;

                            OdfTableCell sourceCell = row.getCellByIndex(cellIndex);
                            if (sourceCell != null) {
                                cell = extractCell(sourceCell, reconMap);
                            }
                            cells.add(cell);
                        }
View Full Code Here


            public void endFile() {
            }

            @Override
            public void addRow(List<CellData> cells, boolean isHeader) {
                OdfTableRow r = table.appendRow();
                //rowCount++;
               
                for (int i = 0; i < cells.size(); i++) {
                    OdfTableCell c = r.getCellByIndex(i); // implicitly creates cell
                    CellData cellData = cells.get(i);

                    if (cellData != null && cellData.text != null && cellData.value != null) {
                        Object v = cellData.value;
                        if (v instanceof Number) {
View Full Code Here

  @Override
  public void visit(TableTableElement ele) {
    OdfTable table = OdfTable.getInstance(ele);
    List<OdfTableRow> rowlist = table.getRowList();
    for (int i = 0; i < rowlist.size(); i++) {
      OdfTableRow row = rowlist.get(i);
      for (int j = 0; j < row.getCellCount(); j++) {
        mTextBuilder.append(row.getCellByIndex(j).getDisplayText()).append(TabChar);
      }
      mTextBuilder.append(NewLineChar);
    }
  }
View Full Code Here

      */

      OdfTable oTable = oDoc.getTableByName("SamplesTable");

      for (Sample s : samples) {
        OdfTableRow row = oTable.appendRow();

        OdfTableCell cell0 = row.getCellByIndex(0);
        OdfTextParagraph cp0 = new OdfTextParagraph(contentDom);
        cp0.setTextContent(s.getAlias());
        cp0.setProperty(StyleTextPropertiesElement.FontSize, "8pt");
        cell0.getOdfElement().appendChild(cp0);

        OdfTableCell cell1 = row.getCellByIndex(1);
        OdfTextParagraph cp1 = new OdfTextParagraph(contentDom);
        cp1.setTextContent(s.getScientificName());
        cp1.setProperty(StyleTextPropertiesElement.FontSize, "8pt");
        cell1.getOdfElement().appendChild(cp1);

        OdfTableCell cell2 = row.getCellByIndex(2);
        OdfTextParagraph cp2 = new OdfTextParagraph(contentDom);
        cp2.setTextContent(s.getIdentificationBarcode());
        cp2.setProperty(StyleTextPropertiesElement.FontSize, "8pt");
        cell2.getOdfElement().appendChild(cp2);

        OdfTableCell cell3 = row.getCellByIndex(3);
        OdfTextParagraph cp3 = new OdfTextParagraph(contentDom);
        cp3.setTextContent(s.getSampleType());
        cp3.setProperty(StyleTextPropertiesElement.FontSize, "8pt");
        cell3.getOdfElement().appendChild(cp3);
      }

      int count = 0;
      for (OdfTableRow row : oTable.getRowList()) {
        if (count % 2 != 0) {
          for (int i = 0; i < row.getCellCount(); i++) {
            row.getCellByIndex(i).setCellBackgroundColor("#EEEEEE");
          }
        }
        count++;
      }

View Full Code Here

  @Override
  public void visit(TableTableElement ele) {
    OdfTable table = OdfTable.getInstance(ele);
    List<OdfTableRow> rowlist = table.getRowList();
    for (int i = 0; i < rowlist.size(); i++) {
      OdfTableRow row = rowlist.get(i);
      for (int j = 0; j < row.getCellCount(); j++) {
        mTextBuilder.append(row.getCellByIndex(j).getDisplayText()).append(TabChar);
      }
      mTextBuilder.append(NewLineChar);
    }
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.doc.table.OdfTableRow

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.