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.TreeModel;
22:
23: /**
24: * TreeTableModel is the model used by a TreeTable. It extends TreeModel
25: * to add methods for getting inforamtion about the set of columns each
26: * node in the TreeTableModel may have. Each column, like a column in
27: * a TableModel, has a name and a type associated with it. Each node in
28: * the TreeTableModel can return a value for each of the columns and
29: * set that value if isCellEditable() returns true.
30: */
31: public interface TreeTableModel extends TreeModel {
32: /**
33: * Returns the number ofs availible column.
34: */
35: public int getColumnCount();
36:
37: /**
38: * Returns the name for column number <code>column</code>.
39: */
40: public String getColumnName(int column);
41:
42: /**
43: * Returns the type for column number <code>column</code>.
44: */
45: public Class getColumnClass(int column);
46:
47: /**
48: * Returns the value to be displayed for node <code>node</code>,
49: * at column number <code>column</code>.
50: */
51: public Object getValueAt(Object node, int column);
52:
53: /**
54: * Indicates whether the the value for node <code>node</code>,
55: * at column number <code>column</code> is editable.
56: */
57: public boolean isCellEditable(Object node, int column);
58:
59: /**
60: * Sets the value for node <code>node</code>, at column number
61: * <code>column</code>.
62: */
63: public void setValueAt(Object aValue, Object node, int column);
64: }
65:
66: /*
67: * Local Variables:
68: * tab-width: 2
69: * indent-tabs-mode: nil
70: * mode: java
71: * c-indentation-style: java
72: * c-basic-offset: 2
73: * eval: (c-set-offset 'substatement-open '0)
74: * eval: (c-set-offset 'case-label '+)
75: * eval: (c-set-offset 'inclass '+)
76: * eval: (c-set-offset 'inline-open '0)
77: * End:
78: */
|