Class PopupHelpItem

java.lang.Object
mars.venus.editor.jeditsyntax.PopupHelpItem

public class PopupHelpItem extends Object
Handy little class to contain help information for a popupMenu or tool tip item.
  • Constructor Details

    • PopupHelpItem

      public PopupHelpItem(String tokenText, String example, String description, boolean isExact)
      Create popup help item. This is created as result of either an exact-match or prefix-match search. Note that prefix-match search includes exact as well as partial matches.
      Parameters:
      tokenText - The document text that matched.
      example - An example instruction.
      description - A textual description of the instruction.
      isExact - True if match occurred as result of exact-match search, false otherwise.
    • PopupHelpItem

      public PopupHelpItem(String tokenText, String example, String description)
      Create popup help item, where match is result of an exact-match search.
      Parameters:
      tokenText - The document text that matched
      example - An example instruction
      description - A textual description of the instruction
  • Method Details

    • getTokenText

      public String getTokenText()
      The document text that matched this item
    • getExample

      public String getExample()
    • getDescription

      public String getDescription()
    • getExact

      public boolean getExact()
      Determines whether match occurred in an exact-match or prefix-match search. Note this can return false even if the match is exact because prefix-match also includes exact match results. E.g. prefix match on "lw" will match both "lwl" and "lw".
      Returns:
      True if exact-match search, false otherwise.
    • getExampleLength

      public int getExampleLength()
    • getExamplePaddedToLength

      public String getExamplePaddedToLength(int length)
    • setExample

      public void setExample(String example)
    • setDescription

      public void setDescription(String description)
    • maxExampleLength

      public static int maxExampleLength(ArrayList<PopupHelpItem> matches)
      Utility method. Traverse ArrayList of PopupHelpItem objects and return String length of longest example.