Class TextUtils

java.lang.Object
com.inductiveautomation.snap.text.TextUtils
All Implemented Interfaces:
RMTypes, TextTypes

public class TextUtils extends Object implements TextTypes
Text Utilities.
  • Constructor Details

    • TextUtils

      public TextUtils()
  • Method Details

    • indexOfNewline

      public static int indexOfNewline(CharSequence aSequence, int aStart)
      Returns the index of the next newline (or carriage-return/newline) in given char sequence starting at given char index.
    • indexAfterNewline

      public static int indexAfterNewline(CharSequence aSequence, int aStart)
      Returns the index just beyond next newline (or carriage-return/newline) in given char sequence starting at given char index.
    • lastIndexOfNewline

      public static int lastIndexOfNewline(CharSequence aSequence, int aStart)
      Returns the index of the previous newline (or carriage-return/newline) in given char sequence starting at given char index.
    • lastIndexAfterNewline

      public static int lastIndexAfterNewline(CharSequence aSequence, int aStart)
      Returns the index just beyond previous newline (or carriage-return/newline) in given char sequence starting at given char index.
    • isLineEnd

      public static boolean isLineEnd(CharSequence aSequence, int anIndex)
      Returns whether the index in the given char sequence is at a line end.
    • isAfterLineEnd

      public static boolean isAfterLineEnd(CharSequence aSequence, int anIndex)
      Returns whether the index in the given char sequence is at just after a line end.
    • isNewlineChar

      public static boolean isNewlineChar(CharSequence aSequence, int anIndex)
      Returns whether a char is a newline char.
    • isUnderlined

      public static boolean isUnderlined(Map attrs)
      Returns whether this run is underlined.
    • getUnderlineStyle

      public static int getUnderlineStyle(Map attrs)
      Returns the underline style of this run.
    • getAttributes

      public static Map getAttributes(Object... theAttrs)
      Returns an attribute map for given attributes.
    • getAttributeKey

      public static String getAttributeKey(Object anAttr)
      Returns the most likely key for a given attribute.