Class Heading

java.lang.Object
com.independentsoft.office.odf.Heading
All Implemented Interfaces:
ICellContent, IContentElement, IIndexContent, ITextContent, IHeaderFooterContent

public class Heading extends Object implements 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

    Constructors
    Constructor
    Description
    Initializes a new instance of the Heading class.
    Instantiates a new heading.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add​(Annotation annotation)
    Adds an Annotation object to the content.
    void
    add​(AttributedText attributedText)
    Adds an AttributedText object to the content.
    void
    add​(Bookmark bookmark)
    Adds a Bookmark object to the content.
    void
    add​(BookmarkEnd bookmarkEnd)
    Adds a BookmarkEnd object to the content.
    void
    add​(BookmarkStart bookmarkStart)
    Adds a BookmarkStart object to the content.
    void
    add​(Change change)
    Adds a Change object to the content.
    void
    add​(ChangeEnd changeEnd)
    Adds a ChangeEnd object to the content.
    void
    add​(ChangeStart changeStart)
    Adds a ChangeStart object to the content.
    void
    add​(Shape shape)
    Adds a Shape object to the content.
    void
    add​(Field field)
    Adds a Field object to the content.
    void
    add​(Hyperlink hyperlink)
    Adds a Hyperlink object to the content.
    void
    add​(IParagraphContent paragraphContent)
    Adds an IParagraphContent object to the content.
    void
    add​(Note note)
    Adds a Note object to the content.
    void
    add​(PointReference pointReference)
    Adds a PointReference object to the content.
    void
    add​(RangeReference rangeReference)
    Adds a RangeReference object to the content.
    void
    add​(Ruby ruby)
    Adds a Ruby object to the content.
    void
    add​(Text text)
    Adds a Text object to the content.
    void
    add​(String text)
    Adds a String object to the content.
    void
    Adds a single line break to the content.
    void
    Adds a single space to the content.
    void
    addSpace​(int spaceCount)
    Adds a single space to the content.
    void
    Adds a single tab to the content.
    Creates a new object that is a deep copy of the current instance.
    Contains the hyperlink content.
    Returns all content elements.
    int
    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.
    int
    Gets the value that restarts numbering at the current heading.
    Gets the style that shall have the family paragraph.
    boolean
    Specifies the appearance of a specific heading without numbering.
    boolean
    Specifies whether to restart the numbering of headings.
    void
    setLevel​(int level)
    Sets the level of a heading, starting with 1.
    void
    setListHeader​(boolean isListHeader)
    Specifies the appearance of a specific heading without numbering.
    void
    setNumber​(String number)
    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.
    void
    Sets the parent content element.
    void
    setRestartNumbering​(boolean restartNumbering)
    Specifies whether to restart the numbering of headings.
    void
    setStartValue​(int startValue)
    Sets the value that restarts numbering at the current heading.
    void
    setStyle​(String style)
    Sets the style that shall have the family paragraph.
    Converts the value of the current Heading object to its equivalent string representation.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • 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

      public void add(String text)
      Adds a String object to the content.
      Parameters:
      text - the text
    • add

      public void add(Text text)
      Adds a Text object to the content.
      Parameters:
      text - the text
    • add

      public void add(Annotation annotation)
      Adds an Annotation object to the content.
      Parameters:
      annotation - the annotation
    • add

      public void add(AttributedText attributedText)
      Adds an AttributedText object to the content.
      Parameters:
      attributedText - the attributed text
    • add

      public void add(Hyperlink hyperlink)
      Adds a Hyperlink object to the content.
      Parameters:
      hyperlink - the hyperlink
    • add

      public void add(Field field)
      Adds a Field object to the content.
      Parameters:
      field - the field
    • add

      public void add(Bookmark bookmark)
      Adds a Bookmark object to the content.
      Parameters:
      bookmark - the bookmark
    • add

      public void add(BookmarkStart bookmarkStart)
      Adds a BookmarkStart object to the content.
      Parameters:
      bookmarkStart - the bookmark start
    • add

      public void add(BookmarkEnd bookmarkEnd)
      Adds a BookmarkEnd object to the content.
      Parameters:
      bookmarkEnd - the bookmark end
    • add

      public void add(Change change)
      Adds a Change object to the content.
      Parameters:
      change - the change
    • add

      public void add(ChangeEnd changeEnd)
      Adds a ChangeEnd object to the content.
      Parameters:
      changeEnd - the change end
    • add

      public void add(ChangeStart changeStart)
      Adds a ChangeStart object to the content.
      Parameters:
      changeStart - the change start
    • add

      public void add(Shape shape)
      Adds a Shape object to the content.
      Parameters:
      shape - the shape
    • add

      public void add(Note note)
      Adds a Note object to the content.
      Parameters:
      note - the note
    • add

      public void add(Ruby ruby)
      Adds a Ruby object to the content.
      Parameters:
      ruby - the ruby
    • add

      public void add(PointReference pointReference)
      Adds a PointReference object to the content.
      Parameters:
      pointReference - the point reference
    • add

      public void add(RangeReference rangeReference)
      Adds a RangeReference object to the content.
      Parameters:
      rangeReference - the range reference
    • add

      public void add(IParagraphContent paragraphContent)
      Adds an IParagraphContent object to the content.
      Parameters:
      paragraphContent - the paragraph content
    • getContentElements

      public List<IContentElement> getContentElements()
      Returns all content elements.
      Specified by:
      getContentElements in interface IContentElement
      Returns:
      A collection of content elements.
    • getParent

      public IContentElement getParent()
      Returns the parent content element.
      Specified by:
      getParent in interface IContentElement
      Returns:
      the parent
    • setParent

      public void setParent(IContentElement parent)
      Sets the parent content element.
      Specified by:
      setParent in interface IContentElement
      Parameters:
      parent - the new parent
    • clone

      public Heading clone()
      Creates a new object that is a deep copy of the current instance.
      Specified by:
      clone in interface ICellContent
      Specified by:
      clone in interface IContentElement
      Specified by:
      clone in interface IHeaderFooterContent
      Specified by:
      clone in interface IIndexContent
      Specified by:
      clone in interface ITextContent
      Overrides:
      clone in class Object
      Returns:
      A new object that is a copy of this instance.
    • toString

      public String toString()
      Converts the value of the current Heading object to its equivalent string representation.
      Overrides:
      toString in class Object
      Returns:
      the string
    • getContent

      public List<IParagraphContent> 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

      public String 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

      public void setStyle(String style)
      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

      public String 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

      public void setNumber(String number)
      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