Package org.fife.rsta.ac.java
Class SourceParamChoicesProvider
- java.lang.Object
-
- org.fife.rsta.ac.java.SourceParamChoicesProvider
-
- All Implemented Interfaces:
org.fife.ui.autocomplete.ParameterChoicesProvider
class SourceParamChoicesProvider extends java.lang.Object implements org.fife.ui.autocomplete.ParameterChoicesProviderA parameter choices provider for Java methods.NOTE: This class is not thread-safe, but it's assumed that it is only ever called on the EDT, so it should be a non-issue.
- Version:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSourceParamChoicesProvider.SimpleCompletionA very simple, low-relevance parameter choice completion.
-
Field Summary
Fields Modifier and Type Field Description private org.fife.ui.autocomplete.CompletionProviderproviderThe parentJavaCompletionProvider.
-
Constructor Summary
Constructors Constructor Description SourceParamChoicesProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddPublicAndProtectedFieldsAndGetters(Type type, JarManager jm, Package pkg, java.util.List<org.fife.ui.autocomplete.Completion> list)Adds all accessible fields and getters of a specific type, from an extended class or implemented interface.java.util.List<org.fife.ui.autocomplete.Completion>getLocalVarsFieldsAndGetters(NormalClassDeclaration ncd, java.lang.String type, int offs)Gets all local variables, fields, and simple getters defined in a class, that are of a specific type, and are accessible from a given offset.java.util.List<org.fife.ui.autocomplete.Completion>getParameterChoices(javax.swing.text.JTextComponent tc, org.fife.ui.autocomplete.ParameterizedCompletion.Parameter param)private booleanisPrimitiveNumericType(Type type)private booleanisSimpleGetter(Method method)Returns whether a method is a no-argument getter method.private booleanisTypeCompatible(Type type, java.lang.String typeName)Returns whether aTypeand a type name are type compatible.
-
-
-
Field Detail
-
provider
private org.fife.ui.autocomplete.CompletionProvider provider
The parentJavaCompletionProvider.
-
-
Method Detail
-
addPublicAndProtectedFieldsAndGetters
private void addPublicAndProtectedFieldsAndGetters(Type type, JarManager jm, Package pkg, java.util.List<org.fife.ui.autocomplete.Completion> list)
Adds all accessible fields and getters of a specific type, from an extended class or implemented interface.- Parameters:
type- The type being examined.jm- The jar manager.pkg- The parent package.list- The list of completions to add to.
-
getLocalVarsFieldsAndGetters
public java.util.List<org.fife.ui.autocomplete.Completion> getLocalVarsFieldsAndGetters(NormalClassDeclaration ncd, java.lang.String type, int offs)
Gets all local variables, fields, and simple getters defined in a class, that are of a specific type, and are accessible from a given offset.- Parameters:
ncd- The class.type- The type that the variables, fields, and (return value of) getters must be.offs- The offset of the caret.- Returns:
- The list of stuff, or an empty list if none are found.
-
getParameterChoices
public java.util.List<org.fife.ui.autocomplete.Completion> getParameterChoices(javax.swing.text.JTextComponent tc, org.fife.ui.autocomplete.ParameterizedCompletion.Parameter param)- Specified by:
getParameterChoicesin interfaceorg.fife.ui.autocomplete.ParameterChoicesProvider
-
isPrimitiveNumericType
private boolean isPrimitiveNumericType(Type type)
-
isSimpleGetter
private boolean isSimpleGetter(Method method)
Returns whether a method is a no-argument getter method.- Parameters:
method- The method.- Returns:
- Whether it is a no-argument getter.
-
isTypeCompatible
private boolean isTypeCompatible(Type type, java.lang.String typeName)
Returns whether aTypeand a type name are type compatible. This method currently is a sham!- Parameters:
type- The type to check.typeName- The name of a type to check.- Returns:
- Whether the two are compatible.
-
-