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:
java.lang.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.Data
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcompareStringUsed to compare this method completion with another.private MemberCompletion.DatadataThe data source for our completion attributes.private static intNON_CONSTRUCTOR_RELEVANCEThe relevance of methods.
-
Constructor Summary
Constructors Constructor Description MethodCompletion(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(org.fife.ui.autocomplete.Completion c2)Overridden to compare methods by their comparison strings.booleanequals(java.lang.Object obj)Force subclasses to override equals().java.lang.StringgetAlreadyEntered(javax.swing.text.JTextComponent comp)private java.lang.StringgetCompareString()Returns a string used to compare this method completion to another.java.lang.StringgetEnclosingClassName(boolean fullyQualified)Returns the name of the enclosing class.javax.swing.IcongetIcon()java.lang.StringgetSignature()Returns the signature of this member.java.lang.StringgetSummary()inthashCode()booleanisDeprecated()Returns whether this member is deprecated.voidrendererText(java.awt.Graphics g, int x, int y, boolean selected)Used byJavaCellRendererto render this completion choice.static voidrendererText(MemberCompletion mc, java.awt.Graphics g, int x, int y, boolean selected)Renders a member completion.private voidsetRelevanceAppropriately()Sets the relevance of this constructor based on its properties.java.lang.StringtoString()-
Methods inherited from class org.fife.ui.autocomplete.FunctionCompletion
addDefinitionString, addParameters, getDefinitionString, getInsertionInfo, getParam, getParamCount, getReturnValueDescription, getShowParameterToolTip, getToolTipText, setParams, setReturnValueDescription
-
Methods inherited from class org.fife.ui.autocomplete.VariableCompletion
getDefinedIn, getName, getType, possiblyAddDefinedIn, possiblyAddDescription, setDefinedIn
-
Methods inherited from class org.fife.ui.autocomplete.BasicCompletion
getReplacementText, getShortDescription, setShortDescription, setSummary
-
Methods inherited from class org.fife.ui.autocomplete.AbstractCompletion
getInputText, getProvider, getRelevance, setIcon, setRelevance
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.fife.ui.autocomplete.Completion
getInputText, getProvider, getRelevance, getReplacementText, getToolTipText
-
Methods inherited from interface org.fife.rsta.ac.java.MemberCompletion
getType
-
-
-
-
Field Detail
-
data
private MemberCompletion.Data data
The data source for our completion attributes.
-
compareString
private java.lang.String compareString
Used to compare this method completion with another.
-
NON_CONSTRUCTOR_RELEVANCE
private static final int NON_CONSTRUCTOR_RELEVANCE
The relevance of methods. This allows methods to be "higher" in the completion list than other types.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
compareTo
public int compareTo(org.fife.ui.autocomplete.Completion c2)
Overridden to compare methods by their comparison strings.- Specified by:
compareToin interfacejava.lang.Comparable<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
public boolean equals(java.lang.Object obj)
Description copied from interface:JavaSourceCompletionForce subclasses to override equals(). TODO: Remove me- Specified by:
equalsin interfaceJavaSourceCompletion- Overrides:
equalsin classorg.fife.ui.autocomplete.FunctionCompletion
-
getAlreadyEntered
public java.lang.String getAlreadyEntered(javax.swing.text.JTextComponent comp)
- Specified by:
getAlreadyEnteredin interfaceorg.fife.ui.autocomplete.Completion- Overrides:
getAlreadyEnteredin classorg.fife.ui.autocomplete.AbstractCompletion
-
getCompareString
private java.lang.String getCompareString()
Returns a string used to compare this method completion to another.- Returns:
- The comparison string.
-
getEnclosingClassName
public java.lang.String getEnclosingClassName(boolean fullyQualified)
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
public javax.swing.Icon getIcon()
- Specified by:
getIconin interfaceorg.fife.ui.autocomplete.Completion- Overrides:
getIconin classorg.fife.ui.autocomplete.AbstractCompletion
-
getSignature
public java.lang.String getSignature()
Description copied from interface:MemberCompletionReturns the signature of this member.- Specified by:
getSignaturein interfaceMemberCompletion- Returns:
- The signature.
-
getSummary
public java.lang.String 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
public void rendererText(java.awt.Graphics g, int x, int y, boolean selected)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
public static void rendererText(MemberCompletion mc, java.awt.Graphics g, int x, int y, boolean selected)
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
public java.lang.String toString()
- Overrides:
toStringin classorg.fife.ui.autocomplete.VariableCompletion
-
-