01: /*
02: * Created on 12.09.2003
03: *
04: * To change the template for this generated file go to
05: * Window - Preferences - Java - Code Generation - Code and Comments
06: */
07: package org.columba.mail.gui.config.template;
08:
09: import java.awt.Component;
10:
11: import javax.swing.DefaultListCellRenderer;
12: import javax.swing.JList;
13:
14: import org.columba.mail.message.ColumbaHeader;
15: import org.columba.mail.message.IHeaderList;
16:
17: /**
18: * @author frd
19: *
20: * To change the template for this generated type comment go to
21: * Window - Preferences - Java - Code Generation - Code and Comments
22: */
23: public class HeaderCellRenderer extends DefaultListCellRenderer {
24: IHeaderList list;
25:
26: /**
27: *
28: */
29: public HeaderCellRenderer(IHeaderList list) {
30: super ();
31: this .list = list;
32: }
33:
34: /* (non-Javadoc)
35: * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
36: */
37: public Component getListCellRendererComponent(JList arg0,
38: Object arg1, int arg2, boolean arg3, boolean arg4) {
39: super
40: .getListCellRendererComponent(arg0, arg1, arg2, arg3,
41: arg4);
42:
43: ColumbaHeader header = (ColumbaHeader) list.get(arg1);
44: String subject = (String) header.get("columba.subject");
45:
46: setText(subject);
47:
48: return this;
49: }
50: }
|