org.odftoolkit.simple.text
Class Footer

java.lang.Object
  extended by org.odftoolkit.simple.Component
      extended by org.odftoolkit.simple.text.Footer
All Implemented Interfaces:
VariableContainer, TableContainer

public class Footer
extends Component
implements TableContainer, VariableContainer

This class represents footer definition in text document. It provides methods to manipulate footer in text document, such as, set text, add table.

Since:
0.4.5

Constructor Summary
Footer(StyleFooterElement element)
          Create a footer instance by an object of StyleFooterElement.
 
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.
 VariableField declareVariable(String name, VariableField.VariableType type)
          Declare a new variable field to this container.
 StyleFooterElement getOdfElement()
          Return an instance of StyleFooterElement 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 as child element directly according to ODF specification.
 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 footer is visible or not.
 void setVisible(boolean isVisible)
          Set this footer 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

Footer

public Footer(StyleFooterElement element)
Create a footer instance by an object of StyleFooterElement.

Parameters:
element - - an object of StyleFooterElement
Method Detail

getOdfElement

public StyleFooterElement getOdfElement()
Return an instance of StyleFooterElement which represents this feature.

Specified by:
getOdfElement in class Component
Returns:
an instance of StyleFooterElement

isVisible

public boolean isVisible()
Get this footer is visible or not.

Returns:
If this footer is visible return true, otherwise return false.
Since:
0.5.5

setVisible

public void setVisible(boolean isVisible)
Set this footer visible or not.

Parameters:
isVisible - If isVisible is true, the footer of this document is visible, otherwise is invisible.
Since:
0.5.5

addTable

public Table addTable()
Description copied from interface: TableContainer
Add a new Table to this container.

Specified by:
addTable in interface TableContainer
Returns:
added table.

addTable

public Table addTable(int numRows,
                      int numCols)
Description copied from interface: TableContainer
Add a new Table to this container with a specified row number and column number.

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.

Specified by:
addTable in interface TableContainer
Parameters:
numRows - the row number
numCols - the column number
Returns:
a new instance of Table

getTableByName

public Table getTableByName(String name)
Description copied from interface: TableContainer
Return an instance of table feature with the specific table name.

Specified by:
getTableByName in interface TableContainer
Parameters:
name - of the table being searched for.
Returns:
an instance of table feature with the specific table name.

getTableList

public List<Table> getTableList()
Description copied from interface: TableContainer
Return a list of table features in this document.

Specified by:
getTableList in interface TableContainer
Returns:
a list of table features in this document.

getTableBuilder

public Table.TableBuilder getTableBuilder()
Description copied from interface: TableContainer
Return the table builder of this document. Every document has a table builder, which supplies all of the table creation realization, for example newTable().

Specified by:
getTableBuilder in interface TableContainer
Returns:
the table builder of this document.

getTableContainerElement

public OdfElement getTableContainerElement()
Description copied from interface: TableContainer
Get the ODF element which can have as child element directly according to ODF specification. This Element will help to find the position to insert a new Table. For example, element is usable with element, so TextDocument will return OfficeTextElement. While Presentation Notes is an indirectly TableContainer, which holds Table with the help of its grand-child element , so for Notes, DrawTextBoxElement should be return.

Specified by:
getTableContainerElement in interface TableContainer
Returns:
container element which can hold .

getVariableContainerElement

public OdfElement getVariableContainerElement()
Description copied from interface: VariableContainer
Get the ODF element which can have variable declare section as child element directly according to ODF specification. This element will help to find the position to declare a new variable.

The variable declare section may be , or .

Specified by:
getVariableContainerElement in interface VariableContainer
Returns:
container element which can hold variable declare section.

declareVariable

public VariableField declareVariable(String name,
                                     VariableField.VariableType type)
Description copied from interface: VariableContainer
Declare a new variable field to this container.

Specified by:
declareVariable in interface VariableContainer
Parameters:
name - the unique name of this variable field.
type - the type of this variable field.
Returns:
declared variable field.

getVariableFieldByName

public VariableField getVariableFieldByName(String name)
Description copied from interface: VariableContainer
Return the declared variable by name.

Specified by:
getVariableFieldByName in interface VariableContainer
Parameters:
name - the unique name of this variable field.
Returns:
the declared variable.


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.