Class JavaShorthandCompletion

java.lang.Object
org.fife.ui.autocomplete.AbstractCompletion
org.fife.ui.autocomplete.BasicCompletion
org.fife.ui.autocomplete.ShorthandCompletion
org.fife.rsta.ac.java.JavaShorthandCompletion
All Implemented Interfaces:
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 final Color
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
     
    void
    rendererText(Graphics g, int x, int y, boolean selected)
    Used by JavaCellRenderer to render this completion choice.
    static void
    renderText(Graphics g, String input, 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 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

    Methods inherited from interface JavaSourceCompletion

    equals
  • Field Details

    • SHORTHAND_COLOR

      private static final Color SHORTHAND_COLOR
  • Constructor Details

    • JavaShorthandCompletion

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

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

    • getIcon

      public 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(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(Graphics g, String input, 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.