com.lowagie.text.rtf.headerfooter

Class RtfHeaderFooterGroup

public class RtfHeaderFooterGroup extends HeaderFooter implements RtfBasicElement

The RtfHeaderFooterGroup holds 0 - 3 RtfHeaderFooters that create a group of headers or footers.

Version: $Version:$

Author: Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
RtfDocumentdocument
The RtfDocument this RtfHeaderFooterGroup belongs to
RtfHeaderFooterheaderAll
The RtfHeaderFooter for all pages
RtfHeaderFooterheaderFirst
The RtfHeaderFooter for the first page
RtfHeaderFooterheaderLeft
The RtfHeaderFooter for the left hand pages
RtfHeaderFooterheaderRight
The RtfHeaderFooter for the right hand pages
intmode
The current mode of this RtfHeaderFooterGroup.
static intMODE_MULTIPLE
This RtfHeaderFooterGroup contains two or three RtfHeaderFooter objects
static intMODE_NONE
This RtfHeaderFooterGroup contains no RtfHeaderFooter objects
static intMODE_SINGLE
This RtfHeaderFooterGroup contains one RtfHeaderFooter object
inttype
The current type of this RtfHeaderFooterGroup.
Constructor Summary
RtfHeaderFooterGroup()
Constructs a RtfHeaderGroup to which you add headers/footers using via the setHeaderFooter method.
RtfHeaderFooterGroup(RtfDocument doc, int type)
Constructs a certain type of RtfHeaderFooterGroup.
RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooterGroup headerFooter, int type)
Constructs a RtfHeaderFooterGroup by copying the content of the original RtfHeaderFooterGroup
RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooter headerFooter, int type)
Constructs a RtfHeaderFooterGroup for a certain RtfHeaderFooter.
RtfHeaderFooterGroup(RtfDocument doc, HeaderFooter headerFooter, int type)
Constructs a RtfHeaderGroup for a certain HeaderFooter
Method Summary
protected RtfHeaderFootergetHeaderAll()
Gets the RtfHeaderFooter for all pages
protected RtfHeaderFootergetHeaderFirst()
Gets the RtfHeaderFooter for the title page
protected RtfHeaderFootergetHeaderLeft()
Gets the RtfHeaderFooter for all left hand pages
protected RtfHeaderFootergetHeaderRight()
Gets the RtfHeaderFooter for all right hand pages
protected intgetMode()
Gets the mode of this RtfHeaderFooterGroup
booleanhasFacingPages()
Get whether this RtfHeaderFooterGroup has facing pages
booleanhasTitlePage()
Get whether this RtfHeaderFooterGroup has a titlepage
voidsetHasFacingPages()
Set that this RtfHeaderFooterGroup should have facing pages.
voidsetHasTitlePage()
Set that this RtfHeaderFooterGroup should have a title page.
voidsetHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
Set a RtfHeaderFooter to be displayed at a certain position
voidsetHeaderFooter(HeaderFooter headerFooter, int displayAt)
Set a HeaderFooter to be displayed at a certain position
voidsetInHeader(boolean inHeader)
Unused
voidsetInTable(boolean inTable)
Unused
voidsetRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfElement belongs to
voidsetType(int type)
Set the type of this RtfHeaderFooterGroup.
byte[]write()
Write the content of this RtfHeaderFooterGroup.

Field Detail

document

private RtfDocument document
The RtfDocument this RtfHeaderFooterGroup belongs to

headerAll

private RtfHeaderFooter headerAll
The RtfHeaderFooter for all pages

headerFirst

private RtfHeaderFooter headerFirst
The RtfHeaderFooter for the first page

headerLeft

private RtfHeaderFooter headerLeft
The RtfHeaderFooter for the left hand pages

headerRight

private RtfHeaderFooter headerRight
The RtfHeaderFooter for the right hand pages

mode

private int mode
The current mode of this RtfHeaderFooterGroup. Defaults to MODE_NONE

MODE_MULTIPLE

private static final int MODE_MULTIPLE
This RtfHeaderFooterGroup contains two or three RtfHeaderFooter objects

MODE_NONE

private static final int MODE_NONE
This RtfHeaderFooterGroup contains no RtfHeaderFooter objects

MODE_SINGLE

private static final int MODE_SINGLE
This RtfHeaderFooterGroup contains one RtfHeaderFooter object

type

private int type
The current type of this RtfHeaderFooterGroup. Defaults to RtfHeaderFooter.TYPE_HEADER

Constructor Detail

RtfHeaderFooterGroup

public RtfHeaderFooterGroup()
Constructs a RtfHeaderGroup to which you add headers/footers using via the setHeaderFooter method.

RtfHeaderFooterGroup

public RtfHeaderFooterGroup(RtfDocument doc, int type)
Constructs a certain type of RtfHeaderFooterGroup. RtfHeaderFooter.TYPE_HEADER and RtfHeaderFooter.TYPE_FOOTER are valid values for type.

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to type The type of RtfHeaderFooterGroup to create

RtfHeaderFooterGroup

public RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooterGroup headerFooter, int type)
Constructs a RtfHeaderFooterGroup by copying the content of the original RtfHeaderFooterGroup

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to headerFooter The RtfHeaderFooterGroup to copy type The type of RtfHeaderFooterGroup to create

RtfHeaderFooterGroup

public RtfHeaderFooterGroup(RtfDocument doc, RtfHeaderFooter headerFooter, int type)
Constructs a RtfHeaderFooterGroup for a certain RtfHeaderFooter.

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to headerFooter The RtfHeaderFooter to display type The typ of RtfHeaderFooterGroup to create

RtfHeaderFooterGroup

public RtfHeaderFooterGroup(RtfDocument doc, HeaderFooter headerFooter, int type)
Constructs a RtfHeaderGroup for a certain HeaderFooter

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to headerFooter The HeaderFooter to display type The typ of RtfHeaderFooterGroup to create

Method Detail

getHeaderAll

protected RtfHeaderFooter getHeaderAll()
Gets the RtfHeaderFooter for all pages

Returns: The RtfHeaderFooter for all pages

getHeaderFirst

protected RtfHeaderFooter getHeaderFirst()
Gets the RtfHeaderFooter for the title page

Returns: The RtfHeaderFooter for the title page

getHeaderLeft

protected RtfHeaderFooter getHeaderLeft()
Gets the RtfHeaderFooter for all left hand pages

Returns: The RtfHeaderFooter for all left hand pages

getHeaderRight

protected RtfHeaderFooter getHeaderRight()
Gets the RtfHeaderFooter for all right hand pages

Returns: The RtfHeaderFooter for all right hand pages

getMode

protected int getMode()
Gets the mode of this RtfHeaderFooterGroup

Returns: The mode of this RtfHeaderFooterGroup

hasFacingPages

public boolean hasFacingPages()
Get whether this RtfHeaderFooterGroup has facing pages

Returns: Whether this RtfHeaderFooterGroup has facing pages

hasTitlePage

public boolean hasTitlePage()
Get whether this RtfHeaderFooterGroup has a titlepage

Returns: Whether this RtfHeaderFooterGroup has a titlepage

setHasFacingPages

public void setHasFacingPages()
Set that this RtfHeaderFooterGroup should have facing pages. If only a header / footer for all pages exists, then it will be copied to the left and right pages aswell.

setHasTitlePage

public void setHasTitlePage()
Set that this RtfHeaderFooterGroup should have a title page. If only a header / footer for all pages exists, then it will be copied to the first page aswell.

setHeaderFooter

public void setHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
Set a RtfHeaderFooter to be displayed at a certain position

Parameters: headerFooter The RtfHeaderFooter to display displayAt The display location to use

setHeaderFooter

public void setHeaderFooter(HeaderFooter headerFooter, int displayAt)
Set a HeaderFooter to be displayed at a certain position

Parameters: headerFooter The HeaderFooter to set displayAt The display location to use

setInHeader

public void setInHeader(boolean inHeader)
Unused

Parameters: inHeader

setInTable

public void setInTable(boolean inTable)
Unused

Parameters: inTable

setRtfDocument

public void setRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfElement belongs to

Parameters: doc The RtfDocument to use

setType

public void setType(int type)
Set the type of this RtfHeaderFooterGroup. RtfHeaderFooter.TYPE_HEADER or RtfHeaderFooter.TYPE_FOOTER. Also sets the type for all RtfHeaderFooters of this RtfHeaderFooterGroup.

Parameters: type The type to use

write

public byte[] write()
Write the content of this RtfHeaderFooterGroup.

Returns: A byte array with the content of this RtfHeaderFooterGroup