Class AutocompletionCellRenderer<T>

  • Type Parameters:
    T - the type of items suggested by the autocompleter.
    All Implemented Interfaces:
    javax.swing.ListCellRenderer<T>

    public class AutocompletionCellRenderer<T>
    extends java.lang.Object
    implements javax.swing.ListCellRenderer<T>
    This is a default list cell renderer for the TextFieldAutocompleter suitable for extension if a user wishes to customize it. Mostly, this just composes Swing's DefaultListCellRenderer, except it allows each suggested item to specify its own text, font, icon, foreground color, and background color. Of course, the display text may also use HTML tags for fine formatting.
    See Also:
    TextFieldAutocompleter
    • Field Summary

      Fields 
      ChangeModifier and Type Field Description
      NEWprotected javax.swing.ListCellRenderer<java.lang.Object> defaultRenderer  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      ChangeModifier and Type Method Description
      java.awt.Component getListCellRendererComponent​(javax.swing.JList<? extends T> list, T value, int index, boolean isSelected, boolean cellHasFocus)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • defaultRenderer NEW

        protected javax.swing.ListCellRenderer<java.lang.Object> defaultRenderer

Constructor Detail

  • Method Detail

    • getListCellRendererComponent

      public java.awt.Component getListCellRendererComponent​(javax.swing.JList<? extends T> list,
                                                             T value,
                                                             int index,
                                                             boolean isSelected,
                                                             boolean cellHasFocus)
      Specified by:
      getListCellRendererComponent in interface javax.swing.ListCellRenderer<T>