Class RtfList
java.lang.Object
com.lowagie.text.rtf.RtfElement
com.lowagie.text.rtf.list.RtfList
- All Implemented Interfaces:
RtfBasicElement, 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 4065 2009-09-16 23:09:11Z psoares33 $
- Author:
- Mark Hall (Mark.Hall@mail.room3b.eu), Howard Shank (hgshank@yahoo.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[]Constant for the list idstatic final byte[]Constant for the list level valuestatic final byte[]Constant for the list numberstatic final byte[]Constant for the old list number endstatic final byte[]Constant for the old list textstatic final intList type of listhybridstatic final intList type of NORMAL - no control wordstatic final intList type of listsimplestatic final byte[]Constant for a tab characterFields inherited from class RtfElement
document, inHeader, inTableFields inherited from interface RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR -
Constructor Summary
ConstructorsConstructorDescriptionRtfList()Constructs an empty RtfList object.RtfList(RtfDocument doc) Constructs an empty RtfList object.RtfList(RtfDocument doc, com.lowagie.text.List list) Constructs a new RtfList for the specified List. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCorrect the indentation of this RtfList by adding left/first line indentation from the parent RtfList.protected voidCreate a default set of listlevelsintgetID()Get the list ID numbergetListLevel(int index) intGets the id of this listintgetName()voidsetDocument(RtfDocument doc) Set the document.voidsetID(int id) Set the list ID numbervoidsetInHeader(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 listvoidsetListType(int listType) voidvoidsetParentList(RtfList parentList) voidwriteContent(OutputStream result) Writes the content of the RtfListvoidwriteDefinition(OutputStream result) Writes the definition part of this list levelprotected voidwriteListNumbers(OutputStream result) Writes only the list number and list level number.protected voidwriteListTextBlock(OutputStream result, int itemNr, RtfListLevel listLevel) Methods inherited from class RtfElement
intToByteArray, isInTable, setRtfDocumentMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RtfBasicElement
setRtfDocument
-
Field Details
-
LIST_NUMBER
public static final byte[] LIST_NUMBERConstant for the list number- Since:
- 2.1.3
-
LIST_ID
public static final byte[] LIST_IDConstant for the list id- Since:
- 2.1.3
-
LIST_LEVEL_NUMBER
public static final byte[] LIST_LEVEL_NUMBERConstant for the list level value- Since:
- 2.1.3
-
LIST_TEXT
public static final byte[] LIST_TEXTConstant for the old list text- Since:
- 2.1.3
-
LIST_NUMBER_END
public static final byte[] LIST_NUMBER_ENDConstant for the old list number end- Since:
- 2.1.3
-
TAB
public static final byte[] TABConstant for a tab character- Since:
- 2.1.3
-
LIST_TYPE_NORMAL
public static final int LIST_TYPE_NORMALList type of NORMAL - no control word- Since:
- 2.1.3
- See Also:
-
LIST_TYPE_SIMPLE
public static final int LIST_TYPE_SIMPLEList type of listsimple- Since:
- 2.1.3
- See Also:
-
LIST_TYPE_HYBRID
public static final int LIST_TYPE_HYBRIDList type of listhybrid- Since:
- 2.1.3
- See Also:
-
-
Constructor Details
-
RtfList
public RtfList()Constructs an empty RtfList object.- Since:
- 2.1.3
-
RtfList
Constructs an empty RtfList object.- Parameters:
doc- The RtfDocument this RtfList belongs to- Since:
- 2.1.3
-
RtfList
Constructs a new RtfList for the specified List.- Parameters:
doc- The RtfDocument this RtfList belongs tolist- The List this RtfList is based on- Since:
- 2.1.3
-
-
Method Details
-
setDocument
Set the document.- Parameters:
doc- The RtfDocument- Since:
- 2.1.3
-
writeDefinition
Writes the definition part of this list level- Specified by:
writeDefinitionin interfaceRtfExtendedElement- Parameters:
result-- Throws:
IOException- Since:
- 2.1.3
-
writeContent
Writes the content of the RtfList- Specified by:
writeContentin interfaceRtfBasicElement- Specified by:
writeContentin classRtfElement- Parameters:
result- TheOutputStreamto write the content to- Throws:
IOException- Since:
- 2.1.3
-
writeListTextBlock
protected void writeListTextBlock(OutputStream result, int itemNr, RtfListLevel listLevel) throws IOException - Parameters:
result-itemNr-listLevel-- Throws:
IOException- Since:
- 2.1.3
-
writeListNumbers
Writes only the list number and list level number.- Parameters:
result- TheOutputStreamto write to- Throws:
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:
setInTablein interfaceRtfBasicElement- Overrides:
setInTablein classRtfElement- Parameters:
inTable-Trueif this RtfList is in a table,falseotherwise- 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:
setInHeaderin interfaceRtfBasicElement- Overrides:
setInHeaderin classRtfElement- Parameters:
inHeader-Trueif this RtfList is in a header,falseotherwise- 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:
-
setListType
- Parameters:
listType- the listType to set- Throws:
InvalidParameterException- Since:
- 2.1.3
- See Also:
-
getParentList
- Returns:
- the parentList
- Since:
- 2.1.3
-
setParentList
- Parameters:
parentList- the parentList to set- Since:
- 2.1.3
-
getName
- Returns:
- the name
- Since:
- 2.1.3
-
setName
- Parameters:
name- the name to set- Since:
- 2.1.3
-
getListLevel
- Returns:
- the list at the index
- Since:
- 2.1.3
-