01: /*
02: * Created on 07.08.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.core.gui.plugin;
08:
09: import java.awt.Component;
10:
11: import javax.swing.JTable;
12: import javax.swing.SwingConstants;
13: import javax.swing.table.DefaultTableCellRenderer;
14:
15: /**
16: * @author frd
17: *
18: * To change the template for this generated type comment go to
19: * Window>Preferences>Java>Code Generation>Code and Comments
20: */
21: public class VersionRenderer extends DefaultTableCellRenderer {
22: /**
23: *
24: */
25: public VersionRenderer() {
26: super ();
27:
28: setHorizontalAlignment(SwingConstants.CENTER);
29:
30: setOpaque(true);
31: }
32:
33: /* (non-Javadoc)
34: * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
35: */
36: public Component getTableCellRendererComponent(JTable table,
37: Object value, boolean isSelected, boolean hasFocus,
38: int rowIndex, int vColIndex) {
39: super .getTableCellRendererComponent(table, value, isSelected,
40: hasFocus, rowIndex, vColIndex);
41:
42: PluginNode node = (PluginNode) value;
43:
44: String version = node.getVersion();
45:
46: if (version == null) {
47: version = " ";
48: }
49:
50: setText(version);
51:
52: return this;
53: }
54: }
|