Interface CompleteOperation
- All Known Implementing Classes:
CompleteOperationImpl
public interface CompleteOperation
Interface representing a completion operation with candidates and configuration options.
- Author:
- Ståle W. Pedersen
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompletionCandidate(String completionCandidate) Add a completion candidate as a string.voidaddCompletionCandidate(TerminalString completionCandidate) Add a completion candidate.voidaddCompletionCandidates(List<String> completionCandidates) Add multiple completion candidates.voidaddCompletionCandidatesTerminalString(List<TerminalString> completionCandidates) Add multiple completion candidates as TerminalStrings.voiddoAppendSeparator(boolean appendSeparator) Set if this CompletionOperation would allow an separator to be appended.booleanCheck if non-escaped spaces should be ignored.booleanCheck if offset should be ignored.Get the input buffer string.Get the list of completion candidates.intGet the current cursor position.getFormattedCompletion(String completion) Get the formatted version of a completion string.Get the formatted completion candidates as strings.Get the formatted completion candidates as TerminalStrings.intGet the offset for completion.charGet the separator character, by default its spacebooleanDo this completion allow for appending a separator after completion?booleanCheck if starts-with matching should be ignored.voidRemove escaped spaces from all completion candidates.voidsetIgnoreNonEscapedSpace(boolean ignoreNonEscapedSpace) Set whether to ignore non-escaped spaces.voidsetIgnoreOffset(boolean ignoreOffset) Set whether to ignore the offset.voidsetIgnoreStartsWith(boolean ignoreStartsWith) Set whether to ignore starts-with matching.voidsetOffset(int offset) Set the offset for completion.voidsetSeparator(char separator) By default the separator is one space char, but it can be overridden here.
-
Method Details
-
getBuffer
-
getCursor
int getCursor()Get the current cursor position.- Returns:
- the cursor position
-
getOffset
int getOffset()Get the offset for completion.- Returns:
- the offset
-
setOffset
void setOffset(int offset) Set the offset for completion.- Parameters:
offset- the offset value
-
setIgnoreOffset
void setIgnoreOffset(boolean ignoreOffset) Set whether to ignore the offset.- Parameters:
ignoreOffset- true to ignore offset
-
doIgnoreOffset
boolean doIgnoreOffset()Check if offset should be ignored.- Returns:
- true if offset is ignored
-
getSeparator
char getSeparator()Get the separator character, by default its space- Returns:
- separator
-
setSeparator
void setSeparator(char separator) By default the separator is one space char, but it can be overridden here.- Parameters:
separator- separator
-
hasAppendSeparator
boolean hasAppendSeparator()Do this completion allow for appending a separator after completion? By default this is true.- Returns:
- appendSeparator
-
doAppendSeparator
void doAppendSeparator(boolean appendSeparator) Set if this CompletionOperation would allow an separator to be appended. By default this is true.- Parameters:
appendSeparator- appendSeparator
-
getCompletionCandidates
List<TerminalString> getCompletionCandidates()Get the list of completion candidates.- Returns:
- the completion candidates
-
addCompletionCandidate
Add a completion candidate.- Parameters:
completionCandidate- the candidate to add
-
addCompletionCandidate
Add a completion candidate as a string.- Parameters:
completionCandidate- the candidate to add
-
addCompletionCandidates
-
addCompletionCandidatesTerminalString
Add multiple completion candidates as TerminalStrings.- Parameters:
completionCandidates- the candidates to add
-
removeEscapedSpacesFromCompletionCandidates
void removeEscapedSpacesFromCompletionCandidates()Remove escaped spaces from all completion candidates. -
getFormattedCompletionCandidates
-
getFormattedCompletionCandidatesTerminalString
List<TerminalString> getFormattedCompletionCandidatesTerminalString()Get the formatted completion candidates as TerminalStrings.- Returns:
- the formatted candidates
-
getFormattedCompletion
-
isIgnoreStartsWith
boolean isIgnoreStartsWith()Check if starts-with matching should be ignored.- Returns:
- true if starts-with is ignored
-
setIgnoreStartsWith
void setIgnoreStartsWith(boolean ignoreStartsWith) Set whether to ignore starts-with matching.- Parameters:
ignoreStartsWith- true to ignore starts-with
-
doIgnoreNonEscapedSpace
boolean doIgnoreNonEscapedSpace()Check if non-escaped spaces should be ignored.- Returns:
- true if non-escaped spaces are ignored
-
setIgnoreNonEscapedSpace
void setIgnoreNonEscapedSpace(boolean ignoreNonEscapedSpace) Set whether to ignore non-escaped spaces.- Parameters:
ignoreNonEscapedSpace- true to ignore non-escaped spaces
-