Package org.kcc

Class KeywordBasedCodeCompletion


  • public class KeywordBasedCodeCompletion
    extends java.lang.Object
    • Field Detail

      • source

        private final javax.swing.JTextArea source
      • statusLabel

        private final javax.swing.JLabel statusLabel
      • nondelimiter

        private java.util.regex.Pattern nondelimiter
      • popup

        private javax.swing.JFrame popup
      • help

        private javax.swing.JFrame help
      • suggested

        private final javax.swing.JList<CompletionItem> suggested
      • scroll

        private final javax.swing.JScrollPane scroll
      • caretListenerToRemove

        private final javax.swing.event.CaretListener caretListenerToRemove
      • keyListenerToRemove

        private final java.awt.event.KeyListener keyListenerToRemove
      • focusListenerToRemove

        private final java.awt.event.FocusListener focusListenerToRemove
      • debug

        private boolean debug
      • futureLocation

        private java.awt.Point futureLocation
    • Constructor Detail

      • KeywordBasedCodeCompletion

        public KeywordBasedCodeCompletion​(javax.swing.JTextArea source,
                                          CompletionSettings settings)
    • Method Detail

      • showHelp

        private void showHelp()
      • createFrame

        private javax.swing.JFrame createFrame()
      • proceedArrow

        private void proceedArrow​(java.awt.event.KeyEvent keyEvent)
      • ende

        private void ende()
      • proceed

        private void proceed​(javax.swing.event.CaretEvent caretEvent)
      • proceed

        private void proceed​(javax.swing.event.CaretEvent caretEvent,
                             javax.swing.event.DocumentEvent documentEvent)
      • getLastWord

        private java.lang.String getLastWord​(int caretpos)
      • filter

        private void filter​(java.lang.String word,
                            int caretpos)
      • getAfterLines

        static java.lang.String[] getAfterLines​(int afterContextLinesCount,
                                                int caretpos,
                                                java.lang.String text)
      • getBeforeLines

        static java.lang.String[] getBeforeLines​(int beforeContextLinesCount,
                                                 int caretpos,
                                                 java.lang.String word,
                                                 java.lang.String text)
      • calcCompletionPosition

        private int calcCompletionPosition()
      • debugln

        private void debugln​(java.lang.String s)
      • createModel

        private static javax.swing.ListModel createModel​(CompletionItem[] listData)
      • setKeywords

        private void setKeywords​(CompletionItem[] keywords)
      • setKeywordsImpl

        private void setKeywordsImpl​(CompletionItem[] lkeywords)
      • deductSize

        private void deductSize​(javax.swing.JFrame ff)
      • apply

        private void apply()
      • dispose

        public void dispose()
        Needed to clean up all the listeners all the windows are disposed on every hide, so it is not mandatory for closing of generic application
      • removeHelp

        private void removeHelp()