Class OdfTextSpan

All Implemented Interfaces:
Serializable, Cloneable, OdfStylePropertySet, Element, ElementTraversal, EventTarget, Node, NodeList, TypeInfo

public class OdfTextSpan extends TextSpanElement
Convenient functionality for the parent ODF OpenDocument element
See Also:
  • Constructor Details

    • OdfTextSpan

      public OdfTextSpan(OdfFileDom ownerDoc)
    • OdfTextSpan

      public OdfTextSpan(OdfFileDom ownerDoc, String styleName)
      Creates a new instance of this class with the given style name. If the style name is null or the null string, no style is added.
      Parameters:
      ownerDoc - the XML file the Span belongs to
      styleName - the name of the style to be applied to the span
    • OdfTextSpan

      public OdfTextSpan(OdfFileDom ownerDoc, String styleName, String content)
      Creates an instance of this class with the given styleName and content. If the style name is null or the null string, no style is added. If the content is null or the null string, no content is added.
      Parameters:
      ownerDoc - the owner document DOM
      styleName - the style:style-name value
      content - the span content
  • Method Details

    • addContent

      public OdfTextSpan addContent(String content)
      Add the given content to the paragraph. If the content is null or the null string, no content is added.
      Parameters:
      content - the span content
      Returns:
      the span object
    • addContentWhitespace

      public OdfTextSpan addContentWhitespace(String content)
      Add the given content to the paragraph. If the content is null or the null string, no content is added. Embedded \n are converted to <text:line-break> elements, and multiple blanks to <text:s
      Parameters:
      content - the span content
      Returns:
      the span object
    • addStyledContent

      public OdfTextSpan addStyledContent(String styleName, String content)
      Set a span to have the given styleName and add the given content. If the style name is null or the null string, no style is added.
      Parameters:
      styleName - the style:style-name value
      content - the span content
      Returns:
      the span object
    • addStyledContentWhitespace

      public OdfTextSpan addStyledContentWhitespace(String styleName, String content)
      Set a span to have the given styleName and add the given content. If the style name is null or the null string, no style is added. Embedded \n are converted to <text:line-break> elements, and multiple blanks to <text:s
      Parameters:
      styleName - the style:style-name value
      content - the span content
      Returns:
      the span object