01: /*
02: * EmptyTableModel.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 EmptyTableModel implements TableModel {
18: public static final TableModel EMPTY_MODEL = new EmptyTableModel();
19:
20: private EmptyTableModel() {
21: }
22:
23: public Object getValueAt(int row, int col) {
24: return "";
25: }
26:
27: public void setValueAt(Object aValue, int row, int column) {
28: return;
29: }
30:
31: public int getColumnCount() {
32: return 0;
33: }
34:
35: public int getRowCount() {
36: return 0;
37: }
38:
39: public boolean isCellEditable(int row, int column) {
40: return false;
41: }
42:
43: public void addTableModelListener(TableModelListener l) {
44: }
45:
46: public Class getColumnClass(int columnIndex) {
47: return String.class;
48: }
49:
50: public String getColumnName(int columnIndex) {
51: return "";
52: }
53:
54: public void removeTableModelListener(TableModelListener l) {
55: }
56:
57: }
|