org.apache.fop.render.rtf.rtflib.rtfdoc

## Class RtfText

- java.lang.Object
- - org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
  - - org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText

-     public class RtfText
      extends RtfElement

  Model of a text run (a piece of text with attributes) in an RTF document.

  This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ALIGN_CENTER` constant for align center
    `static java.lang.String` | `ALIGN_DISTRIBUTED` constant for align distributed
    `static java.lang.String` | `ALIGN_JUSTIFIED` constant for align justified
    `static java.lang.String` | `ALIGN_LEFT` constant for align left
    `static java.lang.String` | `ALIGN_RIGHT` constant for align right
    `static java.lang.String[]` | `ALIGNMENT` RtfText attributes: this must contain all allignment attributes names
    `static java.lang.String` | `ATTR_BACKGROUND_COLOR` constant for background color
    `static java.lang.String` | `ATTR_BOLD` constant for bold
    `static java.lang.String` | `ATTR_FONT_COLOR` constant for font color
    `static java.lang.String` | `ATTR_FONT_FAMILY` constant for font family
    `static java.lang.String` | `ATTR_FONT_SIZE` constant for font size
    `static java.lang.String` | `ATTR_ITALIC` constant for italic
    `static java.lang.String[]` | `ATTR_NAMES` RtfText attributes: this must contain all attribute names
    `static java.lang.String` | `ATTR_STRIKETHROUGH` constant for underline
    `static java.lang.String` | `ATTR_SUBSCRIPT` constant for subscript
    `static java.lang.String` | `ATTR_SUPERSCRIPT` constant for superscript
    `static java.lang.String` | `ATTR_UNDERLINE` constant for underline
    `static java.lang.String` | `BDR_BOTTOM_DASH` constant for bottom dashed border
    `static java.lang.String` | `BDR_BOTTOM_DOTTED` constant for bottom dotted border
    `static java.lang.String` | `BDR_BOTTOM_DOUBLE` constant for bottom double border
    `static java.lang.String` | `BDR_BOTTOM_EMBOSS` constant for bottom embossed border
    `static java.lang.String` | `BDR_BOTTOM_SINGLE` constant for bottom single border
    `static java.lang.String[]` | `BORDER` RtfText attributes:: this must contain all border attribute names
    `static int` | `FULL_SHADING` Constant for the 100% shading of the paragraph
    `static java.lang.String[]` | `INDENT` String array of indent constants
    `static java.lang.String` | `LEFT_INDENT_BODY` constant for left indent body
    `static java.lang.String` | `LEFT_INDENT_FIRST` constant for left indent first
    `static java.lang.String` | `RIGHT_INDENT_BODY` constant for right indent body
    `static java.lang.String` | `RTF_FIELD` constant for field
    `static java.lang.String` | `RTF_FIELD_PAGE` constant for field page
    `static java.lang.String` | `RTF_FIELD_RESULT` constant for field result
    `static java.lang.String` | `SHADING` Constant for the shading of the paragraph
    `static java.lang.String` | `SHADING_FRONT_COLOR` Constant for the document's color tableshading of the paragraph
    `static java.lang.String` | `SPACE_AFTER` Space after a paragraph
    `static java.lang.String` | `SPACE_BEFORE` Space before/after a paragraph
    `static java.lang.String` | `TAB_CENTER` constant for center tab
    `static java.lang.String` | `TAB_LEADER_DOTS` constant for tab leader dots
    `static java.lang.String` | `TAB_LEADER_EQUALS` constant for tab leader equals
    `static java.lang.String` | `TAB_LEADER_HYPHEN` constant for tab leader hyphens
    `static java.lang.String` | `TAB_LEADER_THICK` constant for tab leader thick
    `static java.lang.String` | `TAB_LEADER_UNDER` constant for tab leader underscores
    `static java.lang.String` | `TAB_RIGHT` constant for right tab
    `static java.lang.String[]` | `TABS` String array of tab constants

    - ### Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

      `attrib, parent, writer`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RtfAttributes` | `getTextAttributes()`
    `RtfAttributes` | `getTextContainerAttributes()` IRtfTextContainer requirement:
    `boolean` | `isBold(boolean isStart)`
    `boolean` | `isEmpty()` Checks whether the text is empty.
    `boolean` | `isNbsp()` True if text contains a single non-breaking space (#160).
    `boolean` | `isNewLine()`
    `boolean` | `isTab()`
    `void` | `writeRtfContent()` Write our text to the RTF stream

    - ### Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

      `close, getParentOfClass, getRtfAttributes, newLine, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ATTR_BOLD

          public static final java.lang.String ATTR_BOLD

      constant for bold
      See Also:
        Constant Field Values

    - #### ATTR_ITALIC

          public static final java.lang.String ATTR_ITALIC

      constant for italic
      See Also:
        Constant Field Values

    - #### ATTR_UNDERLINE

          public static final java.lang.String ATTR_UNDERLINE

      constant for underline
      See Also:
        Constant Field Values

    - #### ATTR_STRIKETHROUGH

          public static final java.lang.String ATTR_STRIKETHROUGH

      constant for underline
      See Also:
        Constant Field Values

    - #### ATTR_FONT_SIZE

          public static final java.lang.String ATTR_FONT_SIZE

      constant for font size
      See Also:
        Constant Field Values

    - #### ATTR_FONT_FAMILY

          public static final java.lang.String ATTR_FONT_FAMILY

      constant for font family
      See Also:
        Constant Field Values

    - #### ATTR_FONT_COLOR

          public static final java.lang.String ATTR_FONT_COLOR

      constant for font color
      See Also:
        Constant Field Values

    - #### ATTR_BACKGROUND_COLOR

          public static final java.lang.String ATTR_BACKGROUND_COLOR

      constant for background color
      See Also:
        Constant Field Values

    - #### ATTR_SUPERSCRIPT

          public static final java.lang.String ATTR_SUPERSCRIPT

      constant for superscript
      See Also:
        Constant Field Values

    - #### ATTR_SUBSCRIPT

          public static final java.lang.String ATTR_SUBSCRIPT

      constant for subscript
      See Also:
        Constant Field Values

    - #### SHADING

          public static final java.lang.String SHADING

      Constant for the shading of the paragraph
      See Also:
        Constant Field Values

    - #### SHADING_FRONT_COLOR

          public static final java.lang.String SHADING_FRONT_COLOR

      Constant for the document's color tableshading of the paragraph
      See Also:
        Constant Field Values

    - #### FULL_SHADING

          public static final int FULL_SHADING

      Constant for the 100% shading of the paragraph
      See Also:
        Constant Field Values

    - #### ALIGN_CENTER

          public static final java.lang.String ALIGN_CENTER

      constant for align center
      See Also:
        Constant Field Values

    - #### ALIGN_LEFT

          public static final java.lang.String ALIGN_LEFT

      constant for align left
      See Also:
        Constant Field Values

    - #### ALIGN_RIGHT

          public static final java.lang.String ALIGN_RIGHT

      constant for align right
      See Also:
        Constant Field Values

    - #### ALIGN_JUSTIFIED

          public static final java.lang.String ALIGN_JUSTIFIED

      constant for align justified
      See Also:
        Constant Field Values

    - #### ALIGN_DISTRIBUTED

          public static final java.lang.String ALIGN_DISTRIBUTED

      constant for align distributed
      See Also:
        Constant Field Values

    - #### BDR_BOTTOM_SINGLE

          public static final java.lang.String BDR_BOTTOM_SINGLE

      constant for bottom single border
      See Also:
        Constant Field Values

    - #### BDR_BOTTOM_DOUBLE

          public static final java.lang.String BDR_BOTTOM_DOUBLE

      constant for bottom double border
      See Also:
        Constant Field Values

    - #### BDR_BOTTOM_EMBOSS

          public static final java.lang.String BDR_BOTTOM_EMBOSS

      constant for bottom embossed border
      See Also:
        Constant Field Values

    - #### BDR_BOTTOM_DOTTED

          public static final java.lang.String BDR_BOTTOM_DOTTED

      constant for bottom dotted border
      See Also:
        Constant Field Values

    - #### BDR_BOTTOM_DASH

          public static final java.lang.String BDR_BOTTOM_DASH

      constant for bottom dashed border
      See Also:
        Constant Field Values

    - #### RTF_FIELD

          public static final java.lang.String RTF_FIELD

      constant for field
      See Also:
        Constant Field Values

    - #### RTF_FIELD_PAGE

          public static final java.lang.String RTF_FIELD_PAGE

      constant for field page
      See Also:
        Constant Field Values

    - #### RTF_FIELD_RESULT

          public static final java.lang.String RTF_FIELD_RESULT

      constant for field result
      See Also:
        Constant Field Values

    - #### LEFT_INDENT_BODY

          public static final java.lang.String LEFT_INDENT_BODY

      constant for left indent body
      See Also:
        Constant Field Values

    - #### LEFT_INDENT_FIRST

          public static final java.lang.String LEFT_INDENT_FIRST

      constant for left indent first
      See Also:
        Constant Field Values

    - #### RIGHT_INDENT_BODY

          public static final java.lang.String RIGHT_INDENT_BODY

      constant for right indent body
      See Also:
        Constant Field Values

    - #### TAB_CENTER

          public static final java.lang.String TAB_CENTER

      constant for center tab
      See Also:
        Constant Field Values

    - #### TAB_RIGHT

          public static final java.lang.String TAB_RIGHT

      constant for right tab
      See Also:
        Constant Field Values

    - #### TAB_LEADER_DOTS

          public static final java.lang.String TAB_LEADER_DOTS

      constant for tab leader dots
      See Also:
        Constant Field Values

    - #### TAB_LEADER_HYPHEN

          public static final java.lang.String TAB_LEADER_HYPHEN

      constant for tab leader hyphens
      See Also:
        Constant Field Values

    - #### TAB_LEADER_UNDER

          public static final java.lang.String TAB_LEADER_UNDER

      constant for tab leader underscores
      See Also:
        Constant Field Values

    - #### TAB_LEADER_THICK

          public static final java.lang.String TAB_LEADER_THICK

      constant for tab leader thick
      See Also:
        Constant Field Values

    - #### TAB_LEADER_EQUALS

          public static final java.lang.String TAB_LEADER_EQUALS

      constant for tab leader equals
      See Also:
        Constant Field Values

    - #### SPACE_BEFORE

          public static final java.lang.String SPACE_BEFORE

      Space before/after a paragraph
      See Also:
        Constant Field Values

    - #### SPACE_AFTER

          public static final java.lang.String SPACE_AFTER

      Space after a paragraph
      See Also:
        Constant Field Values

    - #### ALIGNMENT

          public static final java.lang.String[] ALIGNMENT

      RtfText attributes: this must contain all allignment attributes names

    - #### BORDER

          public static final java.lang.String[] BORDER

      RtfText attributes:: this must contain all border attribute names

    - #### INDENT

          public static final java.lang.String[] INDENT

      String array of indent constants

    - #### TABS

          public static final java.lang.String[] TABS

      String array of tab constants

    - #### ATTR_NAMES

          public static final java.lang.String[] ATTR_NAMES

      RtfText attributes: this must contain all attribute names

  - ### Method Detail

    - #### writeRtfContent

          public void writeRtfContent()
                               throws java.io.IOException

      Write our text to the RTF stream
      Specified by:
        `writeRtfContent` in class `RtfElement`
      Throws:
        `java.io.IOException` - for I/O problems

    - #### getTextContainerAttributes

          public RtfAttributes getTextContainerAttributes()
                                                   throws FOPException

      IRtfTextContainer requirement:
      Returns:
        a copy of our attributes
      Throws:
        `FOPException` - if attributes cannot be cloned

    - #### isEmpty

          public boolean isEmpty()

      Checks whether the text is empty.
      Specified by:
        `isEmpty` in class `RtfElement`
      Returns:
        true If m_text is null\n false m_text is set

    - #### isNbsp

          public boolean isNbsp()

      True if text contains a single non-breaking space (#160). TODO make this more general and/or merge with isEmpty? -- what happen with empty paragraphs, if they will be removed, than NO, else ok
      Returns:
        true If m_text is character 160\n false m_text is not a nbsp

    - #### isTab

          public boolean isTab()

      Returns:
        true if the text is a tab character

    - #### isNewLine

          public boolean isNewLine()

      Returns:
        true if text is a newline character

    - #### isBold

          public boolean isBold(boolean isStart)

      Parameters:
        `isStart` - set to true if processing the start of the text (??)
      Returns:
        true if text is bold

    - #### getTextAttributes

          public RtfAttributes getTextAttributes()

      Returns:
        the attributes of our text

Copyright 1999-2021 The Apache Software Foundation. All Rights Reserved.