Package mars.venus.editors.jeditsyntax
Class PopupHelpItem
java.lang.Object
mars.venus.editors.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 exact)
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 mached this itemstatic int
maxExampleLength(List<PopupHelpItem> matches)
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 matchedexample
- An example instructiondescription
- A textual description of the instructionexact
- 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 mached 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
-