public class Header extends Component implements TableContainer, VariableContainer
Constructor and Description |
---|
Header(StyleHeaderElement element)
Create a header instance by an object of
StyleHeaderElement . |
Modifier and Type | Method and Description |
---|---|
Table |
addTable()
Add a new Table to this container.
|
Table |
addTable(int numRows,
int numCols)
Add a new Table to this container with a specified row number and column
number.
|
Section |
appendSection(String name)
Create an empty section and append it at the end of the footer.
|
VariableField |
declareVariable(String name,
VariableField.VariableType type)
Declare a new variable field to this container.
|
StyleHeaderElement |
getOdfElement()
Return an instance of
StyleHeaderElement which represents
this feature. |
Table.TableBuilder |
getTableBuilder()
Return the table builder of this document.
|
Table |
getTableByName(String name)
Return an instance of table feature with the specific table name.
|
OdfElement |
getTableContainerElement()
Get the ODF element which can have
|
List<Table> |
getTableList()
Return a list of table features in this document.
|
OdfElement |
getVariableContainerElement()
Get the ODF element which can have variable declare section as child
element directly according to ODF specification.
|
VariableField |
getVariableFieldByName(String name)
Return the declared variable by name.
|
boolean |
isVisible()
Get this header is visible or not.
|
void |
setVisible(boolean isVisible)
Set this header visible or not.
|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
public Header(StyleHeaderElement element)
StyleHeaderElement
.element
- - an object of StyleHeaderElement
public StyleHeaderElement getOdfElement()
StyleHeaderElement
which represents
this feature.getOdfElement
in class Component
StyleHeaderElement
public boolean isVisible()
true
, otherwise
return false
.public void setVisible(boolean isVisible)
isVisible
- If isVisible
is true, the header of this document
is visible, otherwise is invisible.public Table addTable()
TableContainer
addTable
in interface TableContainer
public Table addTable(int numRows, int numCols)
TableContainer
The table will be inserted at the end of the tableContainer. An unique
table name will be given, you may set a custom table name using the
setTableName
method.
addTable
in interface TableContainer
numRows
- the row numbernumCols
- the column numberTable
public Table getTableByName(String name)
TableContainer
getTableByName
in interface TableContainer
name
- of the table being searched for.public List<Table> getTableList()
TableContainer
getTableList
in interface TableContainer
public Table.TableBuilder getTableBuilder()
TableContainer
getTableBuilder
in interface TableContainer
public OdfElement getTableContainerElement()
TableContainer
getTableContainerElement
in interface TableContainer
public OdfElement getVariableContainerElement()
VariableContainer
The variable declare section may be
getVariableContainerElement
in interface VariableContainer
public VariableField declareVariable(String name, VariableField.VariableType type)
VariableContainer
declareVariable
in interface VariableContainer
name
- the unique name of this variable field.type
- the type of this variable field.public VariableField getVariableFieldByName(String name)
VariableContainer
getVariableFieldByName
in interface VariableContainer
name
- the unique name of this variable field.public Section appendSection(String name)
name
- - specify the section nameRuntimeException
- if content DOM could not be initializedCopyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.