Examples of OdfTableRow


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

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

            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

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

  @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

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

      */

      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

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

  @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

Examples of org.openoffice.odf.doc.element.table.OdfTableRow

            Element officeSpreadsheet = ( Element ) contentDoc.getElementsByTagNameNS( OdfNamespace.OFFICE.getUri(),
                "spreadsheet" ).item( 0 );
            officeSpreadsheet.appendChild( table );

            // header
            OdfTableRow headerRow = new OdfTableRow( contentDoc );
            table.appendChild( headerRow );
            LinkedHashMap<String, Short> attributeNameMap = new LinkedHashMap<String, Short>();
            if ( this.exportDn )
            {
                short cellNum = ( short ) 0;
                //attributeNameMap.put( "dn", new Short( cellNum ) ); //$NON-NLS-1$
                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( "dn" ); //$NON-NLS-1$
                headerRow.appendCell( cell );
            }

            // max export
            if ( searchParameter.getCountLimit() < 1 || searchParameter.getCountLimit() > MAX_COUNT_LIMIT )
            {
View Full Code Here

Examples of org.openoffice.odf.doc.element.table.OdfTableRow

        // group multi-valued attributes
        Map<String, String> attributeMap = ExportCsvJob.getAttributeMap( null, record, valueDelimiter, "UTF-16",
            binaryEncoding );

        // output attributes
        OdfTableRow row = new OdfTableRow( contentDoc );
        table.appendChild( row );

        if ( exportDn )
        {
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( record.getDnLine().getValueAsString() );
            row.appendCell( cell );

        }
        for ( String attributeName : attributeMap.keySet() )
        {
            if ( !headerRowAttributeNameMap.containsKey( attributeName ) )
            {
                short cellNum = ( short ) headerRowAttributeNameMap.size();
                headerRowAttributeNameMap.put( attributeName, new Short( cellNum ) );

                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( attributeName );
                headerRow.appendCell( cell );
            }

        }
        for ( String attributeName : headerRowAttributeNameMap.keySet() )
        {
            String value = attributeMap.get( attributeName );
            if ( value == null )
            {
                value = "";
            }
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( value );
            row.appendCell( cell );
        }
    }
View Full Code Here

Examples of org.openoffice.odf.doc.element.table.OdfTableRow

            Element officeSpreadsheet = ( Element ) contentDoc.getElementsByTagNameNS( OdfNamespace.OFFICE.getUri(),
                "spreadsheet" ).item( 0 ); //$NON-NLS-1$
            officeSpreadsheet.appendChild( table );

            // header
            OdfTableRow headerRow = new OdfTableRow( contentDoc );
            table.appendChild( headerRow );
            LinkedHashMap<String, Short> attributeNameMap = new LinkedHashMap<String, Short>();
            if ( this.exportDn )
            {
                //                short cellNum = ( short ) 0;
                //attributeNameMap.put( "dn", new Short( cellNum ) ); //$NON-NLS-1$
                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( "dn" ); //$NON-NLS-1$
                headerRow.appendCell( cell );
            }

            // max export
            if ( searchParameter.getCountLimit() < 1 || searchParameter.getCountLimit() > MAX_COUNT_LIMIT )
            {
View Full Code Here

Examples of org.openoffice.odf.doc.element.table.OdfTableRow

        // group multi-valued attributes
        Map<String, String> attributeMap = ExportCsvRunnable.getAttributeMap( null, record, valueDelimiter, "UTF-16", //$NON-NLS-1$
            binaryEncoding );

        // output attributes
        OdfTableRow row = new OdfTableRow( contentDoc );
        table.appendChild( row );

        if ( exportDn )
        {
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( record.getDnLine().getValueAsString() );
            row.appendCell( cell );

        }
        for ( String attributeName : attributeMap.keySet() )
        {
            if ( !headerRowAttributeNameMap.containsKey( attributeName ) )
            {
                short cellNum = ( short ) headerRowAttributeNameMap.size();
                headerRowAttributeNameMap.put( attributeName, new Short( cellNum ) );

                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( attributeName );
                headerRow.appendCell( cell );
            }

        }
        for ( String attributeName : headerRowAttributeNameMap.keySet() )
        {
            String value = attributeMap.get( attributeName );
            if ( value == null )
            {
                value = ""; //$NON-NLS-1$
            }
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( value );
            row.appendCell( cell );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.