Interface ListCellRenderer<E>
- All Known Implementing Classes:
DefaultListCellRenderer
public interface ListCellRenderer<E>
Port of
ListCellRenderer. Returns
Component so the renderer can hand back our
emulator's component hierarchy — JDK's java.awt.Component
return type is incompatible with our hierarchy and is the central
reason this interface is ported wholesale rather than reused (D_event_port_policy +
the cell-renderer carve-out).
The first parameter is vaadinx.swing.JList<? extends E> per D_jlist
(superseding D_jcombobox's placeholder Object), matching the JDK signature
— so a JDK-faithful renderer override compiles unchanged after the import
swap. It arrives differently from the two bridges (see @param list);
a renderer that reads selection / model state off the list needs the
JList bridge, while the common-case value-formatting renderer (the
DefaultListCellRenderer pattern) works under both.
-
Method Summary
Modifier and TypeMethodDescriptiongetListCellRendererComponent(JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus) Build the rendering component forvalue.
-
Method Details
-
getListCellRendererComponent
Component getListCellRendererComponent(JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus) Build the rendering component forvalue.- Parameters:
list- the rendering host: theJListinstance from the:emulators.JListbridge, ornullfrom the:emulators.JComboBoxbridge (a combo box has no JList).value- the model value to render.index- the index of the cell, or-1when rendering the selected value (e.g. in the JComboBox button face).isSelected- whether the cell is currently selected. The JComboBox bridge passesfalse; full selected-cell highlighting is browser-driven.cellHasFocus- whether the cell has keyboard focus. The JComboBox bridge passesfalse.
-