Class ClassCompletion

  • All Implemented Interfaces:
    java.lang.Comparable<org.fife.ui.autocomplete.Completion>, JavaSourceCompletion, org.fife.ui.autocomplete.Completion

    class ClassCompletion
    extends AbstractJavaSourceCompletion
    Completion for a Java class, interface or enum.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ClassFile cf  
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassCompletion​(org.fife.ui.autocomplete.CompletionProvider provider, ClassFile cf)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(org.fife.ui.autocomplete.Completion c2)
      Overridden to ensure that two completions don't just have the same text value (ignoring case), but that they're of the same "type" of Completion as well, so, for example, a completion for the "String" class won't clash with a completion for a "string" LocalVar.
      boolean equals​(java.lang.Object obj)
      Force subclasses to override equals().
      java.lang.String getClassName​(boolean fullyQualified)
      Returns the name of the class represented by this completion.
      javax.swing.Icon getIcon()  
      java.lang.String getPackageName()
      Returns the package this class or interface is in.
      java.lang.String getSummary()  
      java.lang.String getToolTipText()  
      int hashCode()  
      void rendererText​(java.awt.Graphics g, int x, int y, boolean selected)
      Used by JavaCellRenderer to render this completion choice.
      • Methods inherited from class org.fife.ui.autocomplete.BasicCompletion

        getReplacementText, getShortDescription, setShortDescription, setSummary, toString
      • 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
    • Constructor Detail

      • ClassCompletion

        ClassCompletion​(org.fife.ui.autocomplete.CompletionProvider provider,
                        ClassFile cf)
    • Method Detail

      • compareTo

        public int compareTo​(org.fife.ui.autocomplete.Completion c2)
        Description copied from class: AbstractJavaSourceCompletion
        Overridden to ensure that two completions don't just have the same text value (ignoring case), but that they're of the same "type" of Completion as well, so, for example, a completion for the "String" class won't clash with a completion for a "string" LocalVar.
        Specified by:
        compareTo in interface java.lang.Comparable<org.fife.ui.autocomplete.Completion>
        Specified by:
        compareTo in interface org.fife.ui.autocomplete.Completion
        Overrides:
        compareTo in class AbstractJavaSourceCompletion
        Parameters:
        c2 - Another completion instance.
        Returns:
        How this completion compares to the other one.
      • equals

        public boolean equals​(java.lang.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 java.lang.Object
      • getClassName

        public java.lang.String getClassName​(boolean fullyQualified)
        Returns the name of the class represented by this completion.
        Parameters:
        fullyQualified - Whether the returned name should be fully qualified.
        Returns:
        The class name.
        See Also:
        getPackageName()
      • getIcon

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

        public java.lang.String getPackageName()
        Returns the package this class or interface is in.
        Returns:
        The package, or null if it is not in a package.
        See Also:
        getClassName(boolean)
      • getSummary

        public java.lang.String getSummary()
        Specified by:
        getSummary in interface org.fife.ui.autocomplete.Completion
        Overrides:
        getSummary in class org.fife.ui.autocomplete.BasicCompletion
      • getToolTipText

        public java.lang.String getToolTipText()
        Specified by:
        getToolTipText in interface org.fife.ui.autocomplete.Completion
        Overrides:
        getToolTipText in class org.fife.ui.autocomplete.AbstractCompletion
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • rendererText

        public void rendererText​(java.awt.Graphics g,
                                 int x,
                                 int y,
                                 boolean selected)
        Description copied from interface: JavaSourceCompletion
        Used by JavaCellRenderer to render this completion choice.
        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.