01: /*=============================================================================
02: * Copyright Texas Instruments 2002. All Rights Reserved.
03: *
04: * This program is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package ti.swing.treetable;
20:
21: import javax.swing.tree.*;
22: import javax.swing.event.*;
23:
24: /**
25: * Default implmentations for methods in the TreeTableModel interface.
26: */
27: public abstract class AbstractTreeTableModel extends AbstractTreeModel
28: implements TreeTableModel {
29: protected EventListenerList listenerList = new EventListenerList();
30:
31: /**
32: * Class Constructor.
33: */
34: public AbstractTreeTableModel(Object root) {
35: super (root);
36: }
37:
38: public Class getColumnClass(int column) {
39: return Object.class;
40: }
41:
42: /**
43: * By default, make the column with the Tree in it the only editable one.
44: * Making this column editable causes the JTable to forward mouse
45: * and keyboard events in the Tree column to the underlying JTree.
46: */
47: public boolean isCellEditable(Object node, int column) {
48: return getColumnClass(column) == TreeTableModel.class;
49: }
50:
51: public void setValueAt(Object aValue, Object node, int column) {
52: }
53: }
54:
55: /*
56: * Local Variables:
57: * tab-width: 2
58: * indent-tabs-mode: nil
59: * mode: java
60: * c-indentation-style: java
61: * c-basic-offset: 2
62: * eval: (c-set-offset 'substatement-open '0)
63: * eval: (c-set-offset 'case-label '+)
64: * eval: (c-set-offset 'inclass '+)
65: * eval: (c-set-offset 'inline-open '0)
66: * End:
67: */
|