Class MultiLineStringUtil

java.lang.Object
com.inductiveautomation.ignition.common.util.gui.MultiLineStringUtil

public class MultiLineStringUtil extends Object
  • Constructor Details

    • MultiLineStringUtil

      public MultiLineStringUtil()
  • Method Details

    • toMultiLineStringFormat

      public static String[] toMultiLineStringFormat(String s)
      Convert a string to a multi line tooltip string using the default max character per line and max lines. By default it will format by word.
      Parameters:
      s - String to be formatted
      Returns:
      String array to be displayed
    • toMultiLineStringFormat

      public static String[] toMultiLineStringFormat(String s, boolean formatByWord)
      Convert a string to a multi line tooltip string using the default max character per line and max lines.
      Parameters:
      s - String to be formatted
      formatByWord - formatted by word by default, set to false to format by character
      Returns:
      String array to be displayed
    • toMultiLineStringFormat

      public static String[] toMultiLineStringFormat(String s, int max, int maxLines, boolean formatByWord)
      Convert a string to a multi line tooltip string given a max character per line
      Parameters:
      s - String to be formatted
      max - Max characters per line. Spaces COUNT towards the max.
      maxLines - Max number of lines. Use -1 (or any number less than 0) for indefinite number of lines.
      formatByWord - boolean to determine whether to format by word or by character
      Returns:
      String array to be displayed
    • toMultiLineByWord

      public static String[] toMultiLineByWord(String s, int max)
      Helper function to format string by words. DOES NOT take into account new lines.
      Parameters:
      s - String to be formatted
      max - Max characters per line. Spaces COUNT towards the max.
      Returns:
      String array formatted by word
    • toMultiLineByChar

      public static String[] toMultiLineByChar(String s, int max)
      Helper function to format string by characters. DOES NOT take into account new lines.
      Parameters:
      s - String to be formatted
      max - Max characters per line. Spaces COUNT towards the max.
      Returns:
      String array formatted by characters