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.

Since: 2.1.3

Version: $Id: RtfList.java 3745 2009-03-04 09:35:19Z blowagie $

Author: Mark Hall (Mark.Hall@mail.room3b.eu) Howard Shank (hgshank@yahoo.com)

Field Summary
ArrayListitems
The subitems of this RtfList
intlistID
The list id
ArrayListlistLevels
The RtfList lists managed by this RtfListTable
intlistNumber
The list number of this RtfList
intlistType
This RtfList type
static byte[]LIST
Constant for the list
static byte[]LIST_HYBRID
Constant for the hybrid list
static byte[]LIST_ID
Constant for the list id
static byte[]LIST_LEVEL_NUMBER
Constant for the list level value
static byte[]LIST_NAME
Constant for the name of this list
static byte[]LIST_NUMBER
Constant for the list number
static byte[]LIST_NUMBER_END
Constant for the old list number end
static byte[]LIST_RESTARTHDN
Constant to indicate if the list restarts at each section.
static byte[]LIST_SIMPLE
Constant for the simple list
static byte[]LIST_STYLEID
Constant for the identifier of the style of this list.
static byte[]LIST_STYLENAME
Constant for the identifier of the style of this list.
static byte[]LIST_TEMPLATE_ID
Constant for the list template id
static byte[]LIST_TEXT
Constant for the old list text
static intLIST_TYPE_HYBRID
List type of listhybrid
static intLIST_TYPE_NORMAL
List type of NORMAL - no control word
static intLIST_TYPE_SIMPLE
List type of listsimple
Stringname
The name of the list if it exists
RtfListparentList
The parent list if there is one.
static byte[]TAB
Constant for a tab character
Constructor Summary
RtfList()
Constructs an empty RtfList object.
RtfList(RtfDocument doc)
Constructs an empty RtfList object.
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.
protected voidcreateDefaultLevels()
Create a default set of listlevels
intgetID()
Get the list ID number
RtfListLevelgetListLevel(int index)
intgetListNumber()
Gets the id of this list
intgetListType()
StringgetName()
RtfListgetParentList()
voidsetDocument(RtfDocument doc)
Set the document.
voidsetID(int id)
Set the list ID number
voidsetInHeader(boolean inHeader)
Sets whether this RtfList is in a header.
voidsetInTable(boolean inTable)
Sets whether this RtfList is in a table.
voidsetListNumber(int listNumber)
Sets the id of this list
voidsetListType(int listType)
voidsetName(String name)
voidsetParentList(RtfList parentList)
voidwriteContent(OutputStream result)
Writes the content of the RtfList
voidwriteDefinition(OutputStream result)
Writes the definition part of this list level
protected voidwriteListNumbers(OutputStream result)
Writes only the list number and list level number.
protected voidwriteListTextBlock(OutputStream result, int itemNr, RtfListLevel listLevel)

Field Detail

items

private ArrayList items
The subitems of this RtfList

listID

private int listID
The list id

listLevels

private ArrayList listLevels
The RtfList lists managed by this RtfListTable

listNumber

private int listNumber
The list number of this RtfList

listType

private int listType
This RtfList type

LIST

private static final byte[] LIST
Constant for the list

LIST_HYBRID

private static final byte[] LIST_HYBRID
Constant for the hybrid list

LIST_ID

public static final byte[] LIST_ID
Constant for the list id

Since: 2.1.3

LIST_LEVEL_NUMBER

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

Since: 2.1.3

LIST_NAME

private static final byte[] LIST_NAME
Constant for the name of this list

LIST_NUMBER

public static final byte[] LIST_NUMBER
Constant for the list number

Since: 2.1.3

LIST_NUMBER_END

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

Since: 2.1.3

LIST_RESTARTHDN

private static final byte[] LIST_RESTARTHDN
Constant to indicate if the list restarts at each section. Word 7 compatiblity

LIST_SIMPLE

private static final byte[] LIST_SIMPLE
Constant for the simple list

LIST_STYLEID

private static final byte[] LIST_STYLEID
Constant for the identifier of the style of this list. Mutually exclusive with \\liststylename

LIST_STYLENAME

private static final byte[] LIST_STYLENAME
Constant for the identifier of the style of this list. Mutually exclusive with \\liststyleid

LIST_TEMPLATE_ID

private static final byte[] LIST_TEMPLATE_ID
Constant for the list template id

LIST_TEXT

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

Since: 2.1.3

LIST_TYPE_HYBRID

public static final int LIST_TYPE_HYBRID
List type of listhybrid

Since: 2.1.3

LIST_TYPE_NORMAL

public static final int LIST_TYPE_NORMAL
List type of NORMAL - no control word

Since: 2.1.3

LIST_TYPE_SIMPLE

public static final int LIST_TYPE_SIMPLE
List type of listsimple

Since: 2.1.3

name

private String name
The name of the list if it exists

parentList

private RtfList parentList
The parent list if there is one.

TAB

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

Since: 2.1.3

Constructor Detail

RtfList

public RtfList()
Constructs an empty RtfList object.

Since: 2.1.3

RtfList

public RtfList(RtfDocument doc)
Constructs an empty RtfList object.

Parameters: doc The RtfDocument this RtfList belongs to

Since: 2.1.3

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

Since: 2.1.3

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.

Since: 2.1.3

createDefaultLevels

protected void createDefaultLevels()
Create a default set of listlevels

Since: 2.1.3

getID

public int getID()
Get the list ID number

Returns: this list id

Since: 2.1.3

getListLevel

public RtfListLevel getListLevel(int index)

Returns: the list at the index

Since: 2.1.3

getListNumber

public int getListNumber()
Gets the id of this list

Returns: Returns the list number.

Since: 2.1.3

getListType

public int getListType()

Returns: the listType

Since: 2.1.3

See Also: LIST_TYPE_NORMAL LIST_TYPE_SIMPLE LIST_TYPE_HYBRID

getName

public String getName()

Returns: the name

Since: 2.1.3

getParentList

public RtfList getParentList()

Returns: the parentList

Since: 2.1.3

setDocument

public void setDocument(RtfDocument doc)
Set the document.

Parameters: doc The RtfDocument

Since: 2.1.3

setID

public void setID(int id)
Set the list ID number

Parameters: id

Since: 2.1.3

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

Since: 2.1.3

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

Since: 2.1.3

setListNumber

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

Parameters: listNumber The list number to set.

Since: 2.1.3

setListType

public void setListType(int listType)

Parameters: listType the listType to set

Since: 2.1.3

See Also: LIST_TYPE_NORMAL LIST_TYPE_SIMPLE LIST_TYPE_HYBRID

setName

public void setName(String name)

Parameters: name the name to set

Since: 2.1.3

setParentList

public void setParentList(RtfList parentList)

Parameters: parentList the parentList to set

Since: 2.1.3

writeContent

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

Since: 2.1.3

writeDefinition

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

Parameters: result

Throws: IOException

Since: 2.1.3

writeListNumbers

protected void writeListNumbers(OutputStream result)
Writes only the list number and list level number.

Parameters: result The OutputStream to write to

Throws: IOException On i/o errors.

Since: 2.1.3

writeListTextBlock

protected void writeListTextBlock(OutputStream result, int itemNr, RtfListLevel listLevel)

Parameters: result itemNr listLevel

Throws: IOException

Since: 2.1.3