All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kz.greetgo.msoffice.docx.TableRow Maven / Gradle / Ivy

There is a newer version: 0.5.9
Show newest version
package kz.greetgo.msoffice.docx;

import kz.greetgo.msoffice.docx.Table.TableInfo;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;

public class TableRow implements XmlWriter {
  private final TableInfo tableInfo;
  private final String ownerPartName;
  private final MSHelper msHelper;

  TableRow(TableInfo tableInfo, String ownerPartName, MSHelper msHelper) {
    this.tableInfo = tableInfo;
    this.ownerPartName = ownerPartName;
    this.msHelper = msHelper;
  }

  private List cells = new ArrayList();
  private Integer tblCellSpacing = 0;
  private Integer height;

  public TableCell createCell() {
    TableCell ret = new TableCell(tableInfo.getTableCol(cells.size()), ownerPartName, msHelper);
    cells.add(ret);
    return ret;
  }

  public TableCell getCell(int index) {
    return cells.get(index);
  }

  @Override
  public void write(PrintStream out) {
    out.print("");
    out.print("");
    out.print("");
    if (getHeight() != null) {
      out.print("");
    }
    out.print("");
    for (TableCell c : cells) {
      c.write(out);
    }
    out.print("");
  }

  public Integer getTblCellSpacing() {
    return tblCellSpacing;
  }

  public void setTblCellSpacing(Integer tblCellSpacing) {
    this.tblCellSpacing = tblCellSpacing;
  }

  public Integer getHeight() {
    return height;
  }

  public void setHeight(Integer height) {
    this.height = height;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy