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 Details

    • getBuffer

      String getBuffer()
      Get the input buffer string.
      Returns:
      the buffer content
    • 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

      void addCompletionCandidate(TerminalString completionCandidate)
      Add a completion candidate.
      Parameters:
      completionCandidate - the candidate to add
    • addCompletionCandidate

      void addCompletionCandidate(String completionCandidate)
      Add a completion candidate as a string.
      Parameters:
      completionCandidate - the candidate to add
    • addCompletionCandidates

      void addCompletionCandidates(List<String> completionCandidates)
      Add multiple completion candidates.
      Parameters:
      completionCandidates - the candidates to add
    • addCompletionCandidatesTerminalString

      void addCompletionCandidatesTerminalString(List<TerminalString> completionCandidates)
      Add multiple completion candidates as TerminalStrings.
      Parameters:
      completionCandidates - the candidates to add
    • removeEscapedSpacesFromCompletionCandidates

      void removeEscapedSpacesFromCompletionCandidates()
      Remove escaped spaces from all completion candidates.
    • getFormattedCompletionCandidates

      List<String> getFormattedCompletionCandidates()
      Get the formatted completion candidates as strings.
      Returns:
      the formatted candidates
    • getFormattedCompletionCandidatesTerminalString

      List<TerminalString> getFormattedCompletionCandidatesTerminalString()
      Get the formatted completion candidates as TerminalStrings.
      Returns:
      the formatted candidates
    • getFormattedCompletion

      String getFormattedCompletion(String completion)
      Get the formatted version of a completion string.
      Parameters:
      completion - the completion to format
      Returns:
      the formatted completion
    • 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