Paragraph
, List
or Table
* to this Section
.
*
* @param index index at which the specified element is to be inserted
* @param o an object of type Paragraph
, List
or Table
=
* @throws ClassCastException if the object is not a Paragraph
, List
or Table
* @since 5.0.1 (signature changed to use Element)
*/
public void add(int index, Element o) {
((Section)element).add(index, o);
}
/**
* Adds a Paragraph
, List
, Table
or another Section
* to this Section
.
*
* @param o an object of type Paragraph
, List
, Table
or another Section
* @return a boolean
* @throws ClassCastException if the object is not a Paragraph
, List
, Table
or Section
* @since 5.0.1 (signature changed to use Element)
*/
public boolean add(Element o) {
return ((Section)element).add(o);
}
/**
* Processes the element by adding it (or the different parts) to an
* ElementListener
.
*
* @param listener an ElementListener
* @return true
if the element was processed successfully
*/
@Override
public boolean process(ElementListener listener) {
try {
Element element;
for (IteratorElement
s
* to this Section
.
*
* @param collection a collection of Paragraph
s, List
s and/or Table
s
* @return true
if the action succeeded, false
if not.
* @throws ClassCastException if one of the objects isn't a Paragraph
, List
, Table
*/
public boolean addAll(Collection extends Element> collection) {
return ((Section)element).addAll(collection);
}
/**
* Creates a Section
, adds it to this Section
and returns it.
*
* @param indentation the indentation of the new section
* @param numberDepth the numberDepth of the section
* @return a new Section object
*/
public MarkedSection addSection(float indentation, int numberDepth) {
MarkedSection section = ((Section)element).addMarkedSection();
section.setIndentation(indentation);
section.setNumberDepth(numberDepth);
return section;
}
/**
* Creates a Section
, adds it to this Section
and returns it.
*
* @param indentation the indentation of the new section
* @return a new Section object
*/
public MarkedSection addSection(float indentation) {
MarkedSection section = ((Section)element).addMarkedSection();
section.setIndentation(indentation);
return section;
}
/**
* Creates a Section
, add it to this Section
and returns it.
*
* @param numberDepth the numberDepth of the section
* @return a new Section object
*/
public MarkedSection addSection(int numberDepth) {
MarkedSection section = ((Section)element).addMarkedSection();
section.setNumberDepth(numberDepth);
return section;
}
/**
* Creates a Section
, adds it to this Section
and returns it.
*
* @return a new Section object
*/
public MarkedSection addSection() {
return ((Section)element).addMarkedSection();
}
// public methods
/**
* Sets the title of this section.
*
* @param title the new title
*/
public void setTitle(MarkedObject title) {
if (title.element instanceof Paragraph)
this.title = title;
}
/**
* Gets the title of this MarkedSection.
* @return a MarkObject with a Paragraph containing the title of a Section
* @since iText 2.0.8
*/
public MarkedObject getTitle() {
Paragraph result = Section.constructTitle((Paragraph)title.element, ((Section)element).numbers, ((Section)element).numberDepth, ((Section)element).numberStyle);
MarkedObject mo = new MarkedObject(result);
mo.markupAttributes = title.markupAttributes;
return mo;
}
/**
* 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.
*
* @param numberDepth the new numberDepth
*/
public void setNumberDepth(int numberDepth) {
((Section)element).setNumberDepth(numberDepth);
}
/**
* Sets the indentation of this Section
on the left side.
*
* @param indentation the indentation
*/
public void setIndentationLeft(float indentation) {
((Section)element).setIndentationLeft(indentation);
}
/**
* Sets the indentation of this Section
on the right side.
*
* @param indentation the indentation
*/
public void setIndentationRight(float indentation) {
((Section)element).setIndentationRight(indentation);
}
/**
* Sets the indentation of the content of this Section
.
*
* @param indentation the indentation
*/
public void setIndentation(float indentation) {
((Section)element).setIndentation(indentation);
}
/** Setter for property bookmarkOpen.
* @param bookmarkOpen false if the bookmark children are not
* visible.
*/
public void setBookmarkOpen(boolean bookmarkOpen) {
((Section)element).setBookmarkOpen(bookmarkOpen);
}
/**
* Setter for property triggerNewPage.
* @param triggerNewPage true if a new page has to be triggered.
*/
public void setTriggerNewPage(boolean triggerNewPage) {
((Section)element).setTriggerNewPage(triggerNewPage);
}
/**
* Sets the bookmark title. The bookmark title is the same as the section title but
* can be changed with this method.
* @param bookmarkTitle the bookmark title
*/
public void setBookmarkTitle(String bookmarkTitle) {
((Section)element).setBookmarkTitle(bookmarkTitle);
}
/**
* Adds a new page to the section.
* @since 2.1.1
*/
public void newPage() {
((Section)element).newPage();
}
/* (non-Javadoc)
* @see com.lowagie.text.api.Indentable#getIndentationLeft()
*/
public float getIndentationLeft() {
return ((Section)element).getIndentationLeft();
}
/* (non-Javadoc)
* @see com.lowagie.text.api.Indentable#getIndentationRight()
*/
public float getIndentationRight() {
return ((Section)element).getIndentationRight();
}
}