Package org.fife.rsta.ac.java
Class MethodCompletion
java.lang.Object
org.fife.ui.autocomplete.AbstractCompletion
org.fife.ui.autocomplete.BasicCompletion
org.fife.ui.autocomplete.VariableCompletion
org.fife.ui.autocomplete.FunctionCompletion
org.fife.rsta.ac.java.MethodCompletion
- All Implemented Interfaces:
Comparable<org.fife.ui.autocomplete.Completion>,JavaSourceCompletion,MemberCompletion,org.fife.ui.autocomplete.Completion,org.fife.ui.autocomplete.ParameterizedCompletion
class MethodCompletion
extends org.fife.ui.autocomplete.FunctionCompletion
implements MemberCompletion
A completion for a Java method. This completion gets its information from
one of two sources:
- A
MethodInfoinstance, which is loaded by parsing a class file. This is used when this completion represents a method found in a compiled library. - A
Methodinstance, which is created when parsing a Java source file. This is used when the completion represents a method found in uncompiled source, such as the source in an RSyntaxTextArea, or in a loose file on disk.
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.fife.rsta.ac.java.MemberCompletion
MemberCompletion.DataNested classes/interfaces inherited from interface org.fife.ui.autocomplete.ParameterizedCompletion
org.fife.ui.autocomplete.ParameterizedCompletion.Parameter -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringUsed to compare this method completion with another.private MemberCompletion.DataThe data source for our completion attributes.private static final intThe relevance of methods. -
Constructor Summary
ConstructorsConstructorDescriptionMethodCompletion(org.fife.ui.autocomplete.CompletionProvider provider, MethodInfo info) Creates a completion for a method discovered when parsing a compiled class file.MethodCompletion(org.fife.ui.autocomplete.CompletionProvider provider, Method m) Creates a completion for a method discovered when parsing a Java source file. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(org.fife.ui.autocomplete.Completion c2) Overridden to compare methods by their comparison strings.booleanForce subclasses to override equals().private StringReturns a string used to compare this method completion to another.getEnclosingClassName(boolean fullyQualified) Returns the name of the enclosing class.getIcon()Returns the signature of this member.inthashCode()booleanReturns whether this member is deprecated.voidrendererText(Graphics g, int x, int y, boolean selected) Used byJavaCellRendererto render this completion choice.static voidrendererText(MemberCompletion mc, Graphics g, int x, int y, boolean selected) Renders a member completion.private voidSets the relevance of this constructor based on its properties.toString()Methods inherited from class org.fife.ui.autocomplete.FunctionCompletion
addDefinitionString, addParameters, getDefinitionString, getInsertionInfo, getParam, getParamCount, getReturnValueDescription, getShowParameterToolTip, getToolTipText, setParams, setReturnValueDescriptionMethods inherited from class org.fife.ui.autocomplete.VariableCompletion
getDefinedIn, getName, getType, possiblyAddDefinedIn, possiblyAddDescription, setDefinedInMethods inherited from class org.fife.ui.autocomplete.BasicCompletion
getReplacementText, getShortDescription, setShortDescription, setSummaryMethods inherited from class org.fife.ui.autocomplete.AbstractCompletion
getInputText, getProvider, getRelevance, setIcon, setRelevanceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.fife.ui.autocomplete.Completion
getInputText, getProvider, getRelevance, getReplacementText, getToolTipTextMethods inherited from interface org.fife.rsta.ac.java.MemberCompletion
getType
-
Field Details
-
data
The data source for our completion attributes. -
compareString
Used to compare this method completion with another. -
NON_CONSTRUCTOR_RELEVANCE
private static final int NON_CONSTRUCTOR_RELEVANCEThe relevance of methods. This allows methods to be "higher" in the completion list than other types.- See Also:
-
-
Constructor Details
-
MethodCompletion
MethodCompletion(org.fife.ui.autocomplete.CompletionProvider provider, Method m) Creates a completion for a method discovered when parsing a Java source file.- Parameters:
provider- The parent completion provider.m- Metadata about the method.
-
MethodCompletion
MethodCompletion(org.fife.ui.autocomplete.CompletionProvider provider, MethodInfo info) Creates a completion for a method discovered when parsing a compiled class file.- Parameters:
provider- The parent completion provider.info- Metadata about the method.
-
-
Method Details
-
compareTo
public int compareTo(org.fife.ui.autocomplete.Completion c2) Overridden to compare methods by their comparison strings.- Specified by:
compareToin interfaceComparable<org.fife.ui.autocomplete.Completion>- Specified by:
compareToin interfaceorg.fife.ui.autocomplete.Completion- Overrides:
compareToin classorg.fife.ui.autocomplete.FunctionCompletion- Parameters:
c2- ACompletionto compare to.- Returns:
- The sort order.
-
equals
Description copied from interface:JavaSourceCompletionForce subclasses to override equals(). TODO: Remove me- Specified by:
equalsin interfaceJavaSourceCompletion- Overrides:
equalsin classorg.fife.ui.autocomplete.FunctionCompletion
-
getAlreadyEntered
- Specified by:
getAlreadyEnteredin interfaceorg.fife.ui.autocomplete.Completion- Overrides:
getAlreadyEnteredin classorg.fife.ui.autocomplete.AbstractCompletion
-
getCompareString
Returns a string used to compare this method completion to another.- Returns:
- The comparison string.
-
getEnclosingClassName
Description copied from interface:MemberCompletionReturns the name of the enclosing class.- Specified by:
getEnclosingClassNamein interfaceMemberCompletion- Parameters:
fullyQualified- Whether the name returned should be fully qualified.- Returns:
- The class name.
-
getIcon
- Specified by:
getIconin interfaceorg.fife.ui.autocomplete.Completion- Overrides:
getIconin classorg.fife.ui.autocomplete.AbstractCompletion
-
getSignature
Description copied from interface:MemberCompletionReturns the signature of this member.- Specified by:
getSignaturein interfaceMemberCompletion- Returns:
- The signature.
-
getSummary
- Specified by:
getSummaryin interfaceorg.fife.ui.autocomplete.Completion- Overrides:
getSummaryin classorg.fife.ui.autocomplete.FunctionCompletion
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.fife.ui.autocomplete.FunctionCompletion
-
isDeprecated
public boolean isDeprecated()Description copied from interface:MemberCompletionReturns whether this member is deprecated.- Specified by:
isDeprecatedin interfaceMemberCompletion- Returns:
- Whether this member is deprecated.
-
rendererText
Used byJavaCellRendererto render this completion choice.- Specified by:
rendererTextin interfaceJavaSourceCompletion- Parameters:
g- The graphics context to render to.x- The x-offset at which to render.y- The y-offset at which to render.selected- Whether this completion is currently selected/active.
-
setRelevanceAppropriately
private void setRelevanceAppropriately()Sets the relevance of this constructor based on its properties. -
rendererText
Renders a member completion.- Parameters:
mc- The completion to render.g- The graphics context.x- The x-offset at which to render.y- The y-offset at which to render.selected- Whether the completion is selected/active.
-
toString
- Overrides:
toStringin classorg.fife.ui.autocomplete.VariableCompletion
-