/** * Sets whether this RtfList is in a header. Sets the correct inTable setting for all child * elements. * * @param inHeader <code>True</code> if this RtfList is in a header, <code>false</code> otherwise */ public void setInHeader(boolean inHeader) { super.setInHeader(inHeader); for (int i = 0; i < this.items.size(); i++) { ((RtfBasicElement) this.items.get(i)).setInHeader(inHeader); } }
/** * Sets the RtfDocument this RtfChunk belongs to. * * @param doc The RtfDocument to use */ public void setRtfDocument(RtfDocument doc) { super.setRtfDocument(doc); this.font.setRtfDocument(this.document); }
/** Writes the content of the RtfList */ public void writeContent(final OutputStream result) throws IOException { result.write(OPEN_GROUP); int itemNr = 0; for (int i = 0; i < items.size(); i++) { RtfElement rtfElement = (RtfElement) items.get(i); if (rtfElement instanceof RtfListItem) { itemNr++; result.write(writeListBeginning()); result.write(writeListNumbers()); result.write(OPEN_GROUP); result.write(LIST_TEXT); result.write(RtfParagraph.PARAGRAPH_DEFAULTS); if (this.inTable) { result.write(RtfParagraph.IN_TABLE); } result.write(RtfFontList.FONT_NUMBER); if (this.listType != LIST_TYPE_BULLET) { result.write(intToByteArray(fontNumber.getFontNumber())); } else { result.write(intToByteArray(fontBullet.getFontNumber())); } // .result.write(writeIndentations()); writeIndentations(result); result.write(DELIMITER); if (this.listType != LIST_TYPE_BULLET) { switch (this.listType) { case LIST_TYPE_NUMBERED: result.write(intToByteArray(itemNr)); break; case LIST_TYPE_UPPER_LETTERS: result.write(RomanAlphabetFactory.getUpperCaseString(itemNr).getBytes()); break; case LIST_TYPE_LOWER_LETTERS: result.write(RomanAlphabetFactory.getLowerCaseString(itemNr).getBytes()); break; case LIST_TYPE_UPPER_ROMAN: result.write(RomanNumberFactory.getUpperCaseString(itemNr).getBytes()); break; case LIST_TYPE_LOWER_ROMAN: result.write(RomanNumberFactory.getLowerCaseString(itemNr).getBytes()); break; } result.write(LIST_NUMBER_END); } else { this.document.filterSpecialChar(result, this.bulletCharacter, true, false); } result.write(TAB); result.write(CLOSE_GROUP); // .result.write(rtfElement.write()); rtfElement.writeContent(result); if (i < (items.size() - 1) || !this.inTable || this.listLevel > 0) { result.write(RtfParagraph.PARAGRAPH); } result.write("\n".getBytes()); } else if (rtfElement instanceof RtfList) { // .result.write(rtfElement.write()); rtfElement.writeContent(result); result.write("\n".getBytes()); } } result.write(CLOSE_GROUP); if (!this.inTable) { result.write(RtfParagraph.PARAGRAPH_DEFAULTS); } }
/** * Sets the RtfDocument this RtfColor belongs to * * @param doc The RtfDocument to use */ public void setRtfDocument(RtfDocument doc) { super.setRtfDocument(doc); if (document != null) { this.colorNumber = document.getDocumentHeader().getColorNumber(this); } }