com.lowagie.text.rtf.list

Class RtfListItem

public class RtfListItem extends RtfParagraph

The RtfListItem acts as a wrapper for a ListItem.

Version: $Id: RtfListItem.java 2811 2007-05-31 18:51:52Z hallm $

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

Field Summary
booleancontainsInnerList
Whether this RtfListItem contains further RtfLists.
RtfListparentList
The RtfList this RtfListItem belongs to.
Constructor Summary
RtfListItem(RtfDocument doc, ListItem listItem)
Constructs a RtfListItem for a ListItem belonging to a RtfDocument.
Method Summary
protected voidcorrectIndentation()
Correct the indentation of RtfLists in this RtfListItem by adding left/first line indentation from the parent RtfList.
voidinheritListSettings(int listNumber, int listLevel)
Inherit the list settings from the parent list to RtfLists that are contained in this RtfListItem.
booleanisContainsInnerList()
Gets whether this RtfListItem contains further RtfLists.
voidsetParent(RtfList parentList)
Set the parent RtfList.
byte[]write()
Writes the content of this RtfListItem.
voidwriteContent(OutputStream result)
Writes the content of this RtfListItem.
byte[]writeDefinition()
Returns the definition of the first list contained in this RtfListItem or an empty byte array if no inner RtfLists exist.
booleanwriteDefinition(OutputStream out)
Writes the definition of the first element in this RtfListItem that is an instanceof RtfList to the given stream.
If this item does not contain a RtfList element nothing is written and the method returns false.

Field Detail

containsInnerList

private boolean containsInnerList
Whether this RtfListItem contains further RtfLists.

parentList

private RtfList parentList
The RtfList this RtfListItem belongs to.

Constructor Detail

RtfListItem

public RtfListItem(RtfDocument doc, ListItem listItem)
Constructs a RtfListItem for a ListItem belonging to a RtfDocument.

Parameters: doc The RtfDocument this RtfListItem belongs to. listItem The ListItem this RtfListItem is based on.

Method Detail

correctIndentation

protected void correctIndentation()
Correct the indentation of RtfLists in this RtfListItem by adding left/first line indentation from the parent RtfList. Also calls correctIndentation on all child RtfLists.

inheritListSettings

public void inheritListSettings(int listNumber, int listLevel)
Inherit the list settings from the parent list to RtfLists that are contained in this RtfListItem.

Parameters: listNumber The list number to inherit. listLevel The list level to inherit.

isContainsInnerList

public boolean isContainsInnerList()
Gets whether this RtfListItem contains further RtfLists.

Returns: Whether this RtfListItem contains further RtfLists.

setParent

public void setParent(RtfList parentList)
Set the parent RtfList.

Parameters: parentList The parent RtfList to use.

write

public byte[] write()

Deprecated: replaced by writeContent

Writes the content of this RtfListItem.

Returns: A byte array with the content of this RtfListItem.

writeContent

public void writeContent(OutputStream result)
Writes the content of this RtfListItem.

writeDefinition

public byte[] writeDefinition()

Deprecated: replaced by writeDefinition

Returns the definition of the first list contained in this RtfListItem or an empty byte array if no inner RtfLists exist.

Returns: The definition of the first inner RtfList or an empty byte array.

writeDefinition

public boolean writeDefinition(OutputStream out)
Writes the definition of the first element in this RtfListItem that is an instanceof RtfList to the given stream.
If this item does not contain a RtfList element nothing is written and the method returns false.

Parameters: out destination stream

Returns: true if a RtfList definition was written, false otherwise

Throws: IOException