KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > usertasks > treetable > TreeTableModel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /*
21  * this file is derived from the "Creating TreeTable" article at
22  * http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html
23  */

24 package org.netbeans.modules.tasklist.usertasks.treetable;
25
26 import javax.swing.tree.TreeModel JavaDoc;
27 import org.netbeans.modules.tasklist.core.table.SortingModel;
28
29 /**
30  * TreeTableModel is the model used by a JTreeTable. It extends TreeModel
31  * to add methods for getting inforamtion about the set of columns each
32  * node in the TreeTableModel may have. Each column, like a column in
33  * a TableModel, has a name and a type associated with it. Each node in
34  * the TreeTableModel can return a value for each of the columns and
35  * set that value if isCellEditable() returns true.
36  *
37  * @author Philip Milne
38  * @author Scott Violet
39  */

40 public interface TreeTableModel extends TreeModel JavaDoc {
41     /**
42      * Returns the number ofs availible column.
43      */

44     public int getColumnCount();
45     
46     /**
47      * Returns the name for column number <code>column</code>.
48      */

49     public String JavaDoc getColumnName(int column);
50     
51     /**
52      * Returns the type for column number <code>column</code>.
53      */

54     public Class JavaDoc getColumnClass(int column);
55     
56     /**
57      * Returns the value to be displayed for node <code>node</code>,
58      * at column number <code>column</code>.
59      */

60     public Object JavaDoc getValueAt(Object JavaDoc node, int column);
61     
62     /**
63      * Indicates whether the the value for node <code>node</code>,
64      * at column number <code>column</code> is editable.
65      */

66     public boolean isCellEditable(Object JavaDoc node, int column);
67     
68     /**
69      * Sets the value for node <code>node</code>,
70      * at column number <code>column</code>.
71      *
72      * @param aValue new value
73      * @param node a node from this model
74      * @param column column index
75      */

76     public void setValueAt(Object JavaDoc aValue, Object JavaDoc node, int column);
77     
78     /**
79      * Sorted column changed.
80      * The model should rearrange the nodes.
81      *
82      * @param sm sorting model
83      */

84     public void sort(SortingModel sm);
85 }
86
Popular Tags