Class JavaShorthandCompletion

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

    class JavaShorthandCompletion
    extends org.fife.ui.autocomplete.ShorthandCompletion
    implements JavaSourceCompletion
    A completion for shorthand items that mimics the style seen in Eclipse.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.awt.Color SHORTHAND_COLOR  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaShorthandCompletion​(org.fife.ui.autocomplete.CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText)
      Constructor.
      JavaShorthandCompletion​(org.fife.ui.autocomplete.CompletionProvider provider, java.lang.String inputText, java.lang.String replacementText, java.lang.String shortDesc)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.swing.Icon getIcon()  
      void rendererText​(java.awt.Graphics g, int x, int y, boolean selected)
      Used by JavaCellRenderer to render this completion choice.
      static void renderText​(java.awt.Graphics g, java.lang.String input, java.lang.String shortDesc, int x, int y, boolean selected)
      Renders a completion in the style of a short-hand completion.
      • Methods inherited from class org.fife.ui.autocomplete.ShorthandCompletion

        getInputText, getSummary, getSummaryBody
      • Methods inherited from class org.fife.ui.autocomplete.BasicCompletion

        getReplacementText, getShortDescription, setShortDescription, setSummary, toString
      • Methods inherited from class org.fife.ui.autocomplete.AbstractCompletion

        compareTo, getAlreadyEntered, getProvider, getRelevance, getToolTipText, setIcon, setRelevance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.fife.ui.autocomplete.Completion

        compareTo, getAlreadyEntered, getInputText, getProvider, getRelevance, getReplacementText, getSummary, getToolTipText
    • Field Detail

      • SHORTHAND_COLOR

        private static final java.awt.Color SHORTHAND_COLOR
    • Constructor Detail

      • JavaShorthandCompletion

        JavaShorthandCompletion​(org.fife.ui.autocomplete.CompletionProvider provider,
                                java.lang.String inputText,
                                java.lang.String replacementText)
        Constructor.
        Parameters:
        provider - The completion provider.
        inputText - The input text.
        replacementText - The replacement text.
      • JavaShorthandCompletion

        JavaShorthandCompletion​(org.fife.ui.autocomplete.CompletionProvider provider,
                                java.lang.String inputText,
                                java.lang.String replacementText,
                                java.lang.String shortDesc)
        Constructor.
        Parameters:
        provider - The completion provider.
        inputText - The input text.
        replacementText - The replacement text.
        shortDesc - A short description of the completion.
    • Method Detail

      • 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
      • rendererText

        public void rendererText​(java.awt.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.
      • renderText

        public static void renderText​(java.awt.Graphics g,
                                      java.lang.String input,
                                      java.lang.String shortDesc,
                                      int x,
                                      int y,
                                      boolean selected)
        Renders a completion in the style of a short-hand completion.
        Parameters:
        g - The graphics context.
        input - The text the user enters to display this completion.
        shortDesc - An optional short description of the completion.
        x - The x-offset at which to paint.
        y - The y-offset at which to paint.
        selected - Whether this completion choice is selected.