com.lowagie.text.rtf.list

Class RtfList

public class RtfList extends RtfElement implements RtfExtendedElement

The RtfList stores one List. It also provides the methods to write the list declaration and the list data.

Version: $Id: RtfList.java 2825 2007-06-04 09:15:21Z blowagie $

Author: Mark Hall (mhall@edu.uni-klu.ac.at) Thomas Bickel (tmb99@inode.at) Felix Satyaputra (f_satyaputra@yahoo.co.uk)

Field Summary
intalignment
The alignment of this RtfList
StringbulletCharacter
The text to use as the bullet character
intfirstIndent
The first indentation of this RtfList
RtfFontfontBullet
The RtfFont for bulleted lists
RtfFontfontNumber
The RtfFont for numbered lists
ArrayListitems
The subitems of this RtfList
intleftIndent
The left indentation of this RtfList
intlistLevel
The level of this RtfList
intlistNumber
The list number of this RtfList
intlistType
Whether this RtfList is numbered
static byte[]LIST_BULLET
Constant for the old bulleted list
static byte[]LIST_LEVEL
Constant for list level
static byte[]LIST_LEVEL_ALIGNMENT
Constant for list level alignment old
static byte[]LIST_LEVEL_ALIGNMENT_NEW
Constant for list level alignment new
static byte[]LIST_LEVEL_FIRST_INDENT
Constant for the first indentation
static byte[]LIST_LEVEL_NUMBER
Constant for the list level value
static byte[]LIST_LEVEL_NUMBERS_BEGIN
Constant for the beginning of the list level numbers
static byte[]LIST_LEVEL_NUMBERS_END
Constant for the end of the list level numbers
static byte[]LIST_LEVEL_NUMBERS_NUMBERED
Constant for the list level numbers
static byte[]LIST_LEVEL_START_AT
Constant for list level start at
static byte[]LIST_LEVEL_STYLE_BULLETED_BEGIN
Constant for the beginning of the list level bulleted style
static byte[]LIST_LEVEL_STYLE_BULLETED_END
Constant for the end of the list level bulleted style
static byte[]LIST_LEVEL_STYLE_NUMBERED_BEGIN
Constant for the beginning of the list level numbered style
static byte[]LIST_LEVEL_STYLE_NUMBERED_END
Constant for the end of the list level numbered style
static byte[]LIST_LEVEL_SYMBOL_INDENT
Constant for the symbol indentation
static byte[]LIST_LEVEL_TEXT
Constant for list level text
static byte[]LIST_LEVEL_TYPE
Constant for list level style old
static byte[]LIST_LEVEL_TYPE_NEW
Constant for list level style new
static byte[]LIST_NUMBER_END
Constant for the old list number end
static byte[]LIST_TEXT
Constant for the old list text
static intLIST_TYPE_BULLET
static intLIST_TYPE_LOWER_LETTERS
static intLIST_TYPE_LOWER_ROMAN
static intLIST_TYPE_NUMBERED
static intLIST_TYPE_UPPER_LETTERS
static intLIST_TYPE_UPPER_ROMAN
RtfListparentList
The parent List in multi-level lists.
intrightIndent
The right indentation of this RtfList
intsymbolIndent
The symbol indentation of this RtfList
static byte[]TAB
Constant for a tab character
Constructor Summary
RtfList(RtfDocument doc, List list)
Constructs a new RtfList for the specified List.
Method Summary
protected voidcorrectIndentation()
Correct the indentation of this RtfList by adding left/first line indentation from the parent RtfList.
intgetFirstIndent()
Get the first line indentation of this RtfList.
intgetLeftIndent()
Get the left indentation of this RtfList.
intgetListLevel()
Gets the list level of this RtfList
intgetListNumber()
Gets the id of this list
voidsetInHeader(boolean inHeader)
Sets whether this RtfList is in a header.
voidsetInTable(boolean inTable)
Sets whether this RtfList is in a table.
voidsetListLevel(int listLevel)
Sets the list level of this RtfList.
voidsetListNumber(int listNumber)
Sets the id of this list
protected voidsetParent(RtfList parent)
Sets the parent RtfList of this RtfList
byte[]write()
Writes the content of the RtfList
voidwriteContent(OutputStream result)
Writes the content of the RtfList
byte[]writeDefinition()
Writes the definition part of this list level
voidwriteDefinition(OutputStream result)
Writes the definition part of this list level
byte[]writeIndentations()
voidwriteIndentations(OutputStream result)
protected byte[]writeListBeginning()
Writes the initialisation part of the RtfList
protected byte[]writeListNumbers()
Writes only the list number and list level number.

Field Detail

alignment

private int alignment
The alignment of this RtfList

bulletCharacter

private String bulletCharacter
The text to use as the bullet character

firstIndent

private int firstIndent
The first indentation of this RtfList

fontBullet

private RtfFont fontBullet
The RtfFont for bulleted lists

fontNumber

private RtfFont fontNumber
The RtfFont for numbered lists

items

private ArrayList items
The subitems of this RtfList

leftIndent

private int leftIndent
The left indentation of this RtfList

listLevel

private int listLevel
The level of this RtfList

listNumber

private int listNumber
The list number of this RtfList

listType

private int listType
Whether this RtfList is numbered

LIST_BULLET

private static final byte[] LIST_BULLET
Constant for the old bulleted list

LIST_LEVEL

private static final byte[] LIST_LEVEL
Constant for list level

LIST_LEVEL_ALIGNMENT

private static final byte[] LIST_LEVEL_ALIGNMENT
Constant for list level alignment old

LIST_LEVEL_ALIGNMENT_NEW

private static final byte[] LIST_LEVEL_ALIGNMENT_NEW
Constant for list level alignment new

LIST_LEVEL_FIRST_INDENT

private static final byte[] LIST_LEVEL_FIRST_INDENT
Constant for the first indentation

LIST_LEVEL_NUMBER

private static final byte[] LIST_LEVEL_NUMBER
Constant for the list level value

LIST_LEVEL_NUMBERS_BEGIN

private static final byte[] LIST_LEVEL_NUMBERS_BEGIN
Constant for the beginning of the list level numbers

LIST_LEVEL_NUMBERS_END

private static final byte[] LIST_LEVEL_NUMBERS_END
Constant for the end of the list level numbers

LIST_LEVEL_NUMBERS_NUMBERED

private static final byte[] LIST_LEVEL_NUMBERS_NUMBERED
Constant for the list level numbers

LIST_LEVEL_START_AT

private static final byte[] LIST_LEVEL_START_AT
Constant for list level start at

LIST_LEVEL_STYLE_BULLETED_BEGIN

private static final byte[] LIST_LEVEL_STYLE_BULLETED_BEGIN
Constant for the beginning of the list level bulleted style

LIST_LEVEL_STYLE_BULLETED_END

private static final byte[] LIST_LEVEL_STYLE_BULLETED_END
Constant for the end of the list level bulleted style

LIST_LEVEL_STYLE_NUMBERED_BEGIN

private static final byte[] LIST_LEVEL_STYLE_NUMBERED_BEGIN
Constant for the beginning of the list level numbered style

LIST_LEVEL_STYLE_NUMBERED_END

private static final byte[] LIST_LEVEL_STYLE_NUMBERED_END
Constant for the end of the list level numbered style

LIST_LEVEL_SYMBOL_INDENT

private static final byte[] LIST_LEVEL_SYMBOL_INDENT
Constant for the symbol indentation

LIST_LEVEL_TEXT

private static final byte[] LIST_LEVEL_TEXT
Constant for list level text

LIST_LEVEL_TYPE

private static final byte[] LIST_LEVEL_TYPE
Constant for list level style old

LIST_LEVEL_TYPE_NEW

private static final byte[] LIST_LEVEL_TYPE_NEW
Constant for list level style new

LIST_NUMBER_END

private static final byte[] LIST_NUMBER_END
Constant for the old list number end

LIST_TEXT

private static final byte[] LIST_TEXT
Constant for the old list text

LIST_TYPE_BULLET

private static final int LIST_TYPE_BULLET

LIST_TYPE_LOWER_LETTERS

private static final int LIST_TYPE_LOWER_LETTERS

LIST_TYPE_LOWER_ROMAN

private static final int LIST_TYPE_LOWER_ROMAN

LIST_TYPE_NUMBERED

private static final int LIST_TYPE_NUMBERED

LIST_TYPE_UPPER_LETTERS

private static final int LIST_TYPE_UPPER_LETTERS

LIST_TYPE_UPPER_ROMAN

private static final int LIST_TYPE_UPPER_ROMAN

parentList

private RtfList parentList
The parent List in multi-level lists.

rightIndent

private int rightIndent
The right indentation of this RtfList

symbolIndent

private int symbolIndent
The symbol indentation of this RtfList

TAB

private static final byte[] TAB
Constant for a tab character

Constructor Detail

RtfList

public RtfList(RtfDocument doc, List list)
Constructs a new RtfList for the specified List.

Parameters: doc The RtfDocument this RtfList belongs to list The List this RtfList is based on

Method Detail

correctIndentation

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

getFirstIndent

private int getFirstIndent()
Get the first line indentation of this RtfList.

Returns: The first line indentation.

getLeftIndent

private int getLeftIndent()
Get the left indentation of this RtfList.

Returns: The left indentation.

getListLevel

public int getListLevel()
Gets the list level of this RtfList

Returns: Returns the list level.

getListNumber

public int getListNumber()
Gets the id of this list

Returns: Returns the list number.

setInHeader

public void setInHeader(boolean inHeader)
Sets whether this RtfList is in a header. Sets the correct inTable setting for all child elements.

Parameters: inHeader True if this RtfList is in a header, false otherwise

setInTable

public void setInTable(boolean inTable)
Sets whether this RtfList is in a table. Sets the correct inTable setting for all child elements.

Parameters: inTable True if this RtfList is in a table, false otherwise

setListLevel

public void setListLevel(int listLevel)
Sets the list level of this RtfList. A list level > 0 will unregister this RtfList from the RtfListTable

Parameters: listLevel The list level to set.

setListNumber

public void setListNumber(int listNumber)
Sets the id of this list

Parameters: listNumber The list number to set.

setParent

protected void setParent(RtfList parent)
Sets the parent RtfList of this RtfList

Parameters: parent The parent RtfList to use.

write

public byte[] write()

Deprecated: replaced by writeContent

Writes the content of the RtfList

Returns: A byte array containing the actual content of the RtfList

writeContent

public void writeContent(OutputStream result)
Writes the content of the RtfList

writeDefinition

public byte[] writeDefinition()

Deprecated: replaced by writeDefinition

Writes the definition part of this list level

Returns: A byte array containing the definition of this list level

writeDefinition

public void writeDefinition(OutputStream result)
Writes the definition part of this list level

writeIndentations

private byte[] writeIndentations()

Deprecated:

Returns: a byte array

writeIndentations

private void writeIndentations(OutputStream result)

writeListBeginning

protected byte[] writeListBeginning()
Writes the initialisation part of the RtfList

Returns: A byte array containing the initialisation part

writeListNumbers

protected byte[] writeListNumbers()
Writes only the list number and list level number.

Returns: The list number and list level number of this RtfList.