|
||||||||||
| 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 | |
|---|---|
List |
addList()
Add a new List to this container. |
List |
addList(ListDecorator decorator)
Add a List with specified ListDecorator to this container. |
Paragraph |
addParagraph(String textContent)
Add paragraph at the end of the container with specified text content. |
Table |
addTable()
Add a new Table to this container. |
Table |
addTable(int numRows,
int numCols)
Add a new Table to this container with a specified row number and column number. |
void |
clearList()
Remove all Lists from this container. |
boolean |
equals(Object obj)
|
ProtectionKeyDigestProvider |
getDefaultProtectionKeyDigestProvider()
Get the default provider which use SHA-1 standard as the protection key digest algorithm. |
Section |
getEmbeddedSectionByName(String chdSecName)
Looks for an embedded section with a given name. |
static Section |
getInstance(TextSectionElement element)
Get a section instance by an object of TextSectionElement. |
OdfElement |
getListContainerElement()
Get the ODF element which can have |
Iterator<List> |
getListIterator()
Return an Iterator of the Lists in this ListContainer. |
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. |
String |
getProtectedPassword()
Get the protection key of this section. |
String |
getProtectionKeyDigestAlgorithm()
Get the protection key digest algorithm. |
ProtectionKeyDigestProvider |
getProtectionKeyDigestProvier()
Get current used provider which provides corresponding protection key digest algorithm. |
Table.TableBuilder |
getTableBuilder()
Return the table builder of this document. |
Table |
getTableByName(String name)
Return an instance of table feature with the specific table name. |
OdfElement |
getTableContainerElement()
Get the ODF element which can have |
protected TableContainer |
getTableContainerImpl()
|
List<Table> |
getTableList()
Return a list of table features in this document. |
boolean |
isProtected()
Return the value of section which specifies whether the section is protected. |
void |
remove()
Remove this section from the document. |
boolean |
removeList(List list)
Remove the existing List from this container. |
boolean |
removeParagraph(Paragraph para)
Remove paragraph from the container |
void |
setName(String name)
Set the value of this section name |
void |
setProtected(boolean isProtected)
Set the value to specify whether the section is protected. |
void |
setProtectedWithPassword(String key)
Set the password which specifies that an authorization is required for removing the protection of this section. |
void |
setProtectionKeyDigestProvider(ProtectionKeyDigestProvider provider)
Set the provider which provides corresponding protection key digest algorithm. |
| 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
TextSectionElementpublic Document getOwnerDocument()
getOwnerDocument in class Componentpublic 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 ComponentTextSectionElement which represents
this sectionpublic void setProtected(boolean isProtected)
If this value is set to false, the existing password will be removed at the same.
isProtected - - "true" represents the section cannot be edited through a
user interface. "false" represents the section is allowed to
be edited.public boolean isProtected()
public void setProtectedWithPassword(String key)
If key is empty or null, the attribute of
text:protection-key and
text:protection-key-digest-algorithm will be removed.
The authentication procedure can be customized by
setProtectionKeyDigestProvider(ProtectionKeyDigestProvider)
. The default digest algorighom of the protection key is SHA-1:
http://www.w3.org/2000/09/xmldsig#sha1.
key - -the value of the password.public String getProtectedPassword()
public String getProtectionKeyDigestAlgorithm()
The default value is http://www.w3.org/2000/09/xmldsig#sha1, if no value specified.
public void setProtectionKeyDigestProvider(ProtectionKeyDigestProvider provider)
provider - - an instance of a protection key digest algorithm providerpublic ProtectionKeyDigestProvider getProtectionKeyDigestProvier()
public ProtectionKeyDigestProvider getDefaultProtectionKeyDigestProvider()
public boolean equals(Object obj)
equals in class Objectpublic Paragraph addParagraph(String textContent)
ParagraphContainer
addParagraph in interface ParagraphContainertextContent - - the text content
public OdfElement getParagraphContainerElement()
ParagraphContainer
getParagraphContainerElement in interface ParagraphContainerpublic boolean removeParagraph(Paragraph para)
ParagraphContainer
removeParagraph in interface ParagraphContainerpara - - the instance of paragraph
public Paragraph getParagraphByIndex(int index,
boolean isEmptyParagraphSkipped)
ParagraphContainerAn index of zero represents the first paragraph.
If empty paragraph is skipped, the empty paragraph won't be counted.
getParagraphByIndex in interface ParagraphContainerindex - - the index started from 0.isEmptyParagraphSkipped - - whether the empty paragraph is skipped or not
public Paragraph getParagraphByReverseIndex(int reverseIndex,
boolean isEmptyParagraphSkipped)
ParagraphContainerAn index of zero represents the last paragraph.
If empty paragraph is skipped, the empty paragraph won't be counted.
getParagraphByReverseIndex in interface ParagraphContainerreverseIndex - - 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 ParagraphContainerprotected TableContainer getTableContainerImpl()
public Table addTable()
TableContainer
addTable in interface TableContainer
public Table addTable(int numRows,
int numCols)
TableContainer
The table will be inserted at the end of the tableContainer. An unique
table name will be given, you may set a custom table name using the
setTableName method.
addTable in interface TableContainernumRows - the row numbernumCols - the column number
Tablepublic Table.TableBuilder getTableBuilder()
TableContainer
getTableBuilder in interface TableContainerpublic Table getTableByName(String name)
TableContainer
getTableByName in interface TableContainername - of the table being searched for.
public OdfElement getTableContainerElement()
TableContainer
getTableContainerElement in interface TableContainerpublic List<Table> getTableList()
TableContainer
getTableList in interface TableContainerpublic List addList()
ListContainer
addList in interface ListContainerpublic List addList(ListDecorator decorator)
ListContainer
addList in interface ListContainerdecorator - the specified ListDecorator
public void clearList()
ListContainer
clearList in interface ListContainerpublic OdfElement getListContainerElement()
ListContainer
getListContainerElement in interface ListContainerpublic Iterator<List> getListIterator()
ListContainer
getListIterator in interface ListContainerIteratorpublic boolean removeList(List list)
ListContainer
removeList in interface ListContainerpublic Section getEmbeddedSectionByName(String chdSecName)
chdSecName - Section name looked for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||