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 MethodInfo instance, which is loaded by parsing a class file. This is used when this completion represents a method found in a compiled library.
  • A Method instance, 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 MemberCompletion

    MemberCompletion.Data

    Nested classes/interfaces inherited from interface org.fife.ui.autocomplete.ParameterizedCompletion

    org.fife.ui.autocomplete.ParameterizedCompletion.Parameter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    Used to compare this method completion with another.
    The data source for our completion attributes.
    private static final int
    The 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

    Modifier and Type
    Method
    Description
    int
    compareTo(org.fife.ui.autocomplete.Completion c2)
    Overridden to compare methods by their comparison strings.
    boolean
    Force subclasses to override equals().
     
    private String
    Returns a string used to compare this method completion to another.
    getEnclosingClassName(boolean fullyQualified)
    Returns the name of the enclosing class.
     
    Returns the signature of this member.
     
    int
     
    boolean
    Returns whether this member is deprecated.
    void
    rendererText(Graphics g, int x, int y, boolean selected)
    Used by JavaCellRenderer to render this completion choice.
    static void
    rendererText(MemberCompletion mc, Graphics g, int x, int y, boolean selected)
    Renders a member completion.
    private void
    Sets the relevance of this constructor based on its properties.

    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 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 MemberCompletion

    getType
  • Field Details

    • data

      private MemberCompletion.Data data
      The data source for our completion attributes.
    • compareString

      private 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:
  • 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:
      compareTo in interface Comparable<org.fife.ui.autocomplete.Completion>
      Specified by:
      compareTo in interface org.fife.ui.autocomplete.Completion
      Overrides:
      compareTo in class org.fife.ui.autocomplete.FunctionCompletion
      Parameters:
      c2 - A Completion to compare to.
      Returns:
      The sort order.
    • equals

      public boolean equals(Object obj)
      Description copied from interface: JavaSourceCompletion
      Force subclasses to override equals(). TODO: Remove me
      Specified by:
      equals in interface JavaSourceCompletion
      Overrides:
      equals in class org.fife.ui.autocomplete.FunctionCompletion
    • getAlreadyEntered

      public String getAlreadyEntered(JTextComponent comp)
      Specified by:
      getAlreadyEntered in interface org.fife.ui.autocomplete.Completion
      Overrides:
      getAlreadyEntered in class org.fife.ui.autocomplete.AbstractCompletion
    • getCompareString

      private String getCompareString()
      Returns a string used to compare this method completion to another.
      Returns:
      The comparison string.
    • getEnclosingClassName

      public String getEnclosingClassName(boolean fullyQualified)
      Description copied from interface: MemberCompletion
      Returns the name of the enclosing class.
      Specified by:
      getEnclosingClassName in interface MemberCompletion
      Parameters:
      fullyQualified - Whether the name returned should be fully qualified.
      Returns:
      The class name.
    • getIcon

      public Icon getIcon()
      Specified by:
      getIcon in interface org.fife.ui.autocomplete.Completion
      Overrides:
      getIcon in class org.fife.ui.autocomplete.AbstractCompletion
    • getSignature

      public String getSignature()
      Description copied from interface: MemberCompletion
      Returns the signature of this member.
      Specified by:
      getSignature in interface MemberCompletion
      Returns:
      The signature.
    • getSummary

      public String getSummary()
      Specified by:
      getSummary in interface org.fife.ui.autocomplete.Completion
      Overrides:
      getSummary in class org.fife.ui.autocomplete.FunctionCompletion
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.fife.ui.autocomplete.FunctionCompletion
    • isDeprecated

      public boolean isDeprecated()
      Description copied from interface: MemberCompletion
      Returns whether this member is deprecated.
      Specified by:
      isDeprecated in interface MemberCompletion
      Returns:
      Whether this member is deprecated.
    • rendererText

      public void rendererText(Graphics g, int x, int y, boolean selected)
      Used by JavaCellRenderer to render this completion choice.
      Specified by:
      rendererText in interface JavaSourceCompletion
      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, 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 String toString()
      Overrides:
      toString in class org.fife.ui.autocomplete.VariableCompletion