Class SmartText

java.lang.Object
org.eclnt.jsfserver.util.SmartText
All Implemented Interfaces:
Serializable, IValueByToString

public class SmartText extends Object implements Serializable, IValueByToString
Object representation of a "smart text" - i.e. a character sequencing containing simple formatting instructions. The smart text is a "normal text" together with some sequentially oriented formatting information.

Example: the text "abcdefg" is the text content, "ab" should be formatted as underlined text, "de" should be formatted as bold text, in red color. In this case the representation would be: "abcdefg" is the text, from 0 to 2 the format "20" is applied, from 3 to 5 the format "11" is applied.

Please check the F_* constants for seeing what is possible in terms of formatting the text. Use the base format (e.g. F_BOLD) and add the color format (e.g. F_ADDCOLOR_RED) in order to define the corresponding format.

Please pay attention: format informations must never overlap - the definition of formats is strictly sequential!
See Also:
  • Field Details

  • Constructor Details

    • SmartText

      public SmartText(String csvText)
  • Method Details

    • getText

      public String getText()
    • addTextFormatInfo

      public void addTextFormatInfo(int beginOffset, int endOffset, int format)
    • clearFormatInfos

      public void clearFormatInfos()
    • setSmartTextCSV

      public void setSmartTextCSV(String csvText)
    • getSmartTextCSV

      public String getSmartTextCSV()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toHTMLString

      public String toHTMLString()