1 package be
.nikiroo
.utils
.ui
.compat
;
3 import javax
.swing
.JList
;
4 import javax
.swing
.ListCellRenderer
;
5 import javax
.swing
.ListModel
;
8 * Compatibility layer so I can at least get rid of the warnings of using
9 * {@link JList} without a parameter (and still staying Java 1.6 compatible).
11 * This class is merely a {@link JList} that you can parametrise also in Java
19 @SuppressWarnings({ "unchecked", "rawtypes" }) // not compatible Java 1.6
20 public class JList6
<E
> extends JList
{
21 private static final long serialVersionUID
= 1L;
26 * @deprecated please use {@link JList6#setCellRenderer(ListCellRenderer6)}
29 public void setCellRenderer(ListCellRenderer cellRenderer
) {
30 super.setCellRenderer(cellRenderer
);
34 * Sets the delegate that is used to paint each cell in the list. The job of
35 * a cell renderer is discussed in detail in the <a href="#renderer">class
36 * level documentation</a>.
38 * If the {@code prototypeCellValue} property is {@code non-null}, setting
39 * the cell renderer also causes the {@code fixedCellWidth} and
40 * {@code fixedCellHeight} properties to be re-calculated. Only one
41 * <code>PropertyChangeEvent</code> is generated however - for the
42 * <code>cellRenderer</code> property.
44 * The default value of this property is provided by the {@code ListUI}
45 * delegate, i.e. by the look and feel implementation.
47 * This is a JavaBeans bound property.
50 * the <code>ListCellRenderer</code> that paints list cells
51 * @see #getCellRenderer
52 * @beaninfo bound: true attribute: visualUpdate true description: The
53 * component used to draw the cells.
55 public void setCellRenderer(ListCellRenderer6
<E
> cellRenderer
) {
56 super.setCellRenderer(cellRenderer
);
61 public void setModel(ListModel model
) {
62 super.setModel(model
);
66 * Sets the model that represents the contents or "value" of the list,
67 * notifies property change listeners, and then clears the list's selection.
69 * This is a JavaBeans bound property.
72 * the <code>ListModel</code> that provides the list of items for
74 * @exception IllegalArgumentException
75 * if <code>model</code> is <code>null</code>
77 * @see #clearSelection
78 * @beaninfo bound: true attribute: visualUpdate true description: The
79 * object that contains the data to be drawn by this JList.
81 public void setModel(ListModel6
<E
> model
) {
82 super.setModel(model
);