1 package com.ca.commons.cbutil; 2 3 16 17 import javax.swing.event.TableModelEvent ; 18 import javax.swing.event.TableModelListener ; 19 import javax.swing.table.AbstractTableModel ; 20 import javax.swing.table.TableModel ; 21 22 public class CBTableMap extends AbstractTableModel 23 implements TableModelListener 24 { 25 protected TableModel model; 26 27 public TableModel getModel() 28 { 29 return model; 30 } 31 32 public void setModel(TableModel model) 33 { 34 this.model = model; 35 model.addTableModelListener(this); 36 } 37 38 41 public Object getValueAt(int aRow, int aColumn) 42 { 43 return model.getValueAt(aRow, aColumn); 44 } 45 46 public void setValueAt(Object aValue, int aRow, int aColumn) 47 { 48 model.setValueAt(aValue, aRow, aColumn); 49 } 50 51 public int getRowCount() 52 { 53 return (model == null) ? 0 : model.getRowCount(); 54 } 55 56 public int getColumnCount() 57 { 58 return (model == null) ? 0 : model.getColumnCount(); 59 } 60 61 public String getColumnName(int aColumn) 62 { 63 return model.getColumnName(aColumn); 64 } 65 66 public Class getColumnClass(int aColumn) 67 { 68 return model.getColumnClass(aColumn); 69 } 70 71 public boolean isCellEditable(int row, int column) 72 { 73 return model.isCellEditable(row, column); 74 } 75 public void tableChanged(TableModelEvent e) 80 { 81 fireTableChanged(e); 82 } 83 } 84 | Popular Tags |