Module tvbrowser

Class 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 Detail

      • SelectableItemRenderer

        public SelectableItemRenderer()
    • 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 interface javax.swing.ListCellRenderer<E>