Package org.kcc
Class KeywordBasedCodeCompletion
- java.lang.Object
-
- org.kcc.KeywordBasedCodeCompletion
-
public class KeywordBasedCodeCompletion extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private ContextSuggestionsNarrower
afterFilteringNarrowing
private ContextSuggestionsNarrower
beforeFilteringNarrowing
private javax.swing.event.CaretListener
caretListenerToRemove
private boolean
debug
private java.awt.event.FocusListener
focusListenerToRemove
private java.awt.Point
futureLocation
private javax.swing.JFrame
help
private java.awt.event.KeyListener
keyListenerToRemove
private CompletionItem[]
keywords
private java.util.regex.Pattern
nondelimiter
private javax.swing.JFrame
popup
private javax.swing.JScrollPane
scroll
private CompletionSettings
settings
private javax.swing.JTextArea
source
private javax.swing.JLabel
statusLabel
private javax.swing.JList<CompletionItem>
suggested
-
Constructor Summary
Constructors Constructor Description KeywordBasedCodeCompletion(javax.swing.JTextArea source, CompletionSettings settings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
apply()
private int
calcCompletionPosition()
private javax.swing.JFrame
createFrame()
private static javax.swing.ListModel
createModel(CompletionItem[] listData)
private void
debugln(java.lang.String s)
private void
deductSize(javax.swing.JFrame ff)
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 applicationprivate void
ende()
private void
filter(java.lang.String word, int caretpos)
ContextSuggestionsNarrower
getAfterFilteringNarrowing()
(package private) static java.lang.String[]
getAfterLines(int afterContextLinesCount, int caretpos, java.lang.String text)
ContextSuggestionsNarrower
getBeforeFilteringNarrowing()
(package private) static java.lang.String[]
getBeforeLines(int beforeContextLinesCount, int caretpos, java.lang.String word, java.lang.String text)
private java.lang.String
getLastWord(int caretpos)
CompletionSettings
getSettings()
private void
proceed(javax.swing.event.CaretEvent caretEvent)
private void
proceed(javax.swing.event.CaretEvent caretEvent, javax.swing.event.DocumentEvent documentEvent)
private void
proceedArrow(java.awt.event.KeyEvent keyEvent)
private void
removeHelp()
void
setAfterFilteringNarrowing(ContextSuggestionsNarrower afterFilteringNarrowing)
void
setBeforeFilteringNarrowing(ContextSuggestionsNarrower beforeFilteringNarrowing)
void
setCompletionsSet(CompletionItem.CompletionItemSet set)
private void
setKeywords(CompletionItem[] keywords)
private void
setKeywordsImpl(CompletionItem[] lkeywords)
private void
showHelp()
-
-
-
Field Detail
-
source
private final javax.swing.JTextArea source
-
settings
private final CompletionSettings settings
-
statusLabel
private final javax.swing.JLabel statusLabel
-
nondelimiter
private java.util.regex.Pattern nondelimiter
-
keywords
private CompletionItem[] keywords
-
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
-
afterFilteringNarrowing
private ContextSuggestionsNarrower afterFilteringNarrowing
-
beforeFilteringNarrowing
private ContextSuggestionsNarrower beforeFilteringNarrowing
-
-
Constructor Detail
-
KeywordBasedCodeCompletion
public KeywordBasedCodeCompletion(javax.swing.JTextArea source, CompletionSettings settings)
-
-
Method Detail
-
showHelp
private void showHelp()
-
createFrame
private javax.swing.JFrame createFrame()
-
setCompletionsSet
public void setCompletionsSet(CompletionItem.CompletionItemSet set)
-
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()
-
getSettings
public CompletionSettings getSettings()
-
getBeforeFilteringNarrowing
public ContextSuggestionsNarrower getBeforeFilteringNarrowing()
-
getAfterFilteringNarrowing
public ContextSuggestionsNarrower getAfterFilteringNarrowing()
-
setBeforeFilteringNarrowing
public void setBeforeFilteringNarrowing(ContextSuggestionsNarrower beforeFilteringNarrowing)
-
setAfterFilteringNarrowing
public void setAfterFilteringNarrowing(ContextSuggestionsNarrower afterFilteringNarrowing)
-
-