Class FreeColComboBoxRenderer<T>

    • Constructor Detail

      • FreeColComboBoxRenderer

        public FreeColComboBoxRenderer()
        Creates a new FreeColComboBoxRenderer instance with an empty prefix.
      • FreeColComboBoxRenderer

        public FreeColComboBoxRenderer​(java.lang.String prefix)
        Creates a new FreeColComboBoxRenderer instance with a given prefix.
        Parameters:
        prefix - a String value
      • FreeColComboBoxRenderer

        public FreeColComboBoxRenderer​(java.lang.String prefix,
                                       boolean localize)
        Creates a new FreeColComboBoxRenderer instance with a given prefix.
        Parameters:
        prefix - a String value
        localize - a boolean value
    • Method Detail

      • getListCellRendererComponent

        public java.awt.Component getListCellRendererComponent​(javax.swing.JList<? extends T> list,
                                                               T value,
                                                               int index,
                                                               boolean isSelected,
                                                               boolean hasFocus)
        Returns a ListCellRenderer for the given JList.
        Specified by:
        getListCellRendererComponent in interface javax.swing.ListCellRenderer<T>
        Parameters:
        list - The JList.
        value - The list cell.
        index - The index in the list.
        isSelected - true if the given list cell is selected.
        hasFocus - false if the given list cell has the focus.
        Returns:
        The ListCellRenderer
      • setLabelValues

        protected void setLabelValues​(javax.swing.JLabel c,
                                      T value)
        Set the text to place in a label.
        Parameters:
        c - The JLabel to assign.
        value - The object to derive a text value from.