Package gda.jython.completion
Class AutoCompletion
java.lang.Object
gda.jython.completion.AutoCompletion
- All Implemented Interfaces:
Serializable
Container for possible text completions
Provides strings
The final line should be
>>> <before>|<chosen completion><after>
Provides strings
before and after that are the parts of the original line that
should remain either side of the cursor.
options is a list of AutoCompleteOptions that are possible
completions of the original string.The final line should be
>>> <before>|<chosen completion><after>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAutoCompletion(String before, String after, Collection<AutoCompleteOption> options, int position) -
Method Summary
Modifier and TypeMethodDescriptiongetAfter()The text from the original line that was after the cursor position and should not be replaced by the completionThe line up to the point where the completion is being inserted.
This is not always the cursor position where the completion was requestedintstatic AutoCompletionnoCompletions(String line, int posn) Return the an empty AutoCompletion from a line and positiontoString()
-
Constructor Details
-
AutoCompletion
public AutoCompletion(String before, String after, Collection<AutoCompleteOption> options, int position)
-
-
Method Details
-
noCompletions
Return the an empty AutoCompletion from a line and position- Parameters:
line- Current lineposn- Position of cursor in current line- Returns:
- An AutoCompletion as if there were no completions available
-
getOptions
-
getStrings
- Returns:
- List of strings that could replace the current string section
-
getPosition
public int getPosition()- Returns:
- Cursor position that completion should be inserted a
This should bebefore.length()
-
getBefore
The line up to the point where the completion is being inserted.
This is not always the cursor position where the completion was requested- Returns:
- line up to completion position
-
getAfter
The text from the original line that was after the cursor position and should not be replaced by the completion- Returns:
- String to be added after the completion
-
toString
-