/** * Returns a string representation of this completion. The default * implementation returns {@link #getInputText()}. * * @return A string representation of this completion. */ @Override public String toString() { return getInputText(); }
/** * Returns the text the user has to (start) typing for this completion * to be offered. The default implementation simply returns * {@link #getReplacementText()}. * * @return The text the user has to (start) typing for this completion. * @see #getReplacementText() */ @Override public String getInputText() { return getReplacementText(); }
/** * Constructor. * * @param provider The provider that created this completion. * @param icon The icon for this completion. */ protected AbstractCompletion(CompletionProvider provider, Icon icon) { this(provider); setIcon(icon); }
/** * {@inheritDoc} */ @Override public int compareTo(Completion c2) { if (c2==this) { return 0; } else if (c2!=null) { return toString().compareToIgnoreCase(c2.toString()); } return -1; }
setIcon(completion.getIcon());