Package org.fife.rsta.ac.java
Class JavaCompletionProvider
java.lang.Object
org.fife.ui.autocomplete.CompletionProviderBase
org.fife.ui.autocomplete.LanguageAwareCompletionProvider
org.fife.rsta.ac.java.JavaCompletionProvider
- All Implemented Interfaces:
org.fife.ui.autocomplete.CompletionProvider,org.fife.ui.rtextarea.ToolTipSupplier
public class JavaCompletionProvider
extends org.fife.ui.autocomplete.LanguageAwareCompletionProvider
Completion provider for the Java programming language.
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CompilationUnitprivate SourceCompletionProviderThe provider used for source code, kept here since it's used so much.Fields inherited from class org.fife.ui.autocomplete.CompletionProviderBase
EMPTY_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJar(LibraryInfo info) Adds a jar to the "build path".voidRemoves all jars from the "build path".Defers to the source-analyzing completion provider.List<org.fife.ui.autocomplete.Completion> getCompletionsAt(JTextComponent tc, Point p) getJars()Returns the jars on the "build path".List<org.fife.ui.autocomplete.ParameterizedCompletion> booleanRemoves a jar from the "build path".private voidsetCommentCompletions(ShorthandCompletionCache shorthandCache) voidvoidSet shorthand completion cache (template and comment completions).Methods inherited from class org.fife.ui.autocomplete.LanguageAwareCompletionProvider
clearParameterizedCompletionParams, getCommentCompletionProvider, getCompletionsImpl, getDefaultCompletionProvider, getDocCommentCompletionProvider, getParameterListEnd, getParameterListSeparator, getParameterListStart, getStringCompletionProvider, getToolTipText, isAutoActivateOkay, setCommentCompletionProvider, setDefaultCompletionProvider, setDocCommentCompletionProvider, setParameterizedCompletionParams, setStringCompletionProviderMethods inherited from class org.fife.ui.autocomplete.CompletionProviderBase
getCompletions, getListCellRenderer, getParameterChoicesProvider, getParent, setAutoActivationRules, setListCellRenderer, setParameterChoicesProvider, setParent
-
Field Details
-
sourceProvider
The provider used for source code, kept here since it's used so much. -
cu
-
-
Constructor Details
-
JavaCompletionProvider
public JavaCompletionProvider()Constructor. -
JavaCompletionProvider
Constructor.- Parameters:
jarManager- The jar manager to use when looking up completion choices. This can be passed in to share a single jar manager across multiple RSyntaxTextAreas. This may also benull, in which case this completion provider will have a unique JarManager.
-
-
Method Details
-
addJar
Adds a jar to the "build path".- Parameters:
info- The jar to add. If this isnull, then the current JVM's main JRE jar (rt.jar, or classes.jar on OS X) will be added. If this jar has already been added, adding it again will do nothing (except possibly update its attached source location).- Throws:
IOException- If an IO error occurs.- See Also:
-
clearJars
public void clearJars()Removes all jars from the "build path".- See Also:
-
getAlreadyEnteredText
Defers to the source-analyzing completion provider.- Specified by:
getAlreadyEnteredTextin interfaceorg.fife.ui.autocomplete.CompletionProvider- Overrides:
getAlreadyEnteredTextin classorg.fife.ui.autocomplete.LanguageAwareCompletionProvider- Returns:
- The already entered text.
-
getCompilationUnit
-
getCompletionsAt
- Specified by:
getCompletionsAtin interfaceorg.fife.ui.autocomplete.CompletionProvider- Overrides:
getCompletionsAtin classorg.fife.ui.autocomplete.LanguageAwareCompletionProvider
-
getJars
Returns the jars on the "build path".- Returns:
- A list of
LibraryInfos. Modifying aLibraryInfoin this list will have no effect on this completion provider; in order to do that, you must re-add the jar viaaddJar(LibraryInfo). If there are no jars on the "build path," this will be an empty list. - See Also:
-
getParameterizedCompletions
public List<org.fife.ui.autocomplete.ParameterizedCompletion> getParameterizedCompletions(JTextComponent tc) - Specified by:
getParameterizedCompletionsin interfaceorg.fife.ui.autocomplete.CompletionProvider- Overrides:
getParameterizedCompletionsin classorg.fife.ui.autocomplete.LanguageAwareCompletionProvider
-
removeJar
Removes a jar from the "build path".- Parameters:
jar- The jar to remove.- Returns:
- Whether the jar was removed. This will be
falseif the jar was not on the build path. - See Also:
-
setCommentCompletions
-
setCompilationUnit
-
setShorthandCompletionCache
Set shorthand completion cache (template and comment completions).- Parameters:
cache- The cache to use.
-