1 23 24 29 30 package com.sun.enterprise.tools.common.ui; 31 import javax.swing.table.*; 32 import com.sun.enterprise.tools.common.util.diagnostics.Reporter; 33 34 39 public class GenericTableModel extends AbstractTableModel 40 { 41 public GenericTableModel(GenericTableInfo info) 42 { 43 Reporter.assertIt(info); tableInfo = info; 45 } 47 48 50 public String getColumnName(int c) 51 { 52 return tableInfo.getColumnName(c); 53 } 54 55 57 public Class getColumnClass(int c) 58 { 59 return String .class; 60 } 61 62 64 public int getColumnCount() 65 { 66 return tableInfo.getColumnCount(); 67 } 68 69 71 public int getRowCount() 72 { 73 return tableInfo.getRowCount(); 74 } 75 76 78 public Object getValueAt(int r, int c) 79 { 80 return tableInfo.getString(r, c); 81 } 82 83 85 public void setValueAt(Object obj, int r, int c) 86 { 87 Reporter.assertIt(obj instanceof String ); String s = (String )obj; 89 90 tableInfo.setString(r, c, s); 91 } 92 93 95 public boolean isCellEditable(int r, int c) 96 { 97 boolean b = tableInfo.isColumnEditable(c); 98 return b; 101 } 102 103 105 private GenericTableInfo tableInfo = null; 106 } 107 108 | Popular Tags |