01: /*
02: * OneLineTableModel.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.gui.components;
13:
14: import javax.swing.event.TableModelListener;
15: import javax.swing.table.TableModel;
16:
17: public class OneLineTableModel implements TableModel {
18: private String columnTitle;
19: private String message;
20:
21: public OneLineTableModel(String colTitle, String msg) {
22: this .columnTitle = colTitle;
23: this .message = msg;
24: }
25:
26: public void setMessage(String aMessage) {
27: this .message = aMessage;
28: }
29:
30: public Object getValueAt(int row, int col) {
31: return message;
32: }
33:
34: public void setValueAt(Object aValue, int row, int column) {
35: return;
36: }
37:
38: public int getColumnCount() {
39: return 1;
40: }
41:
42: public int getRowCount() {
43: return 1;
44: }
45:
46: public boolean isCellEditable(int row, int column) {
47: return false;
48: }
49:
50: public void addTableModelListener(TableModelListener l) {
51: }
52:
53: public Class getColumnClass(int columnIndex) {
54: return String.class;
55: }
56:
57: public String getColumnName(int columnIndex) {
58: return this .columnTitle;
59: }
60:
61: public void removeTableModelListener(TableModelListener l) {
62: }
63:
64: }
|