com.lowagie.text
public class Section extends ArrayList implements TextElementArray, LargeElement
Section
is a part of a Document
containing
other Section
s, Paragraph
s, List
and/or Table
s.
Remark: you can not construct a Section
yourself.
You will have to ask an instance of Section
to the
Chapter
or Section
to which you want to
add the new Section
.
Example:
Paragraph title2 = new Paragraph("This is Chapter 2", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255))); Chapter chapter2 = new Chapter(title2, 2); Paragraph someText = new Paragraph("This is some text"); chapter2.add(someText); Paragraph title21 = new Paragraph("This is Section 1 in Chapter 2", FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0))); Section section1 = chapter2.addSection(title21); Paragraph someSectionText = new Paragraph("This is some silly paragraph in a chapter and/or section. It contains some text to test the functionality of Chapters and Section."); section1.add(someSectionText); Paragraph title211 = new Paragraph("This is SubSection 1 in Section 1 in Chapter 2", FontFactory.getFont(FontFactory.HELVETICA, 14, Font.BOLD, new Color(255, 0, 0))); Section section11 = section1.addSection(40, title211, 2); section11.add(someSectionText);
Field Summary | |
---|---|
protected boolean | addedCompletely
Indicates if the Section was added completely to the document. |
protected boolean | bookmarkOpen false if the bookmark children are not visible |
protected String | bookmarkTitle The bookmark title if different from the content title |
protected boolean | complete
Indicates if the Section will be complete once added to the document. |
protected float | indentation The additional indentation of the content of this section. |
protected float | indentationLeft The indentation of this section on the left side. |
protected float | indentationRight The indentation of this section on the right side. |
protected boolean | notAddedYet
Indicates if this is the first time the section was added. |
protected int | numberDepth The number of sectionnumbers that has to be shown before the section title. |
protected ArrayList | numbers This is the complete list of sectionnumbers of this section and the parents of this section. |
protected int | numberStyle
The style for sectionnumbers. |
static int | NUMBERSTYLE_DOTTED
A possible number style. |
static int | NUMBERSTYLE_DOTTED_WITHOUT_FINAL_DOT
A possible number style. |
static long | serialVersionUID A serial version uid. |
protected int | subsections This is the number of subsections. |
protected Paragraph | title The title of this section. |
protected boolean | triggerNewPage true if the section has to trigger a new page |
Constructor Summary | |
---|---|
protected | Section()
Constructs a new Section . |
protected | Section(Paragraph title, int numberDepth)
Constructs a new Section .
|
Method Summary | |
---|---|
void | add(int index, Object o)
Adds a Paragraph , List or Table
to this Section .
|
boolean | add(Object o)
Adds a Paragraph , List , Table or another Section
to this Section .
|
boolean | addAll(Collection collection)
Adds a collection of Element s
to this Section .
|
MarkedSection | addMarkedSection()
Adds a marked section. |
Section | addSection(float indentation, Paragraph title, int numberDepth)
Creates a Section , adds it to this Section and returns it.
|
Section | addSection(float indentation, Paragraph title)
Creates a Section , adds it to this Section and returns it.
|
Section | addSection(Paragraph title, int numberDepth)
Creates a Section , add it to this Section and returns it.
|
Section | addSection(Paragraph title)
Creates a Section , adds it to this Section and returns it.
|
Section | addSection(float indentation, String title, int numberDepth)
Adds a Section to this Section and returns it.
|
Section | addSection(String title, int numberDepth)
Adds a Section to this Section and returns it.
|
Section | addSection(float indentation, String title)
Adds a Section to this Section and returns it.
|
Section | addSection(String title)
Adds a Section to this Section and returns it.
|
static Paragraph | constructTitle(Paragraph title, ArrayList numbers, int numberDepth, int numberStyle)
Constructs a Paragraph that will be used as title for a Section or Chapter. |
void | flushContent() |
Paragraph | getBookmarkTitle()
Gets the bookmark title. |
ArrayList | getChunks()
Gets all the chunks in this element.
|
int | getDepth()
Returns the depth of this section.
|
float | getIndentation()
Returns the indentation of the content of this Section .
|
float | getIndentationLeft()
Returns the indentation of this Section on the left side.
|
float | getIndentationRight()
Returns the indentation of this Section on the right side.
|
int | getNumberDepth()
Returns the numberdepth of this Section .
|
int | getNumberStyle()
Gets the style used for numbering sections. |
Paragraph | getTitle()
Returns the title, preceded by a certain number of sectionnumbers.
|
protected boolean | isAddedCompletely() |
boolean | isBookmarkOpen()
Getter for property bookmarkOpen. |
boolean | isChapter()
Checks if this object is a Chapter .
|
boolean | isComplete() |
boolean | isContent() |
boolean | isNestable() |
boolean | isNotAddedYet()
Indicates if this is the first time the section is added. |
boolean | isSection()
Checks if this object is a Section .
|
boolean | isTriggerNewPage()
Getter for property bookmarkOpen. |
void | newPage()
Adds a new page to the section. |
boolean | process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener .
|
protected void | setAddedCompletely(boolean addedCompletely) |
void | setBookmarkOpen(boolean bookmarkOpen) Setter for property bookmarkOpen. |
void | setBookmarkTitle(String bookmarkTitle)
Sets the bookmark title. |
void | setChapterNumber(int number)
Changes the Chapter number. |
void | setComplete(boolean complete) |
void | setIndentation(float indentation)
Sets the indentation of the content of this Section .
|
void | setIndentationLeft(float indentation)
Sets the indentation of this Section on the left side.
|
void | setIndentationRight(float indentation)
Sets the indentation of this Section on the right side.
|
void | setNotAddedYet(boolean notAddedYet)
Sets the indication if the section was already added to
the document. |
void | setNumberDepth(int numberDepth)
Sets the depth of the sectionnumbers that will be shown preceding the title.
|
void | setNumbers(int number, ArrayList numbers)
Sets the number of this section.
|
void | setNumberStyle(int numberStyle)
Sets the style for numbering sections.
|
void | setTitle(Paragraph title)
Sets the title of this section.
|
void | setTriggerNewPage(boolean triggerNewPage)
Setter for property triggerNewPage. |
int | type()
Gets the type of the text element.
|
Since: iText 2.0.8
Since: iText 2.0.8
Since: iText 2.0.8
Since: iText 2.0.8
Since: iText 2.0.8
Since: iText 2.0.8
Section
.Section
.
Parameters: title a Paragraph
numberDepth the numberDepth
Paragraph
, List
or Table
to this Section
.
Parameters: index index at which the specified element is to be inserted o an object of type Paragraph
, List
or Table
=
Throws: ClassCastException if the object is not a Paragraph
, List
or Table
Paragraph
, List
, Table
or another Section
to this Section
.
Parameters: o an object of type Paragraph
, List
, Table
or another Section
Returns: a boolean
Throws: ClassCastException if the object is not a Paragraph
, List
, Table
or Section
Element
s
to this Section
.
Parameters: collection a collection of Paragraph
s, List
s and/or Table
s
Returns: true
if the action succeeded, false
if not.
Throws: ClassCastException if one of the objects isn't a Paragraph
, List
, Table
Section
, adds it to this Section
and returns it.
Parameters: indentation the indentation of the new section title the title of the new section numberDepth the numberDepth of the section
Returns: a new Section object
Section
, adds it to this Section
and returns it.
Parameters: indentation the indentation of the new section title the title of the new section
Returns: a new Section object
Section
, add it to this Section
and returns it.
Parameters: title the title of the new section numberDepth the numberDepth of the section
Returns: a new Section object
Section
, adds it to this Section
and returns it.
Parameters: title the title of the new section
Returns: a new Section object
Section
to this Section
and returns it.
Parameters: indentation the indentation of the new section title the title of the new section numberDepth the numberDepth of the section
Returns: a new Section object
Section
to this Section
and returns it.
Parameters: title the title of the new section numberDepth the numberDepth of the section
Returns: a new Section object
Section
to this Section
and returns it.
Parameters: indentation the indentation of the new section title the title of the new section
Returns: a new Section object
Section
to this Section
and returns it.
Parameters: title the title of the new section
Returns: a new Section object
Parameters: title the title of the section numbers a list of sectionnumbers numberDepth how many numbers have to be shown numberStyle the numbering style
Returns: a Paragraph object
Since: iText 2.0.8
Since: iText 2.0.8
See Also: flushContent
Returns: the bookmark title
Returns: an ArrayList
Returns: the depth
Section
.
Returns: the indentation
Section
on the left side.
Returns: the indentation
Section
on the right side.
Returns: the indentation
Section
.
Returns: the numberdepth
Returns: a value corresponding with a numbering style
Since: iText 2.0.8
Returns: a Paragraph
Since: iText 2.0.8
Returns: Value of property bookmarkOpen.
Chapter
.
Returns: true
if it is a Chapter
,
false
if it is a Section
.
Since: iText 2.0.8
See Also: isComplete
Since: iText 2.0.8
See Also: isContent
Since: iText 2.0.8
See Also: isNestable
Returns: true if the section wasn't added yet
Since: iText2.0.8
Section
.
Returns: true
if it is a Section
,
false
if it is a Chapter
.
Returns: Value of property triggerNewPage.
Since: 2.1.1
ElementListener
.
Parameters: listener the ElementListener
Returns: true
if the element was processed successfully
Since: iText 2.0.8
Parameters: bookmarkOpen false if the bookmark children are not visible.
Parameters: bookmarkTitle the bookmark title
Since: iText 2.0.8
See Also: LargeElement
Section
.
Parameters: indentation the indentation
Section
on the left side.
Parameters: indentation the indentation
Section
on the right side.
Parameters: indentation the indentation
Parameters: notAddedYet
Since: iText2.0.8
If the numberdepth is 0, the sections will not be numbered. If the numberdepth is 1, the section will be numbered with their own number. If the numberdepth is higher (for instance x > 1), the numbers of x - 1 parents will be shown.
Parameters: numberDepth the new numberDepth
Parameters: number the number of this section numbers an ArrayList
, containing the numbers of the Parent
Since: iText 2.0.8
Parameters: title the new title
Parameters: triggerNewPage true if a new page has to be triggered.
Returns: a type