The RtfListItem acts as a wrapper for a ListItem.
| Method from com.lowagie.text.rtf.list.RtfListItem Detail: |
protected void correctIndentation() {
for(int i = 0; i < chunks.size(); i++) {
RtfBasicElement rtfElement = (RtfBasicElement) chunks.get(i);
if(rtfElement instanceof RtfList) {
((RtfList) rtfElement).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. |
public int getLevel() {
return level;
}
|
public RtfListLevel getParent() {
return this.parentList;
}
|
public void inheritListSettings(int listNumber,
int listLevel) {
for(int i = 0; i < chunks.size(); i++) {
RtfBasicElement rtfElement = (RtfBasicElement) chunks.get(i);
if(rtfElement instanceof RtfList) {
((RtfList) rtfElement).setListNumber(listNumber);
setLevel(listLevel);
// ((RtfList) rtfElement).setParent(this.parentList);
}
}
}
Inherit the list settings from the parent list to RtfLists that
are contained in this RtfListItem. |
public boolean isContainsInnerList() {
return this.containsInnerList;
}
Gets whether this RtfListItem contains further RtfLists. |
public void setLevel(int level) {
this.level = level;
}
|
public void setParent(RtfListLevel parentList) {
this.parentList = parentList;
}
|
public void writeContent(OutputStream result) throws IOException {
if(this.paragraphStyle.getSpacingBefore() > 0) {
result.write(RtfParagraphStyle.SPACING_BEFORE);
result.write(intToByteArray(paragraphStyle.getSpacingBefore()));
}
if(this.paragraphStyle.getSpacingAfter() > 0) {
result.write(RtfParagraphStyle.SPACING_AFTER);
result.write(intToByteArray(this.paragraphStyle.getSpacingAfter()));
}
for(int i = 0; i < chunks.size(); i++) {
RtfBasicElement rtfElement = (RtfBasicElement) chunks.get(i);
if(rtfElement instanceof RtfChunk) {
((RtfChunk) rtfElement).setSoftLineBreaks(true);
} else if(rtfElement instanceof RtfList) {
result.write(RtfParagraph.PARAGRAPH);
this.containsInnerList = true;
}
rtfElement.writeContent(result);
if(rtfElement instanceof RtfList) {
switch(this.parentList.getLevelFollowValue()) {
case RtfListLevel.LIST_LEVEL_FOLLOW_NOTHING:
break;
case RtfListLevel.LIST_LEVEL_FOLLOW_TAB:
this.parentList.writeListBeginning(result);
result.write(RtfList.TAB);
break;
case RtfListLevel.LIST_LEVEL_FOLLOW_SPACE:
this.parentList.writeListBeginning(result);
result.write(" ".getBytes());
break;
}
}
}
}
Writes the content of this RtfListItem. |
public boolean writeDefinition(OutputStream out) throws IOException {
for(int i = 0; i < chunks.size(); i++) {
RtfBasicElement rtfElement = (RtfBasicElement)chunks.get(i);
if(rtfElement instanceof RtfList) {
RtfList rl = (RtfList)rtfElement;
rl.writeDefinition(out);
return true;
}
}
return false;
}
Writes the definition of the first element in this RtfListItem that is
an instanceof RtfList to the given stream.
If this item does not contain a RtfList element nothing is written
and the method returns false. |