|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.Component
org.odftoolkit.simple.text.Section
public class Section
This class represents section definition in text document. It provides methods to manipulate section in text document, such as getting/setting section name, moving section and so on.
Method Summary | |
---|---|
Paragraph |
addParagraph(String textContent)
Add paragraph at the end of the container with specified text content. |
boolean |
equals(Object obj)
|
static Section |
getInstance(TextSectionElement element)
Get a section instance by an object of TextSectionElement . |
String |
getName()
Return the name of this section |
TextSectionElement |
getOdfElement()
Return an instance of TextSectionElement which represents
this section. |
Document |
getOwnerDocument()
Return the ODF document which this section belongs to. |
Paragraph |
getParagraphByIndex(int index,
boolean isEmptyParagraphSkipped)
Return a paragraph with a given index. |
Paragraph |
getParagraphByReverseIndex(int reverseIndex,
boolean isEmptyParagraphSkipped)
Return a paragraph with a given index. |
OdfElement |
getParagraphContainerElement()
Get the ODF element which can have |
Iterator<Paragraph> |
getParagraphIterator()
Return an Iterator of the paragraph in this container. |
void |
remove()
Remove this section from the document. |
boolean |
removeParagraph(Paragraph para)
Remove paragraph from the container |
void |
setName(String name)
Set the value of this section name |
Methods inherited from class org.odftoolkit.simple.Component |
---|
getComponentByElement, registerComponent, unregisterComponent |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Section getInstance(TextSectionElement element)
TextSectionElement
.
element
- - an object of TextSectionElement
Section
that can represent
TextSectionElement
public Document getOwnerDocument()
getOwnerDocument
in class Component
public String getName()
public void setName(String name)
name
- - the value of name to be setpublic void remove()
All the linked resources which are only linked to this section will be removed too.
public TextSectionElement getOdfElement()
TextSectionElement
which represents
this section.
getOdfElement
in class Component
TextSectionElement
which represents
this sectionpublic boolean equals(Object obj)
equals
in class Object
public Paragraph addParagraph(String textContent)
ParagraphContainer
addParagraph
in interface ParagraphContainer
textContent
- - the text content
public OdfElement getParagraphContainerElement()
ParagraphContainer
getParagraphContainerElement
in interface ParagraphContainer
public boolean removeParagraph(Paragraph para)
ParagraphContainer
removeParagraph
in interface ParagraphContainer
para
- - the instance of paragraph
public Paragraph getParagraphByIndex(int index, boolean isEmptyParagraphSkipped)
ParagraphContainer
An index of zero represents the first paragraph.
If empty paragraph is skipped, the empty paragraph won't be counted.
getParagraphByIndex
in interface ParagraphContainer
index
- - the index started from 0.isEmptyParagraphSkipped
- - whether the empty paragraph is skipped or not
public Paragraph getParagraphByReverseIndex(int reverseIndex, boolean isEmptyParagraphSkipped)
ParagraphContainer
An index of zero represents the last paragraph.
If empty paragraph is skipped, the empty paragraph won't be counted.
getParagraphByReverseIndex
in interface ParagraphContainer
reverseIndex
- - the index started from 0 in reverse order.isEmptyParagraphSkipped
- - whether the empty paragraph is skipped or not
public Iterator<Paragraph> getParagraphIterator()
ParagraphContainer
getParagraphIterator
in interface ParagraphContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |