com.lowagie.text.rtf.list
Class RtfList

java.lang.Object
  extended by com.lowagie.text.rtf.RtfElement
      extended by com.lowagie.text.rtf.list.RtfList
All Implemented Interfaces:
RtfBasicElement, RtfExtendedElement, RtfElementInterface

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 4006 2009-07-07 08:34:10Z blowagie $
Author:
Mark Hall (Mark.Hall@mail.room3b.eu), Howard Shank (hgshank@yahoo.com)

Field Summary
static byte[] LIST_ID
          Constant for the list id
static byte[] LIST_LEVEL_NUMBER
          Constant for the list level value
static byte[] LIST_NUMBER
          Constant for the list number
static byte[] LIST_NUMBER_END
          Constant for the old list number end
static byte[] LIST_TEXT
          Constant for the old list text
static int LIST_TYPE_HYBRID
          List type of listhybrid
static int LIST_TYPE_NORMAL
          List type of NORMAL - no control word
static int LIST_TYPE_SIMPLE
          List type of listsimple
static byte[] TAB
          Constant for a tab character
 
Fields inherited from class com.lowagie.text.rtf.RtfElement
document, inHeader, inTable
 
Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR
 
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  void correctIndentation()
          Correct the indentation of this RtfList by adding left/first line indentation from the parent RtfList.
protected  void createDefaultLevels()
          Create a default set of listlevels
 int getID()
          Get the list ID number
 RtfListLevel getListLevel(int index)
           
 int getListNumber()
          Gets the id of this list
 int getListType()
           
 java.lang.String getName()
           
 RtfList getParentList()
           
 void setDocument(RtfDocument doc)
          Set the document.
 void setID(int id)
          Set the list ID number
 void setInHeader(boolean inHeader)
          Sets whether this RtfList is in a header.
 void setInTable(boolean inTable)
          Sets whether this RtfList is in a table.
 void setListNumber(int listNumber)
          Sets the id of this list
 void setListType(int listType)
           
 void setName(java.lang.String name)
           
 void setParentList(RtfList parentList)
           
 void writeContent(java.io.OutputStream result)
          Writes the content of the RtfList
 void writeDefinition(java.io.OutputStream result)
          Writes the definition part of this list level
protected  void writeListNumbers(java.io.OutputStream result)
          Writes only the list number and list level number.
protected  void writeListTextBlock(java.io.OutputStream result, int itemNr, RtfListLevel listLevel)
           
 
Methods inherited from class com.lowagie.text.rtf.RtfElement
intToByteArray, isInTable, setRtfDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.lowagie.text.rtf.RtfBasicElement
setRtfDocument
 

Field Detail

LIST_NUMBER

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

Since:
2.1.3

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_TEXT

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

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

TAB

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

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
See Also:
Constant Field Values

LIST_TYPE_SIMPLE

public static final int LIST_TYPE_SIMPLE
List type of listsimple

Since:
2.1.3
See Also:
Constant Field Values

LIST_TYPE_HYBRID

public static final int LIST_TYPE_HYBRID
List type of listhybrid

Since:
2.1.3
See Also:
Constant Field Values
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

setDocument

public void setDocument(RtfDocument doc)
Set the document.

Parameters:
doc - The RtfDocument
Since:
2.1.3

writeDefinition

public void writeDefinition(java.io.OutputStream result)
                     throws java.io.IOException
Writes the definition part of this list level

Specified by:
writeDefinition in interface RtfExtendedElement
Parameters:
result -
Throws:
java.io.IOException
Since:
2.1.3

writeContent

public void writeContent(java.io.OutputStream result)
                  throws java.io.IOException
Writes the content of the RtfList

Specified by:
writeContent in interface RtfBasicElement
Specified by:
writeContent in class RtfElement
Parameters:
result - The OutputStream to write the content to
Throws:
java.io.IOException
Since:
2.1.3

writeListTextBlock

protected void writeListTextBlock(java.io.OutputStream result,
                                  int itemNr,
                                  RtfListLevel listLevel)
                           throws java.io.IOException
Parameters:
result -
itemNr -
listLevel -
Throws:
java.io.IOException
Since:
2.1.3

writeListNumbers

protected void writeListNumbers(java.io.OutputStream result)
                         throws java.io.IOException
Writes only the list number and list level number.

Parameters:
result - The OutputStream to write to
Throws:
java.io.IOException - On i/o errors.
Since:
2.1.3

createDefaultLevels

protected void createDefaultLevels()
Create a default set of listlevels

Since:
2.1.3

getListNumber

public int getListNumber()
Gets the id of this list

Returns:
Returns the list number.
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

setInTable

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

Specified by:
setInTable in interface RtfBasicElement
Overrides:
setInTable in class RtfElement
Parameters:
inTable - True if this RtfList is in a table, false otherwise
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.

Specified by:
setInHeader in interface RtfBasicElement
Overrides:
setInHeader in class RtfElement
Parameters:
inHeader - True if this RtfList is in a header, false otherwise
Since:
2.1.3

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

setID

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

Parameters:
id -
Since:
2.1.3

getID

public int getID()
Get the list ID number

Returns:
this list id
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

setListType

public void setListType(int listType)
                 throws java.security.InvalidParameterException
Parameters:
listType - the listType to set
Throws:
java.security.InvalidParameterException
Since:
2.1.3
See Also:
LIST_TYPE_NORMAL, LIST_TYPE_SIMPLE, LIST_TYPE_HYBRID

getParentList

public RtfList getParentList()
Returns:
the parentList
Since:
2.1.3

setParentList

public void setParentList(RtfList parentList)
Parameters:
parentList - the parentList to set
Since:
2.1.3

getName

public java.lang.String getName()
Returns:
the name
Since:
2.1.3

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set
Since:
2.1.3

getListLevel

public RtfListLevel getListLevel(int index)
Returns:
the list at the index
Since:
2.1.3


iText 2.1.7