Module platform

Interface AutoCompletableTextArea

All Known Implementing Classes:
AutoCompletableTextEditor, JEditTextArea

public interface AutoCompletableTextArea
Default interface that textarea needs to implements to define the required methods for autocompletion The classes that implements this interface MUST extends JComponent
  • Method Details

    • init

      void init()
      Initializes this completion provider.
    • getAlreadyEnteredText

      String getAlreadyEnteredText(CompletionProvider provider)
      Returns the text just before the current caret position that could be the start of something auto-completable.

    • getInputMap

      InputMap getInputMap()
      Used by the AbstractAutoCompletion object to bind its keys action
    • getActionMap

      ActionMap getActionMap()
    • getCaretPosition

      int getCaretPosition()
      Return the position of the caret as int.
    • setCaretPosition

      void setCaretPosition(int dot)
      Set the position of the caret to dot
    • getLineOfCaret

      int getLineOfCaret()
      Return the line of the caret.
    • selectText

      void selectText(int start, int end)
      Select the text between the two position.
    • replaceSelection

      void replaceSelection(String content)
      Replace the current selection by the String content
      Parameters:
      content -
    • getText

      String getText(int start, int length) throws BadLocationException
      Return the text at position start of given length
      Throws:
      BadLocationException
    • getText

      void getText(int start, int end, Segment s) throws BadLocationException
      Push the text at position start of given length in the given segment
      Throws:
      BadLocationException
    • getSelectionEnd

      int getSelectionEnd()
      Return the end offset of the current selection
    • getSelectionStart

      int getSelectionStart()
      Return the start offset of the current selection
    • createPosition

      Position createPosition(int length) throws BadLocationException
      Create the position at the position lenght. If length is bigger than the buffer size it will throw an error.
      Throws:
      BadLocationException
    • moveCaretPosition

      void moveCaretPosition(int pos)
      Move the caret to the given position
    • getXYCaretPosition

      Point getXYCaretPosition()
      Get the XY position of the caret in pixels
    • getComponentOrientation

      ComponentOrientation getComponentOrientation()
      Return the orientation of the component.
    • addCaretListener

      void addCaretListener(CaretListener listener)
      Add a listener to the caret object
    • removeCaretListener

      void removeCaretListener(CaretListener listener)
      Remove a listener to the caret object
    • getHighlighter

      Highlighter getHighlighter()
      Return the Highlighter object of the text area
    • getDocumentLength

      int getDocumentLength()
      Return the buffer size of the text area
    • getBeginLineText

      String getBeginLineText(int lineNb)
      Return the Text contains between the begining of the given line and the caret position. It suppose that the caret position is after the start of the line
      Returns: