public class Table extends FlowObject implements BlockElement
The fo:table flow object and its child flow objects model the visual layout of a table in a "row primary" manner. A complete table may be seen as consisting of a grid of rows and columns where each cell occupies one or more grid units in the row-progression-direction and column-progression-direction.
The table content is divided into a header (optional), footer (optional), and one or more bodies. Properties specify if the headers and footers should be repeated at a break in the table. Each of these parts occupies one or more rows in the table grid.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BORDER_COLLAPSE_COLLAPSE
Collapse borders of cells.
|
static java.lang.String |
BORDER_COLLAPSE_SEPARATE
Separate borders of cells.
|
static java.lang.String |
BORDER_COLLAPSE_SEPARATE_WITH_PRECEDENCE
Collapsing borders and use border precedence properties for
conflict resolution.
|
EMPTY_ARRAY
MAP_TYPE_FLYWEIGHT, MAP_TYPE_HASH
Constructor and Description |
---|
Table()
Creates a new empty table.
|
Table(Measure[] columnWidths)
Creates a new table and defines some columns.
|
Table(Measure[] columnWidths,
java.lang.Object[][] cells)
Creates a new table, defines some columns and adds some cells to table-body.
|
Table(Measure[] columnWidths,
java.lang.Object[][] bodyCells,
java.lang.Object[][] headerCells)
Creates a new table, defines some columns and adds some cells to table-body and
table-header..
|
Table(Measure[] columnWidths,
TableRow[] rows)
Creates a new table, defines some columns and adds some rows to table-body.
|
Table(Measure[] columnWidths,
TableRow[] bodyRows,
TableRow[] headerRows)
Creates a new table, defines some columns and adds some rows to table-body and
TableHeader.
|
Modifier and Type | Method and Description |
---|---|
Table |
add(int idx,
TableColumn c)
Adds a column to this table at an index.
|
Table |
add(TableColumn c)
Adds a column to this table.
|
Table |
addColumn(int idx,
Measure width)
Adds a column to this table at an index.
|
Table |
addColumn(Measure width)
Adds a column to this table.
|
Table |
addRowToBody(java.lang.Object[] cells)
Adds a row at end of body.
|
Table |
addRowToBody(TableRow row)
Adds a row at end of body.
|
boolean |
addUnsafe(java.lang.Object child)
Adds a NodeElement to this FormattingObject.
|
java.lang.Object |
clone()
Clones this element.
|
Accessibility |
getAccessibility()
Gets the accessibilty of this fo.
|
Background |
getBackground()
Gets the background of this fo.
|
TableBody |
getBody()
Gets the body of this table.
|
Border |
getBorder()
Gets the border of this fo.
|
TableColumn |
getColumn(int column) |
int |
getColumnCount() |
java.util.List |
getColumns()
Gets a list of all columns (TableColumn).
|
java.util.List |
getElements()
Gets childreen of this node.
|
TableFooter |
getFooter()
Gets the footer of this table, if no header was set before an empty
footer is created.
|
TableHeader |
getHeader()
Gets the header of this table, if no header was set before an empty
header is created.
|
Margin |
getMargin()
Gets the margin of this fo.
|
Padding |
getPadding()
Gets the padding of this fo.
|
RelativePosition |
getRelativePosition()
Gets the relative position of this fo.
|
Values.WritingMode |
getWritingMode()
Gets the writing mode of this formatting object.
|
boolean |
hasBorder()
Returns true if at least one border attribute is set.
|
boolean |
hasFooter()
Determinates if a footer was initialized by setFooter or getFooter.
|
boolean |
hasHeader()
Determinates if a header was initialized by setHeader or getHeader.
|
void |
setAccessibility(Accessibility access)
Sets the accessibility of this fo.
|
void |
setBackground(Background bg)
Sets the background of this fo.
|
void |
setBorder(Border border)
Sets the border of this fo.
|
void |
setBorderCollapse(java.lang.String borderCollapse)
Sets the border collapse model.
|
void |
setBreakAfter(Values.Break type) |
void |
setBreakBefore(Values.Break type) |
void |
setFooter(TableFooter footer)
Sets the footer of this table.
|
void |
setHeader(TableHeader header)
Sets the header of this table.
|
void |
setMargin(Margin margin)
Sets the margin of this fo.
|
void |
setPadding(Padding padding)
Sets the padding of this fo.
|
void |
setRelativePosition(RelativePosition pos)
Sets the relative position of this fo.
|
void |
setWritingMode(Values.WritingMode mode)
Sets the writing mode for this formatting object.
|
addElement, addElement, addUnsafe, cloned, clonedList, createUniqueID, createUniqueID, doGetAttribute, doSetAttribute, elementCount, get, getAbsolutePosition, getAttributeMap, getDefinedAttributes, getDocument, getFont, getID, getLanguage, getLogger, getMeasureValue, getObjectValue, getObjectValue, getObjectValue, getObjectValue, getOrphans, getParentFO, getWidows, hasID, hasPadding, isEmpty, isHyphenation, removeElement, removeElement, replaceElement, setAbsolutePosition, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setElement, setFont, setHyphenation, setID, setLanguage, setLanguage, setOrphans, setWidows
getDefaultMapType, setDefaultMapType
addAttributeChangeListener, addElements, addElements, clearEqualAttributes, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, contains, copyAttributes, createID, findFirstNodeWithText, findNode, findNodesWithText, fire, fireSaxEvents, firstElement, getAttrAsBoolean, getAttrAsInteger, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getContentText, getDefinedAttributes, getElements, getElements, getElements, getFirstElement, getIndex, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getParent, getParent, getParent, getParentOrThis, getQName, getRoot, hasEqualAttrs, indexOf, lastElement, liftInheritedAttribute, removeAttributeChangeListener, setAttribute, setAttributes, setAttrIfNotNull, setEnableAttributeChangeEvent, setNamespace, setParent, setQName, setUndefinedAttributes, writeTo, writeTo, writeTo, writeTo
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttributeChangeListener, addElement, addElement, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, fireSaxEvents, firstElement, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getDefinedAttributes, getElements, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getQName, getRoot, indexOf, isEmpty, lastElement, removeAttributeChangeListener, removeElement, removeElement, replaceElement, setAttribute, setAttributes, setElement, setNamespace
getParent, setParent, writeTo
public static java.lang.String BORDER_COLLAPSE_COLLAPSE
public static java.lang.String BORDER_COLLAPSE_SEPARATE
public static java.lang.String BORDER_COLLAPSE_SEPARATE_WITH_PRECEDENCE
public Table()
public Table(Measure[] columnWidths)
columnWidths
- Widths of columns.public Table(Measure[] columnWidths, java.lang.Object[][] cells)
columnWidths
- Widths of columns. Number of columns should match
number of cells in each row.cells
- Some cells that are added to table-body.public Table(Measure[] columnWidths, java.lang.Object[][] bodyCells, java.lang.Object[][] headerCells)
columnWidths
- Widths of columns. Number of columns should match
number of cells in each row.bodyCells
- Some cells that are added to table-body.headerCells
- Some cells that are added to table-header.public Table(Measure[] columnWidths, TableRow[] rows)
columnWidths
- Widths of columns. Number of columns should match
number of cells in each row.rows
- Some rows that are added to table-body.public Table(Measure[] columnWidths, TableRow[] bodyRows, TableRow[] headerRows)
columnWidths
- Widths of columns. Number of columns should match
number of cells in each row.bodyRows
- Some rows that are added to table-body.headerRows
- Some rows that are added to table-header.public Table addRowToBody(java.lang.Object[] cells)
cells
- Cells of row.public Table addRowToBody(TableRow row)
row
- Table row.public java.util.List getElements()
AbstractNode
NodeElement
or String
.getElements
in interface Node
getElements
in class AbstractNode
public void setHeader(TableHeader header)
header
- New header or NULL to clear.public void setFooter(TableFooter footer)
footer
- New footer or NULL to clear.public boolean hasHeader()
public TableHeader getHeader()
public boolean hasFooter()
public TableFooter getFooter()
public TableBody getBody()
public Table add(TableColumn c)
c
- New column.public Table addColumn(Measure width)
width
- Width of column.public Table add(int idx, TableColumn c)
idx
- Index.c
- New column.public Table addColumn(int idx, Measure width)
idx
- Index.width
- Width of column.public java.util.List getColumns()
public TableColumn getColumn(int column)
public int getColumnCount()
public void setBreakBefore(Values.Break type)
public void setBreakAfter(Values.Break type)
public Margin getMargin()
getMargin
in class FormattingObject
public void setMargin(Margin margin)
setMargin
in class FormattingObject
margin
- Margin.public Padding getPadding()
getPadding
in class FormattingObject
public void setPadding(Padding padding)
setPadding
in class FormattingObject
padding
- Padding.public boolean hasBorder()
hasBorder
in class FormattingObject
public Border getBorder()
getBorder
in class FormattingObject
public void setBorder(Border border)
setBorder
in class FormattingObject
border
- Border.public Background getBackground()
getBackground
in class FormattingObject
public void setBackground(Background bg)
setBackground
in class FormattingObject
bg
- Background.public Accessibility getAccessibility()
getAccessibility
in class FormattingObject
public void setAccessibility(Accessibility access)
setAccessibility
in class FormattingObject
access
- Accessibility.public RelativePosition getRelativePosition()
getRelativePosition
in class FormattingObject
public void setRelativePosition(RelativePosition pos)
setRelativePosition
in class FormattingObject
pos
- RelativePosition.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
NodeElement
clone
in interface NodeElement
clone
in class FormattingObject
java.lang.CloneNotSupportedException
public void setBorderCollapse(java.lang.String borderCollapse)
borderCollapse
- Border collapsepublic Values.WritingMode getWritingMode()
public void setWritingMode(Values.WritingMode mode)
mode
- Writing mode.public boolean addUnsafe(java.lang.Object child)
FormattingObject
addUnsafe
in class FormattingObject
child
- Element.false
if this FO is unable to add object.© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.