Package com.lowagie.text
Class MarkedSection
java.lang.Object
com.lowagie.text.MarkedObject
com.lowagie.text.MarkedSection
- All Implemented Interfaces:
Element
Wrapper that allows to add properties to a Chapter/Section object. Before iText 1.5 every 'basic building block'
implemented the MarkupAttributes interface. By setting attributes, you could add markup to the corresponding XML
and/or HTML tag. This functionality was hardly used by anyone, so it was removed, and replaced by the MarkedObject
functionality.
-
Field Summary
FieldsFields inherited from class com.lowagie.text.MarkedObject
element, markupAttributes
Fields inherited from interface com.lowagie.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
-
Constructor Summary
ConstructorsConstructorDescriptionMarkedSection
(Section section) Creates a MarkedObject with a Section or Chapter object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aParagraph
,List
orTable
to thisSection
.boolean
Adds aParagraph
,List
,Table
or anotherSection
to thisSection
.boolean
addAll
(Collection<? extends Element> collection) Adds a collection ofElement
s to thisSection
.Creates aSection
, adds it to thisSection
and returns it.addSection
(float indentation) Creates aSection
, adds it to thisSection
and returns it.addSection
(float indentation, int numberDepth) Creates aSection
, adds it to thisSection
and returns it.addSection
(int numberDepth) Creates aSection
, add it to thisSection
and returns it.getTitle()
Gets the title of this MarkedSection.void
newPage()
Adds a new page to the section.boolean
process
(ElementListener listener) Processes the element by adding it (or the different parts) to anElementListener
.void
setBookmarkOpen
(boolean bookmarkOpen) Setter for property bookmarkOpen.void
setBookmarkTitle
(String bookmarkTitle) Sets the bookmark title.void
setIndentation
(float indentation) Sets the indentation of the content of thisSection
.void
setIndentationLeft
(float indentation) Sets the indentation of thisSection
on the left side.void
setIndentationRight
(float indentation) Sets the indentation of thisSection
on the right side.void
setNumberDepth
(int numberDepth) Sets the depth of the sectionnumbers that will be shown preceding the title.void
setTitle
(MarkedObject title) Sets the title of this section.void
setTriggerNewPage
(boolean triggerNewPage) Setter for property triggerNewPage.Methods inherited from class com.lowagie.text.MarkedObject
getChunks, getMarkupAttributes, isContent, isNestable, setMarkupAttribute, type
-
Field Details
-
title
This is the title of this section.
-
-
Constructor Details
-
MarkedSection
Creates a MarkedObject with a Section or Chapter object.- Parameters:
section
- the marked section
-
-
Method Details
-
add
Adds aParagraph
,List
orTable
to thisSection
.- Parameters:
index
- index at which the specified element is to be insertedo
- an object of typeParagraph
,List
orTable
=- Throws:
ClassCastException
- if the object is not aParagraph
,List
orTable
-
add
Adds aParagraph
,List
,Table
or anotherSection
to thisSection
.- Parameters:
o
- an object of typeParagraph
,List
,Table
or anotherSection
- Returns:
- a boolean
- Throws:
ClassCastException
- if the object is not aParagraph
,List
,Table
orSection
-
process
Processes the element by adding it (or the different parts) to anElementListener
.- Specified by:
process
in interfaceElement
- Overrides:
process
in classMarkedObject
- Parameters:
listener
- anElementListener
- Returns:
true
if the element was processed successfully
-
addAll
Adds a collection ofElement
s to thisSection
.- Parameters:
collection
- a collection ofParagraph
s,List
s and/orTable
s- Returns:
true
if the action succeeded,false
if not.- Throws:
ClassCastException
- if one of the objects isn't aParagraph
,List
,Table
-
addSection
Creates aSection
, adds it to thisSection
and returns it.- Parameters:
indentation
- the indentation of the new sectionnumberDepth
- the numberDepth of the section- Returns:
- a new Section object
-
addSection
Creates aSection
, adds it to thisSection
and returns it.- Parameters:
indentation
- the indentation of the new section- Returns:
- a new Section object
-
addSection
Creates aSection
, add it to thisSection
and returns it.- Parameters:
numberDepth
- the numberDepth of the section- Returns:
- a new Section object
-
addSection
Creates aSection
, adds it to thisSection
and returns it.- Returns:
- a new Section object
-
getTitle
Gets the title of this MarkedSection.- Returns:
- a MarkObject with a Paragraph containing the title of a Section
- Since:
- iText 2.0.8
-
setTitle
Sets the title of this section.- Parameters:
title
- the new title
-
setNumberDepth
public void setNumberDepth(int numberDepth) Sets the depth of the sectionnumbers that will be shown preceding the title.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
-
setIndentationLeft
public void setIndentationLeft(float indentation) Sets the indentation of thisSection
on the left side.- Parameters:
indentation
- the indentation
-
setIndentationRight
public void setIndentationRight(float indentation) Sets the indentation of thisSection
on the right side.- Parameters:
indentation
- the indentation
-
setIndentation
public void setIndentation(float indentation) Sets the indentation of the content of thisSection
.- Parameters:
indentation
- the indentation
-
setBookmarkOpen
public void setBookmarkOpen(boolean bookmarkOpen) Setter for property bookmarkOpen.- Parameters:
bookmarkOpen
- false if the bookmark children are not visible.
-
setTriggerNewPage
public void setTriggerNewPage(boolean triggerNewPage) Setter for property triggerNewPage.- Parameters:
triggerNewPage
- true if a new page has to be triggered.
-
setBookmarkTitle
Sets the bookmark title. The bookmark title is the same as the section title but can be changed with this method.- Parameters:
bookmarkTitle
- the bookmark title
-
newPage
public void newPage()Adds a new page to the section.- Since:
- 2.1.1
-