kz.greetgo.msoffice.docx.TableRow Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greetgo.msoffice Show documentation
Show all versions of greetgo.msoffice Show documentation
greetgo library to generate or parse MS Office files
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;
}
}