Package org.fife.rsta.ac.java
Class JavaLanguageSupport.JavaAutoCompletion
java.lang.Object
org.fife.ui.autocomplete.AutoCompletion
org.fife.rsta.ac.java.JavaLanguageSupport.JavaAutoCompletion
- Enclosing class:
JavaLanguageSupport
private class JavaLanguageSupport.JavaAutoCompletion
extends org.fife.ui.autocomplete.AutoCompletion
A hack of AutoCompletion that forces the JavaParser
to re-parse the document when the user presses ctrl+space.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.fife.ui.autocomplete.AutoCompletion
org.fife.ui.autocomplete.AutoCompletion.AutoCompleteAction -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate org.fife.ui.rsyntaxtextarea.RSyntaxTextArea -
Constructor Summary
ConstructorsConstructorDescriptionJavaAutoCompletion(JavaCompletionProvider provider, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) -
Method Summary
Modifier and TypeMethodDescriptionprivate Stringprotected StringgetReplacementText(org.fife.ui.autocomplete.Completion c, Document doc, int start, int len) Overridden to allow for prepending to the replacement text.Determines whether the class name being completed has been imported, and if it hasn't, returns the import statement that should be added for it.protected voidinsertCompletion(org.fife.ui.autocomplete.Completion c, boolean typedParamListStartChar) Overridden to handle special cases, because sometimes Java code completions will edit more in the source file than just the text at the current caret position.protected intMethods inherited from class org.fife.ui.autocomplete.AutoCompletion
addAutoCompletionListener, createAutoCompleteAction, doCompletion, fireAutoCompletionEvent, getAutoActivationDelay, getAutoCompleteSingleChoices, getCompletionProvider, getDefaultTriggerKey, getDescWindowColor, getExternalURLHandler, getLinkRedirector, getListCellRenderer, getParamChoicesRenderer, getParameterDescriptionTruncateThreshold, getShowDescWindow, getStyleContext, getTextComponent, getTriggerKey, hideChildWindows, hidePopupWindow, insertCompletion, install, isAutoActivationEnabled, isAutoCompleteEnabled, isHideOnCompletionProviderChange, isHideOnNoText, isParameterAssistanceEnabled, isPopupVisible, removeAutoCompletionListener, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setAutoCompleteSingleChoices, setChoicesWindowSize, setCompletionProvider, setDescriptionWindowColor, setDescriptionWindowSize, setExternalURLHandler, setHideOnCompletionProviderChange, setHideOnNoText, setLinkRedirector, setListCellRenderer, setParamChoicesRenderer, setParameterAssistanceEnabled, setParameterDescriptionTruncateThreshold, setPopupVisible, setShowDescWindow, setTriggerKey, uninstall
-
Field Details
-
textArea
private org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea -
replacementTextPrefix
-
-
Constructor Details
-
JavaAutoCompletion
JavaAutoCompletion(JavaCompletionProvider provider, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
-
-
Method Details
-
getCurrentLineText
-
getReplacementText
protected String getReplacementText(org.fife.ui.autocomplete.Completion c, Document doc, int start, int len) Overridden to allow for prepending to the replacement text. This allows us to insert fully qualified class names. instead of unqualified ones, if necessary (i.e. if the user tries to auto-completejavax.swing.text.Document, but they've explicitly importedorg.w3c.dom.Document- we need to insert the fully qualified name in that case).- Overrides:
getReplacementTextin classorg.fife.ui.autocomplete.AutoCompletion
-
getShouldAddImport
Determines whether the class name being completed has been imported, and if it hasn't, returns the import statement that should be added for it. Alternatively, if the class hasn't been imported, but a class with the same (unqualified) name HAS been imported, this method sets things up so the fully-qualified version of this class's name is inserted.Thanks to Guilherme Joao Frantz and Jonatas Schuler for helping with the patch!
- Parameters:
cc- The completion being inserted.- Returns:
- Whether an import was added.
-
insertCompletion
protected void insertCompletion(org.fife.ui.autocomplete.Completion c, boolean typedParamListStartChar) Overridden to handle special cases, because sometimes Java code completions will edit more in the source file than just the text at the current caret position.- Overrides:
insertCompletionin classorg.fife.ui.autocomplete.AutoCompletion
-
refreshPopupWindow
protected int refreshPopupWindow()- Overrides:
refreshPopupWindowin classorg.fife.ui.autocomplete.AutoCompletion
-