Interface CompletionGUI

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void cycleCompletion​(javax.swing.text.JTextComponent editor, java.util.Collection<Completion> completions, java.lang.String stub, int index)
      Called to cycle through multiple completions.
      boolean editorMayLoseFocus()
      If the editor my lose the focus because of a GUI action(usually after specialKeyPressed()), this method should return true to avoid AutoCompletion calling stopOffer().
      boolean editorMayUpdateCaret()
      If the editor my update the caret because of a GUI action(usually after specialKeyPressed()), this method should return true to avoid AutoCompletion calling stopOffer().
      Completion getSelectedCompletion()
      Returns the currently selected Completion object.
      int[] getSpecialKeys()
      If this GUI needs some special keys the Key-Codes con be obtained by this method.
      java.lang.String getTitle()
      Returns the name of this CompletionGUI.
      void init​(AutoCompletion ac)
      Initialize this GUI for use with the given AutoCompletion.
      boolean isOfferingCompletion()
      Should return true if this GUI is currently offering a completion to the user.
      void offerCompletion​(javax.swing.text.JTextComponent editor, java.util.Collection<Completion> completions, java.lang.String stub)
      Called the advice this GUI to offer the given completions in the given Editor to the user.
      void specialKeyPressed​(int key)
      When AutoCompletion recognizes a special key of getSpecialKeys(), this method is called with the key found.
      void stopOffer()
      Called when this GUI should stop offering completions.
    • Method Detail

      • init

        void init​(AutoCompletion ac)
        Initialize this GUI for use with the given AutoCompletion. This method is called by AutoCompletion when the GUI is added to it.
      • isOfferingCompletion

        boolean isOfferingCompletion()
        Should return true if this GUI is currently offering a completion to the user.
      • offerCompletion

        void offerCompletion​(javax.swing.text.JTextComponent editor,
                             java.util.Collection<Completion> completions,
                             java.lang.String stub)
        Called the advice this GUI to offer the given completions in the given Editor to the user.
        Parameters:
        editor - The editor where the completions should be shown.
        completions - A list of completions.
      • cycleCompletion

        void cycleCompletion​(javax.swing.text.JTextComponent editor,
                             java.util.Collection<Completion> completions,
                             java.lang.String stub,
                             int index)
        Called to cycle through multiple completions. Use the given index to find the completion that should be shown. Following is guaranteed:
        • A call to offerCompletion was made before any cycleCompletion calls
        • The given parameters are the same used in the offerCompletion call
      • stopOffer

        void stopOffer()
        Called when this GUI should stop offering completions.
      • getSpecialKeys

        int[] getSpecialKeys()
        If this GUI needs some special keys the Key-Codes con be obtained by this method.
      • specialKeyPressed

        void specialKeyPressed​(int key)
        When AutoCompletion recognizes a special key of getSpecialKeys(), this method is called with the key found.
      • editorMayLoseFocus

        boolean editorMayLoseFocus()
        If the editor my lose the focus because of a GUI action(usually after specialKeyPressed()), this method should return true to avoid AutoCompletion calling stopOffer().
      • editorMayUpdateCaret

        boolean editorMayUpdateCaret()
        If the editor my update the caret because of a GUI action(usually after specialKeyPressed()), this method should return true to avoid AutoCompletion calling stopOffer().
      • getSelectedCompletion

        Completion getSelectedCompletion()
        Returns the currently selected Completion object.
      • getTitle

        java.lang.String getTitle()
        Returns the name of this CompletionGUI.