Class DefaultListCellRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, ListCellRenderer<Object>

public class DefaultListCellRenderer extends JLabel implements ListCellRenderer<Object>
Port of DefaultListCellRenderer. Extends JLabel and renders the value via String.valueOf (matches JDK's default behaviour of showing the model value's toString). The selection / focus chrome that JDK applies via UIManager defaults stays as drop-and-WARN per R_vaadin_first — Vaadin owns the highlighted-cell styling on the dropdown side, and our renderer's inline-CSS shadow wouldn't reach the rendered DOM in any case (the Vaadin combo box renders renderer output inside its own light DOM scope).

Existence of this class makes DefaultListCellRenderer.UIResource (a JDK marker subclass for UIManager defaults) unnecessary at the migrated-app level — UIManager dispatch isn't modeled per R_match_swing_errors sub-bucket (b).

See Also:
  • Constructor Details

    • DefaultListCellRenderer

      public DefaultListCellRenderer()
  • Method Details

    • getListCellRendererComponent

      public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)
      Description copied from interface: ListCellRenderer
      Build the rendering component for value.
      Specified by:
      getListCellRendererComponent in interface ListCellRenderer<Object>
      Parameters:
      list - the rendering host: the JList instance from the :emulators.JList bridge, or null from the :emulators.JComboBox bridge (a combo box has no JList).
      value - the model value to render.
      index - the index of the cell, or -1 when rendering the selected value (e.g. in the JComboBox button face).
      isSelected - whether the cell is currently selected. The JComboBox bridge passes false; full selected-cell highlighting is browser-driven.
      cellHasFocus - whether the cell has keyboard focus. The JComboBox bridge passes false.