FileDocCategorySizeDatePackage
TableRow.javaAPI DocApache Poi 3.0.13805Mon Jan 01 18:55:30 GMT 2007org.apache.poi.hwpf.usermodel

TableRow

public class TableRow extends Paragraph

Fields Summary
private static final char
TABLE_CELL_MARK
private static final short
SPRM_TJC
private static final short
SPRM_DXAGAPHALF
private static final short
SPRM_FCANTSPLIT
private static final short
SPRM_FTABLEHEADER
private static final short
SPRM_DYAROWHEIGHT
int
_levelNum
private TableProperties
_tprops
private TableCell[]
_cells
Constructors Summary
public TableRow(int startIdx, int endIdx, Table parent, int levelNum)


          
  
    super(startIdx, endIdx, parent);

    _tprops = TableSprmUncompressor.uncompressTAP(_papx.toByteArray(), 2);
    _levelNum = levelNum;
    _cells = new TableCell[_tprops.getItcMac()];

    int start = 0;
    int end = 0;

    for (int cellIndex = 0; cellIndex < _cells.length; cellIndex++)
    {
      Paragraph p = getParagraph(start);
      String s = p.text();

      while (! ( (s.charAt(s.length() - 1) == TABLE_CELL_MARK) ||
                p.isEmbeddedCellMark() && p.getTableLevel() == levelNum))
      {
        end++;
        p = getParagraph(end);
        s = p.text();
      }
      _cells[cellIndex] = new TableCell(start, end, this, levelNum,
                                        _tprops.getRgtc()[cellIndex],
                                        _tprops.getRgdxaCenter()[cellIndex],
                                        _tprops.getRgdxaCenter()[cellIndex+1]-_tprops.getRgdxaCenter()[cellIndex]);
      end++;
      start = end;
    }
  
Methods Summary
public booleancantSplit()

    return _tprops.getFCantSplit();
  
public org.apache.poi.hwpf.usermodel.TableCellgetCell(int index)

    return _cells[index];
  
public intgetGapHalf()

    return _tprops.getDxaGapHalf();
  
public intgetRowHeight()

    return _tprops.getDyaRowHeight();
  
public intgetRowJustification()

    return _tprops.getJc();
  
public booleanisTableHeader()

    return _tprops.getFTableHeader();
  
public intnumCells()

    return _cells.length;
  
public voidsetCantSplit(boolean cantSplit)

    _tprops.setFCantSplit(cantSplit);
    _papx.updateSprm(SPRM_FCANTSPLIT, (byte)(cantSplit ? 1 : 0));
  
public voidsetGapHalf(int dxaGapHalf)

    _tprops.setDxaGapHalf(dxaGapHalf);
    _papx.updateSprm(SPRM_DXAGAPHALF, (short)dxaGapHalf);
  
public voidsetRowHeight(int dyaRowHeight)

    _tprops.setDyaRowHeight(dyaRowHeight);
    _papx.updateSprm(SPRM_DYAROWHEIGHT, (short)dyaRowHeight);
  
public voidsetRowJustification(int jc)

    _tprops.setJc(jc);
    _papx.updateSprm(SPRM_TJC, (short)jc);
  
public voidsetTableHeader(boolean tableHeader)

    _tprops.setFTableHeader(tableHeader);
    _papx.updateSprm(SPRM_FTABLEHEADER, (byte)(tableHeader ? 1 : 0));