com.lowagie.text.rtf.headerfooter

Class RtfHeaderFooter

public class RtfHeaderFooter extends HeaderFooter implements RtfBasicElement

The RtfHeaderFooter represents one header or footer. This class can be used directly.

Version: $Id: RtfHeaderFooter.java,v 1.11 2006/08/07 10:42:34 blowagie Exp $

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

Field Summary
Object[]content
The content of this RtfHeaderFooter
intdisplayAt
The display location of this RtfHeaderFooter.
RtfDocumentdocument
The RtfDocument this RtfHeaderFooter belongs to
static intDISPLAY_ALL_PAGES
Constant for displaying the header/footer on all pages
static intDISPLAY_FIRST_PAGE
Constant for displaying the header/footer on the first page
static intDISPLAY_LEFT_PAGES
Constant for displaying the header/footer on all left hand pages
static intDISPLAY_RIGHT_PAGES
Constant for displaying the header/footer on all right hand pages
static byte[]FOOTER_ALL
Constant for a footer on all pages
static byte[]FOOTER_FIRST
Constant for a footer on the first page
static byte[]FOOTER_LEFT
Constnat for a footer on the left hand pages
static byte[]FOOTER_RIGHT
Constant for a footer on the right hand pages
static byte[]HEADER_ALL
Constant for a header on all pages
static byte[]HEADER_FIRST
Constant for a header on the first page
static byte[]HEADER_LEFT
Constant for a header on all left hand pages
static byte[]HEADER_RIGHT
Constant for a header on all right hand pages
inttype
The display type of this RtfHeaderFooter.
static intTYPE_FOOTER
Constant for the footer type
static intTYPE_HEADER
Constant for the header type
Constructor Summary
protected RtfHeaderFooter(RtfDocument doc, HeaderFooter headerFooter, int type, int displayAt)
Constructs a RtfHeaderFooter based on a HeaderFooter with a certain type and displayAt location.
protected RtfHeaderFooter(RtfDocument doc, RtfHeaderFooter headerFooter, int displayAt)
Constructs a RtfHeaderFooter as a copy of an existing RtfHeaderFooter.
protected RtfHeaderFooter(RtfDocument doc, HeaderFooter headerFooter)
Constructs a RtfHeaderFooter for a HeaderFooter.
RtfHeaderFooter(Element element)
Constructs a RtfHeaderFooter for any Element.
RtfHeaderFooter(Element[] elements)
Constructs a RtfHeaderFooter for an array of Elements.
Method Summary
Object[]getContent()
Gets the content of this RtfHeaderFooter
voidsetAlignment(int alignment)
Set the alignment of this RtfHeaderFooter.
voidsetDisplayAt(int displayAt)
Sets the display location of this RtfHeaderFooter
voidsetInHeader(boolean inHeader)
Unused
voidsetInTable(boolean inTable)
Unused
voidsetRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfElement belongs to
voidsetType(int type)
Sets the type of this RtfHeaderFooter
byte[]write()
Writes the content of this RtfHeaderFooter

Field Detail

content

private Object[] content
The content of this RtfHeaderFooter

displayAt

private int displayAt
The display location of this RtfHeaderFooter. DISPLAY_FIRST_PAGE, DISPLAY_LEFT_PAGES, DISPLAY_RIGHT_PAGES or DISPLAY_ALL_PAGES

document

private RtfDocument document
The RtfDocument this RtfHeaderFooter belongs to

DISPLAY_ALL_PAGES

public static final int DISPLAY_ALL_PAGES
Constant for displaying the header/footer on all pages

DISPLAY_FIRST_PAGE

public static final int DISPLAY_FIRST_PAGE
Constant for displaying the header/footer on the first page

DISPLAY_LEFT_PAGES

public static final int DISPLAY_LEFT_PAGES
Constant for displaying the header/footer on all left hand pages

DISPLAY_RIGHT_PAGES

public static final int DISPLAY_RIGHT_PAGES
Constant for displaying the header/footer on all right hand pages

FOOTER_ALL

private static final byte[] FOOTER_ALL
Constant for a footer on all pages

FOOTER_FIRST

private static final byte[] FOOTER_FIRST
Constant for a footer on the first page

FOOTER_LEFT

private static final byte[] FOOTER_LEFT
Constnat for a footer on the left hand pages

FOOTER_RIGHT

private static final byte[] FOOTER_RIGHT
Constant for a footer on the right hand pages

HEADER_ALL

private static final byte[] HEADER_ALL
Constant for a header on all pages

HEADER_FIRST

private static final byte[] HEADER_FIRST
Constant for a header on the first page

HEADER_LEFT

private static final byte[] HEADER_LEFT
Constant for a header on all left hand pages

HEADER_RIGHT

private static final byte[] HEADER_RIGHT
Constant for a header on all right hand pages

type

private int type
The display type of this RtfHeaderFooter. TYPE_HEADER or TYPE_FOOTER

TYPE_FOOTER

public static final int TYPE_FOOTER
Constant for the footer type

TYPE_HEADER

public static final int TYPE_HEADER
Constant for the header type

Constructor Detail

RtfHeaderFooter

protected RtfHeaderFooter(RtfDocument doc, HeaderFooter headerFooter, int type, int displayAt)
Constructs a RtfHeaderFooter based on a HeaderFooter with a certain type and displayAt location. For internal use only.

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to headerFooter The HeaderFooter to base this RtfHeaderFooter on type The type of RtfHeaderFooter displayAt The display location of this RtfHeaderFooter

RtfHeaderFooter

protected RtfHeaderFooter(RtfDocument doc, RtfHeaderFooter headerFooter, int displayAt)
Constructs a RtfHeaderFooter as a copy of an existing RtfHeaderFooter. For internal use only.

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to headerFooter The RtfHeaderFooter to copy displayAt The display location of this RtfHeaderFooter

RtfHeaderFooter

protected RtfHeaderFooter(RtfDocument doc, HeaderFooter headerFooter)
Constructs a RtfHeaderFooter for a HeaderFooter.

Parameters: doc The RtfDocument this RtfHeaderFooter belongs to headerFooter The HeaderFooter to base this RtfHeaderFooter on

RtfHeaderFooter

public RtfHeaderFooter(Element element)
Constructs a RtfHeaderFooter for any Element.

Parameters: element The Element to display as content of this RtfHeaderFooter

RtfHeaderFooter

public RtfHeaderFooter(Element[] elements)
Constructs a RtfHeaderFooter for an array of Elements.

Parameters: elements The Elements to display as the content of this RtfHeaderFooter.

Method Detail

getContent

private Object[] getContent()
Gets the content of this RtfHeaderFooter

Returns: The content of this RtfHeaderFooter

setAlignment

public void setAlignment(int alignment)
Set the alignment of this RtfHeaderFooter. Passes the setting on to the contained element.

setDisplayAt

public void setDisplayAt(int displayAt)
Sets the display location of this RtfHeaderFooter

Parameters: 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)
Sets the type of this RtfHeaderFooter

Parameters: type The type to use.

write

public byte[] write()
Writes the content of this RtfHeaderFooter

Returns: A byte array with the content of this RtfHeaderFooter