1 /*
2 * %W% %E%
3 *
4 * Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved.
5 *
6 * Redistribution and use in source and binary forms, with or
7 * without modification, are permitted provided that the following
8 * conditions are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * - Redistribution in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials
16 * provided with the distribution.
17 *
18 * Neither the name of Sun Microsystems, Inc. or the names of
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * This software is provided "AS IS," without a warranty of any
23 * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
24 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
26 * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
27 * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR
28 * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR
29 * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
30 * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
31 * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
32 * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
33 * THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
34 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
35 *
36 * You acknowledge that this software is not designed, licensed or
37 * intended for use in the design, construction, operation or
38 * maintenance of any nuclear facility.
39 */
40
41 package com.puppycrawl.tools.checkstyle.gui;
42
43 import javax.swing.tree.TreeModel;
44
45 /**
46 * TreeTableModel is the model used by a JTreeTable. It extends TreeModel
47 * to add methods for getting information about the set of columns each
48 * node in the TreeTableModel may have. Each column, like a column in
49 * a TableModel, has a name and a type associated with it. Each node in
50 * the TreeTableModel can return a value for each of the columns and
51 * set that value if isCellEditable() returns true.
52 *
53 * <a href="http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html">Original Source Location</a>
54 *
55 * @author Philip Milne
56 * @author Scott Violet
57 */
58 public interface TreeTableModel extends TreeModel
59 {
60 /**
61 * @return the number of available column.
62 */
63 int getColumnCount();
64
65 /**
66 * @param column the column number
67 * @return the name for column number <code>column</code>.
68 */
69 String getColumnName(int column);
70
71 /**
72 * @param column the column number
73 * @return the type for column number <code>column</code>.
74 */
75 Class<?> getColumnClass(int column);
76
77 /**
78 * @param node the node
79 * @param column the column number
80 * @return the value to be displayed for node <code>node</code>,
81 * at column number <code>column</code>.
82 */
83 Object getValueAt(Object node, int column);
84
85 /**
86 * Indicates whether the the value for node <code>node</code>,
87 * at column number <code>column</code> is editable.
88 *
89 * @param node the node.
90 * @param column the column number
91 * @return true if editable
92 */
93 boolean isCellEditable(Object node, int column);
94
95 /**
96 * Sets the value for node <code>node</code>,
97 * at column number <code>column</code>.
98 *
99 * @param aValue the value to set
100 * @param node the node to set the value on
101 * @param column the column number
102 */
103 void setValueAt(Object aValue, Object node, int column);
104 }