01: /*
02: * Created on Oct 31, 2004
03: *
04: * @author ctaylor
05: *
06: */
07: package com.pk;
08:
09: import java.util.ArrayList;
10: import java.util.List;
11:
12: import javax.swing.table.AbstractTableModel;
13:
14: /**
15: * @author ctaylor
16: *
17: */
18: public class HistoryTableModel extends AbstractTableModel {
19: /**
20: *
21: */
22: private static final long serialVersionUID = 7819323023821508187L;
23: private List statmentHistory = new ArrayList();
24:
25: /* (non-Javadoc)
26: * @see javax.swing.table.TableModel#getColumnCount()
27: */
28: public int getColumnCount() {
29: return 1;
30: }
31:
32: /* (non-Javadoc)
33: * @see javax.swing.table.TableModel#getRowCount()
34: */
35: public int getRowCount() {
36: if (statmentHistory != null) {
37: return statmentHistory.size();
38: }
39: return 0;
40: }
41:
42: /* (non-Javadoc)
43: * @see javax.swing.table.TableModel#getValueAt(int, int)
44: */
45: public Object getValueAt(int row, int column) {
46: return statmentHistory.get(row);
47: }
48:
49: public String getColumnName(int arg0) {
50: return "SQL Statement";
51: }
52:
53: /**
54: * @param statmentHistory The statmentHistory to set.
55: */
56: public void setStatmentHistory(List statmentHistory) {
57: this.statmentHistory = statmentHistory;
58: }
59: }
|