- java.lang.Object
-
- util.ui.customizableitems.SelectableItemRenderer<E>
-
- All Implemented Interfaces:
javax.swing.ListCellRenderer<SelectableItem<E>>
public class SelectableItemRenderer<E> extends java.lang.Object implements javax.swing.ListCellRenderer<SelectableItem<E>>
A ListCellRenderer for SelectableItems.- Author:
- René Mach
-
-
Constructor Summary
Constructors Constructor Description SelectableItemRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JPanel
getListCellComponent(javax.swing.JList<? extends SelectableItem<E>> list, SelectableItem<E> value, int index, boolean isSelected, boolean cellHasFocus)
java.awt.Component
getListCellRendererComponent(javax.swing.JList<? extends SelectableItem<E>> list, SelectableItem<E> value, int index, boolean isSelected, boolean cellHasFocus)
int
getSelectionWidth()
void
setCenterRendererComponent(java.lang.Class<?> clazz, SelectableItemRendererCenterComponentIf<E> component)
Sets the render component that is to be used for the given class or it's super class.void
setEnabled(boolean value)
protected void
setScrollPane(javax.swing.JScrollPane parentScrollPane)
-
-
-
Method Detail
-
getListCellComponent
public javax.swing.JPanel getListCellComponent(javax.swing.JList<? extends SelectableItem<E>> list, SelectableItem<E> value, int index, boolean isSelected, boolean cellHasFocus)
-
setEnabled
public void setEnabled(boolean value)
- Parameters:
value
- If the renderer should be enabled
-
getSelectionWidth
public int getSelectionWidth()
- Returns:
- The selection width.
-
setCenterRendererComponent
public void setCenterRendererComponent(java.lang.Class<?> clazz, SelectableItemRendererCenterComponentIf<E> component)
Sets the render component that is to be used for the given class or it's super class.- Parameters:
clazz
- The class to use the render component for, the render component is also used for the super class of clazz.component
- The render component.- Since:
- 2.7
-
setScrollPane
protected void setScrollPane(javax.swing.JScrollPane parentScrollPane)
-
getListCellRendererComponent
public java.awt.Component getListCellRendererComponent(javax.swing.JList<? extends SelectableItem<E>> list, SelectableItem<E> value, int index, boolean isSelected, boolean cellHasFocus)
- Specified by:
getListCellRendererComponent
in interfacejavax.swing.ListCellRenderer<E>
-
-