All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.ui.framework.java.ListItemCellRenderer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JLabel
                                   |
                                   +----javax.swing.DefaultListCellRenderer
                                           |
                                           +----com.ibm.as400.ui.framework.java.ListItemCellRenderer

public class ListItemCellRenderer
extends DefaultListCellRenderer
An extension of DefaultListCellRenderer that performs all the same function as the base class, and additionally supports displaying icons on items in lists if the items have an image associated with them. A cell renderer class can be specified on the Renderer property of a List in the GUI Builder. This will result in an object of the specified Renderer class being attached to the the JList object created for this list. This renderer object will be used to render all items in the list. Whenever an item in the list needs to be drawn, a call will be made to the renderer object's getListCellRendererComponent method.

If a Renderer class is not specified in the Renderer property for a List in the GUI Builder, PanelManager creates a ListItemCellRenderer object and attaches it to the list as the cell renderer. To display an item in the list, this renderer will use the icon, icon positioning attributes, and text from the ItemDescriptor associated with the cell being drawn.

See Also:
DefaultListCellRenderer

Constructor Index

 o ListItemCellRenderer()
Constructs a ListItemCellRenderer object.

Method Index

 o getListCellRendererComponent(JList, Object, int, boolean, boolean)
Sets up the Component to be used to render the cell.

Constructors

 o ListItemCellRenderer
 public ListItemCellRenderer()
Constructs a ListItemCellRenderer object.

Methods

 o getListCellRendererComponent
 public Component getListCellRendererComponent(JList list,
                                               Object value,
                                               int index,
                                               boolean iss,
                                               boolean chf)
Sets up the Component to be used to render the cell. We call the super class's method to do all the standard processing, and then process set the icon and adjust the text position if necessary.

Parameters:
list - JList to which this cell belongs
value - Object to display
index - index of the cell in the list
iss - Boolean indicating if the cell is selected
chf - Boolean indicating if the cell has focus
Overrides:
getListCellRendererComponent in class DefaultListCellRenderer

All Packages  Class Hierarchy  This Package  Previous  Next  Index