com.arctorus.documents.table
Class MergedCell

java.lang.Object
  extended by com.arctorus.documents.table.Cell
      extended by com.arctorus.documents.table.MergedCell

public final class MergedCell
extends Cell

Represents merged cell. Offers merging cells possibility.


Field Summary
 
Fields inherited from class com.arctorus.documents.table.Cell
NULL
 
Constructor Summary
MergedCell(Cell startCell, Cell endCell)
          Create new merged cell by merging all cells between startCell and endCell.
 
Method Summary
 void addRun(Run run)
          Add new text run to the cell.
 Cell getEndCell()
          Get last cell of the merged cell.
 java.util.List<Run> getRuns()
          Get list of text runs stored in the merged cell.
 Cell getStartCell()
          Get first cell of the merged cell.
 CellStyleId getStyleId()
          Get cell style id.
 boolean hasText()
          Return true if cell has text runs.
 void setRuns(java.util.List<Run> runs)
          Set list of text runs to store in the merged cell.
 void setStyle(CellStyle cellStyle)
          Set cell style.
 void setStyleId(CellStyleId styleId)
          Set cell style id.
 
Methods inherited from class com.arctorus.documents.table.Cell
equalContent, getBorders, getColumnIndex, getRowIndex, hasBorders, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MergedCell

public MergedCell(Cell startCell,
                  Cell endCell)
           throws java.lang.NullPointerException,
                  MergedCellException
Create new merged cell by merging all cells between startCell and endCell.

Parameters:
startCell - first cell to merge.
endCell - last cell to merge.
Throws:
java.lang.NullPointerException - if startCell or endCell are null.
MergedCellException - thrown if
startCell.equals(endCell) ||
startCell.getColumnIndex() > endCell.getColumnIndex() ||
startCell.getRowIndex() > endCell.getRowIndex())
Method Detail

getStartCell

public Cell getStartCell()
Get first cell of the merged cell.


getEndCell

public Cell getEndCell()
Get last cell of the merged cell.


getRuns

public java.util.List<Run> getRuns()
Get list of text runs stored in the merged cell. List of runs is equal to the list of the start cell.

Overrides:
getRuns in class Cell

setRuns

public void setRuns(java.util.List<Run> runs)
Set list of text runs to store in the merged cell. List of runs is equal to the list of the start cell.

Overrides:
setRuns in class Cell
Parameters:
runs - list of text runs.

hasText

public boolean hasText()
Return true if cell has text runs.

Overrides:
hasText in class Cell

addRun

public void addRun(Run run)
Add new text run to the cell.

Overrides:
addRun in class Cell
Parameters:
run - text run to add.

getStyleId

public CellStyleId getStyleId()
Get cell style id. The cell style is equal to the cell style of the start cell.

Overrides:
getStyleId in class Cell

setStyleId

public void setStyleId(CellStyleId styleId)
Set cell style id. The cell style is equal to the cell style of the start cell.

Overrides:
setStyleId in class Cell
Parameters:
styleId - new style id of the cell.

setStyle

public void setStyle(CellStyle cellStyle)
Set cell style. The cell style is equal to the cell style of the start cell.

Overrides:
setStyle in class Cell
Parameters:
cellStyle - new cell style.