/** * Prepares this renderer to display a completion not specifically handled * elsewhere. * * @param list The list of choices being rendered. * @param c The completion to render. * @param index The index into <code>list</code> being rendered. * @param selected Whether the item is selected. * @param hasFocus Whether the item has focus. */ protected void prepareForOtherCompletion(JList list, Completion c, int index, boolean selected, boolean hasFocus) { StringBuilder sb = new StringBuilder(PREFIX); sb.append(c.getInputText()); if (c instanceof BasicCompletion) { String definition = ((BasicCompletion)c).getShortDescription(); if (definition!=null) { sb.append(" - "); if (!selected) { sb.append("<font color='").append(typeColor).append("'>"); } sb.append(definition); if (!selected) { sb.append("</font>"); } } } setText(sb.toString()); }