|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.Component
org.odftoolkit.simple.text.Header
public class Header
This class represents header definition in text document. It provides methods to manipulate header in text document, such as, set text, add table.
Constructor Summary | |
---|---|
Header(StyleHeaderElement element)
Create a header instance by an object of StyleHeaderElement . |
Method Summary | |
---|---|
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. |
Methods inherited from class org.odftoolkit.simple.Component |
---|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Header(StyleHeaderElement element)
StyleHeaderElement
.
element
- - an object of StyleHeaderElement
Method Detail |
---|
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 number
Table
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 name
RuntimeException
- if content DOM could not be initialized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |