com.lowagie.text.rtf

Class RtfAddableElement

public abstract class RtfAddableElement extends Chunk implements RtfBasicElement

The RtfAddableElement is the superclass for all rtf specific elements that need to be added to an iText document. It is an extension of Chunk and it also implements RtfBasicElement. It is an abstract class thus it cannot be instantiated itself and has to be subclassed to be used.

Version: $Id: RtfAddableElement.java 2776 2007-05-23 20:01:40Z hallm $

Author: Mark Hall (mhall@edu.uni-klu.ac.at) Thomas Bickel (tmb99@inode.at)

Field Summary
protected RtfDocumentdoc
The RtfDocument this RtfAddableElement belongs to.
protected booleaninHeader
Whether this RtfAddableElement is contained in a header.
protected booleaninTable
Whether this RtfAddableElement is contained in a table.
Constructor Summary
RtfAddableElement()
Constructs a new RtfAddableElement.
Method Summary
byte[]intToByteArray(int i)
Transforms an integer into its String representation and then returns the bytes of that string.
booleanisEmpty()
RtfAddableElement subclasses are never assumed to be empty.
voidsetInHeader(boolean inHeader)
Sets whether this RtfAddableElement is contained in a header/footer.
voidsetInTable(boolean inTable)
Sets whether this RtfAddableElement is contained in a table.
voidsetRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfAddableElement belongs to
abstract byte[]write()
Subclasses have to implement this method.
voidwriteContent(OutputStream out)
Writes the element content to the given output stream.

Field Detail

doc

protected RtfDocument doc
The RtfDocument this RtfAddableElement belongs to.

inHeader

protected boolean inHeader
Whether this RtfAddableElement is contained in a header.

inTable

protected boolean inTable
Whether this RtfAddableElement is contained in a table.

Constructor Detail

RtfAddableElement

public RtfAddableElement()
Constructs a new RtfAddableElement. The Chunk content is set to an empty string and the font to the default Font().

Method Detail

intToByteArray

public byte[] intToByteArray(int i)
Transforms an integer into its String representation and then returns the bytes of that string.

Parameters: i The integer to convert

Returns: A byte array representing the integer

isEmpty

public boolean isEmpty()
RtfAddableElement subclasses are never assumed to be empty.

setInHeader

public void setInHeader(boolean inHeader)
Sets whether this RtfAddableElement is contained in a header/footer.

setInTable

public void setInTable(boolean inTable)
Sets whether this RtfAddableElement is contained in a table.

setRtfDocument

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

write

public abstract byte[] write()

Deprecated: replaced by writeContent

Subclasses have to implement this method.

writeContent

public void writeContent(OutputStream out)
Writes the element content to the given output stream. This method replaces the write method which is now deprecated.