Package com.lowagie.text.rtf.list
Class RtfListItem
- java.lang.Object
-
- com.lowagie.text.rtf.RtfElement
-
- com.lowagie.text.rtf.text.RtfPhrase
-
- com.lowagie.text.rtf.text.RtfParagraph
-
- com.lowagie.text.rtf.list.RtfListItem
-
- All Implemented Interfaces:
RtfBasicElement
,com.lowagie.text.RtfElementInterface
public class RtfListItem extends RtfParagraph
The RtfListItem acts as a wrapper for a ListItem.- Since:
- 2.1.3
- Version:
- $Id: RtfListItem.java 3969 2009-06-16 08:03:23Z blowagie $
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
containsInnerList
Whether this RtfListItem contains further RtfLists.private int
level
private RtfListLevel
parentList
The RtfList this RtfListItem belongs to.-
Fields inherited from class com.lowagie.text.rtf.text.RtfParagraph
PARAGRAPH, paragraphStyle
-
Fields inherited from class com.lowagie.text.rtf.text.RtfPhrase
chunks, IN_TABLE, LINE_SPACING, PARAGRAPH_DEFAULTS, PLAIN
-
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
Constructors Constructor Description RtfListItem(RtfDocument doc, com.lowagie.text.ListItem listItem)
Constructs a RtfListItem for a ListItem belonging to a RtfDocument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
correctIndentation()
Correct the indentation of RtfLists in this RtfListItem by adding left/first line indentation from the parent RtfList.int
getLevel()
RtfListLevel
getParent()
Set the parent RtfList.void
inheritListSettings(int listNumber, int listLevel)
Inherit the list settings from the parent list to RtfLists that are contained in this RtfListItem.boolean
isContainsInnerList()
Gets whether this RtfListItem contains further RtfLists.void
setLevel(int level)
void
setParent(RtfListLevel parentList)
Set the parent RtfList.void
writeContent(java.io.OutputStream result)
Writes the content of this RtfListItem.boolean
writeDefinition(java.io.OutputStream out)
-
Methods inherited from class com.lowagie.text.rtf.text.RtfParagraph
getIndentLeft, getIndentRight, setIndentLeft, setIndentRight, setKeepTogetherWithNext
-
Methods inherited from class com.lowagie.text.rtf.text.RtfPhrase
setInHeader, setInTable, setRtfDocument
-
Methods inherited from class com.lowagie.text.rtf.RtfElement
intToByteArray, isInTable
-
-
-
-
Field Detail
-
parentList
private RtfListLevel parentList
The RtfList this RtfListItem belongs to.
-
containsInnerList
private boolean containsInnerList
Whether this RtfListItem contains further RtfLists.
-
level
private int level
-
-
Constructor Detail
-
RtfListItem
public RtfListItem(RtfDocument doc, com.lowagie.text.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
-
writeContent
public void writeContent(java.io.OutputStream result) throws java.io.IOException
Writes the content of this RtfListItem.- Specified by:
writeContent
in interfaceRtfBasicElement
- Overrides:
writeContent
in classRtfParagraph
- Parameters:
result
- TheOutputStream
to write the content to- Throws:
java.io.IOException
-
writeDefinition
public boolean writeDefinition(java.io.OutputStream out) throws java.io.IOException
Writes the definition of the first element in this RtfListItem that is an instanceofRtfList
to the given stream.
If this item does not contain aRtfList
element nothing is written and the method returnsfalse
.- Parameters:
out
- destination stream- Returns:
true
if a RtfList definition was written,false
otherwise- Throws:
java.io.IOException
-
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.
-
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.
-
setParent
public void setParent(RtfListLevel parentList)
Set the parent RtfList.- Parameters:
parentList
- The parent RtfList to use.
-
getParent
public RtfListLevel getParent()
Set the parent RtfList.- Returns:
- The parent RtfList to use.
- Since:
- 2.1.3
-
isContainsInnerList
public boolean isContainsInnerList()
Gets whether this RtfListItem contains further RtfLists.- Returns:
- Whether this RtfListItem contains further RtfLists.
-
getLevel
public int getLevel()
- Returns:
- the level
- Since:
- 2.1.3
-
setLevel
public void setLevel(int level)
- Parameters:
level
- the level to set- Since:
- 2.1.3
-
-