1 7 package org.columba.core.gui.plugin; 8 9 import java.awt.Component ; 10 11 import javax.swing.JTable ; 12 import javax.swing.SwingConstants ; 13 import javax.swing.table.DefaultTableCellRenderer ; 14 15 16 22 public class VersionRenderer extends DefaultTableCellRenderer { 23 26 public VersionRenderer() { 27 super(); 28 29 setHorizontalAlignment(SwingConstants.CENTER); 30 31 setOpaque(true); 32 } 33 34 37 public Component getTableCellRendererComponent(JTable table, Object value, 38 boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) { 39 super.getTableCellRendererComponent(table, value, isSelected, hasFocus, 40 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 } 55 | Popular Tags |