Package mars.venus.editor.jeditsyntax
Class PopupHelpItem
java.lang.Object
mars.venus.editor.jeditsyntax.PopupHelpItem
Handy little class to contain help information for a popupMenu or
tool tip item.
-
Constructor Summary
ConstructorsConstructorDescriptionPopupHelpItem
(String tokenText, String example, String description) Create popup help item, where match is result of an exact-match search.PopupHelpItem
(String tokenText, String example, String description, boolean isExact) Create popup help item. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getExact()
Determines whether match occurred in an exact-match or prefix-match search.int
getExamplePaddedToLength
(int length) The document text that matched this itemstatic int
maxExampleLength
(ArrayList<PopupHelpItem> matches) Utility method.void
setDescription
(String description) void
setExample
(String example)
-
Constructor Details
-
PopupHelpItem
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
Create popup help item, where match is result of an exact-match search.- Parameters:
tokenText
- The document text that matchedexample
- An example instructiondescription
- A textual description of the instruction
-
-
Method Details
-
getTokenText
The document text that matched this item -
getExample
-
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
-
setExample
-
setDescription
-
maxExampleLength
Utility method. Traverse ArrayList of PopupHelpItem objects and return String length of longest example.
-