Package com.independentsoft.office.odf
Class Paragraph
java.lang.Object
com.independentsoft.office.odf.Paragraph
- All Implemented Interfaces:
IDrawText,ICellContent,IContentElement,IIndexContent,ITextContent,IHeaderFooterContent
Represents a paragraph, which is the basic unit of text in an OpenDocument file.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of the Paragraph class.Paragraph(InternalXMLStreamReader reader)Instantiates a new paragraph. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Annotation annotation)Adds an Annotation object to the content.voidadd(AttributedText attributedText)Adds an AttributedText object to the content.voidAdds a Bookmark object to the content.voidadd(BookmarkEnd bookmarkEnd)Adds a BookmarkEnd object to the content.voidadd(BookmarkStart bookmarkStart)Adds a BookmarkStart object to the content.voidAdds a Change object to the content.voidAdds a ChangeEnd object to the content.voidadd(ChangeStart changeStart)Adds a ChangeStart object to the content.voidAdds a Shape object to the content.voidAdds a Field object to the content.voidAdds a Hyperlink object to the content.voidadd(IParagraphContent paragraphContent)Adds an IParagraphContent object to the content.voidAdds a Note object to the content.voidadd(PointReference pointReference)Adds a PointReference object to the content.voidadd(RangeReference rangeReference)Adds a RangeReference object to the content.voidAdds a Ruby object to the content.voidAdds a Text object to the content.voidAdds a String object to the content.voidAdds a single line break to the content.voidaddSpace()Adds a single space to the content.voidaddSpace(int spaceCount)Adds a single space to the content.voidaddTab()Adds a single tab to the content.clone()Creates a new object that is a deep copy of the current instance.Gets a white space separated list of paragraph style names.Gets the conditional-style, that is, a style that contains conditions and maps to other styles.Contains a collection of paragraph content elements.Returns all content elements.getID()Gets an identifier for an element.Returns the parent content element.getStyle()Gets the style that shall have the family paragraph.voidsetClassNames(String classNames)Sets a white space separated list of paragraph style names.voidsetConditionalStyle(String conditionalStyle)Sets the conditional-style, that is, a style that contains conditions and maps to other styles.voidSets an identifier for an element.voidsetParent(IContentElement parent)Sets the parent content element.voidSets the style that shall have the family paragraph.toString()Converts the value of the current Paragraph object to its equivalent string representation.
-
Constructor Details
-
Paragraph
public Paragraph()Initializes a new instance of the Paragraph class. -
Paragraph
Instantiates a new paragraph.- Parameters:
reader- the reader- Throws:
XMLStreamException- the xML stream exception
-
-
Method Details
-
addSpace
public void addSpace()Adds a single space to the content. -
addSpace
public void addSpace(int spaceCount)Adds a single space to the content.- Parameters:
spaceCount- the space count
-
addTab
public void addTab()Adds a single tab to the content. -
addLineBreak
public void addLineBreak()Adds a single line break to the content. -
add
Adds a String object to the content.- Parameters:
text- the text
-
add
Adds a Text object to the content.- Parameters:
text- the text
-
add
Adds an Annotation object to the content.- Parameters:
annotation- the annotation
-
add
Adds an AttributedText object to the content.- Parameters:
attributedText- the attributed text
-
add
Adds a Hyperlink object to the content.- Parameters:
hyperlink- the hyperlink
-
add
Adds a Field object to the content.- Parameters:
field- the field
-
add
Adds a Bookmark object to the content.- Parameters:
bookmark- the bookmark
-
add
Adds a BookmarkStart object to the content.- Parameters:
bookmarkStart- the bookmark start
-
add
Adds a BookmarkEnd object to the content.- Parameters:
bookmarkEnd- the bookmark end
-
add
Adds a Change object to the content.- Parameters:
change- the change
-
add
Adds a ChangeEnd object to the content.- Parameters:
changeEnd- the change end
-
add
Adds a ChangeStart object to the content.- Parameters:
changeStart- the change start
-
add
Adds a Shape object to the content.- Parameters:
shape- the shape
-
add
Adds a Note object to the content.- Parameters:
note- the note
-
add
Adds a Ruby object to the content.- Parameters:
ruby- the ruby
-
add
Adds a PointReference object to the content.- Parameters:
pointReference- the point reference
-
add
Adds a RangeReference object to the content.- Parameters:
rangeReference- the range reference
-
add
Adds an IParagraphContent object to the content.- Parameters:
paragraphContent- the paragraph content
-
getContentElements
Returns all content elements.- Specified by:
getContentElementsin interfaceIContentElement- Returns:
- A collection of content elements.
-
getParent
Returns the parent content element.- Specified by:
getParentin interfaceIContentElement- Returns:
- the parent
-
setParent
Sets the parent content element.- Specified by:
setParentin interfaceIContentElement- Parameters:
parent- the new parent
-
clone
Creates a new object that is a deep copy of the current instance.- Specified by:
clonein interfaceICellContent- Specified by:
clonein interfaceIContentElement- Specified by:
clonein interfaceIDrawText- Specified by:
clonein interfaceIHeaderFooterContent- Specified by:
clonein interfaceIIndexContent- Specified by:
clonein interfaceITextContent- Overrides:
clonein classObject- Returns:
- A new object that is a copy of this instance.
-
toString
Converts the value of the current Paragraph object to its equivalent string representation. -
getContent
Contains a collection of paragraph content elements.- Returns:
- the content
-
getConditionalStyle
Gets the conditional-style, that is, a style that contains conditions and maps to other styles.- Returns:
- the conditional style
-
setConditionalStyle
Sets the conditional-style, that is, a style that contains conditions and maps to other styles.- Parameters:
conditionalStyle- the new conditional style
-
getClassNames
Gets a white space separated list of paragraph style names.- Returns:
- the class names
-
setClassNames
Sets a white space separated list of paragraph style names.- Parameters:
classNames- the new class names
-
getStyle
Gets the style that shall have the family paragraph. If a conditional style is applied, this attribute has the name of the style that was the result of the conditional style evaluation.- Returns:
- the style
-
setStyle
Sets the style that shall have the family paragraph. If a conditional style is applied, this attribute has the name of the style that was the result of the conditional style evaluation.- Parameters:
style- the new style
-
getID
Gets an identifier for an element.- Returns:
- the id
-
setID
Sets an identifier for an element.- Parameters:
id- the new id
-