/***************************************************
*
* cismet GmbH, Saarbruecken, Germany
*
* ... and it just works.
*
****************************************************/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package de.cismet.tools.gui.documents;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JLabel;
import javax.swing.JList;
/**
* DOCUMENT ME!
*
* @author hell
* @version $Revision$, $Date$
*/
public class DocumentListCellRenderer extends DefaultListCellRenderer {
//~ Methods ----------------------------------------------------------------
@Override
public Component getListCellRendererComponent(final JList list,
final Object value,
final int index,
final boolean isSelected,
final boolean cellHasFocus) {
final JLabel l = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Document) {
final Document d = ((Document)value);
l.setIcon(d.getIcon());
}
return l;
}
}