public class Cell extends CompositeNode
Cell can only be a child of a Row.
Cell can contain block-level nodes Paragraph and Table.
A minimal valid cell needs to have at least one Paragraph.
| Constructor and Description |
|---|
Cell(DocumentBase doc)
Initializes a new instance of the Cell class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(DocumentVisitor visitor)
Accepts a visitor.
|
void |
clearCellAttrs() |
void |
ensureMinimum()
If the last child is not a paragraph, creates and appends one empty paragraph.
|
java.lang.Object |
fetchCellAttr(int key) |
java.lang.Object |
fetchInheritedCellAttr(int key) |
CellFormat |
getCellFormat()
Provides access to the formatting properties of the cell.
|
java.lang.Object |
getDirectCellAttr(int key) |
Paragraph |
getFirstParagraph()
Gets the first paragraph among the immediate children.
|
Paragraph |
getLastParagraph()
Gets the last paragraph among the immediate children.
|
int |
getNodeType()
Returns NodeType.Cell.
|
ParagraphCollection |
getParagraphs()
Gets a collection of paragraphs that are immediate children of the cell.
|
Row |
getParentRow()
Returns the parent row of the cell.
|
TableCollection |
getTables()
Gets a collection of tables that are immediate children of the cell.
|
boolean |
isFirstCell()
True if this is the first cell inside a row; false otherwise.
|
boolean |
isLastCell()
True if this is the last cell inside a row; false otherwise.
|
void |
removeMoveRevisions() |
void |
setCellAttr(int key,
java.lang.Object value) |
acceptChildren, acceptCore, appendChild, coreRemoveSelfOnly, getChild, getChildNodes, getChildNodes, getContainer, getCount, getCurrentNode, getFirstChild, getLastChild, getNextMatchingNode, getText, hasChildNodes, indexOf, insertAfter, insertBefore, isComposite, iterator, prependChild, removeAllChildren, removeChild, removeSmartTags, selectNodes, selectSingleNodedd, deepClone, getAncestor, getAncestor, getCustomNodeId, getDocument, getNextSibling, getParentNode, getPreviousSibling, getRange, memberwiseClone, nextPreOrder, nodeTypeToString, previousPreOrder, remove, setCustomNodeId, toString, toString, toString, visitorActionToBoolpublic Cell(DocumentBase doc)
When Cell is created, it belongs to the specified document, but is not yet part of the document and ParentNode is null.
To append Cell to the document use InsertAfter or InsertBefore on the row where you want the cell inserted.
doc - The owner document.public int getNodeType()
getNodeType in class NodeNodeType constants.public Row getParentRow()
(Row)FirstNonMarkupParentNode.public Paragraph getFirstParagraph()
public Paragraph getLastParagraph()
public boolean isFirstCell()
boolean value.public boolean isLastCell()
boolean value.public CellFormat getCellFormat()
CellFormat value.public ParagraphCollection getParagraphs()
public TableCollection getTables()
public boolean accept(DocumentVisitor visitor) throws java.lang.Exception
Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.
For more info see the Visitor design pattern.
public void ensureMinimum()
public java.lang.Object getDirectCellAttr(int key)
public java.lang.Object fetchCellAttr(int key)
public java.lang.Object fetchInheritedCellAttr(int key)
public void setCellAttr(int key,
java.lang.Object value)
public void clearCellAttrs()
public void removeMoveRevisions()