Package com.independentsoft.office.odf
Class Heading
java.lang.Object
com.independentsoft.office.odf.Heading
- All Implemented Interfaces:
ICellContent,IContentElement,IIndexContent,ITextContent,IHeaderFooterContent
Define the division structure for a document. A chapter or section begins with a heading and extends to the next heading at the same or higher level.
-
Constructor Summary
ConstructorsConstructorDescriptionHeading()Initializes a new instance of the Heading class.Heading(InternalXMLStreamReader reader)Instantiates a new heading. -
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.Contains the hyperlink content.Returns all content elements.intgetLevel()Gets the level of a heading, starting with 1.Gets the text of a formatted number which is present when a list style is applied to an element whose corresponding list level style specifies that the list label is a number.Returns the parent content element.intGets the value that restarts numbering at the current heading.getStyle()Gets the style that shall have the family paragraph.booleanSpecifies the appearance of a specific heading without numbering.booleanSpecifies whether to restart the numbering of headings.voidsetLevel(int level)Sets the level of a heading, starting with 1.voidsetListHeader(boolean isListHeader)Specifies the appearance of a specific heading without numbering.voidSets the text of a formatted number which is present when a list style is applied to an element whose corresponding list level style specifies that the list label is a number.voidsetParent(IContentElement parent)Sets the parent content element.voidsetRestartNumbering(boolean restartNumbering)Specifies whether to restart the numbering of headings.voidsetStartValue(int startValue)Sets the value that restarts numbering at the current heading.voidSets the style that shall have the family paragraph.toString()Converts the value of the current Heading object to its equivalent string representation.
-
Constructor Details
-
Heading
public Heading()Initializes a new instance of the Heading class. -
Heading
Instantiates a new heading.- 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 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 Heading object to its equivalent string representation. -
getContent
Contains the hyperlink content.- Returns:
- the content
-
getLevel
public int getLevel()Gets the level of a heading, starting with 1. Headings without a level attribute are assumed to be at level 1.- Returns:
- the level
-
setLevel
public void setLevel(int level)Sets the level of a heading, starting with 1. Headings without a level attribute are assumed to be at level 1.- Parameters:
level- the new level
-
isRestartNumbering
public boolean isRestartNumbering()Specifies whether to restart the numbering of headings.- Returns:
- true, if is restart numbering
-
setRestartNumbering
public void setRestartNumbering(boolean restartNumbering)Specifies whether to restart the numbering of headings.- Parameters:
restartNumbering- the new restart numbering
-
getStartValue
public int getStartValue()Gets the value that restarts numbering at the current heading.- Returns:
- the start value
-
setStartValue
public void setStartValue(int startValue)Sets the value that restarts numbering at the current heading.- Parameters:
startValue- the new start value
-
isListHeader
public boolean isListHeader()Specifies the appearance of a specific heading without numbering.- Returns:
- true, if is list header
-
setListHeader
public void setListHeader(boolean isListHeader)Specifies the appearance of a specific heading without numbering.- Parameters:
isListHeader- the new list header
-
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
-
getNumber
Gets the text of a formatted number which is present when a list style is applied to an element whose corresponding list level style specifies that the list label is a number. This text may be used by consumers that do not support the automatic generation of numbering but should be ignored by consumers that do support it.- Returns:
- the number
-
setNumber
Sets the text of a formatted number which is present when a list style is applied to an element whose corresponding list level style specifies that the list label is a number. This text may be used by consumers that do not support the automatic generation of numbering but should be ignored by consumers that do support it.- Parameters:
number- the new number
-