KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > swing > treetable > TreeTableModel


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.swing.treetable;
19
20 /*
21  * TreeTableModel.java
22  *
23  * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
24  *
25  * This software is the confidential and proprietary information of Sun
26  * Microsystems, Inc. ("Confidential Information"). You shall not
27  * disclose such Confidential Information and shall use it only in
28  * accordance with the terms of the license agreement you entered into
29  * with Sun.
30  *
31  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
32  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
33  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
34  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
35  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
36  * THIS SOFTWARE OR ITS DERIVATIVES.
37  *
38  */

39
40 import javax.swing.tree.TreeModel JavaDoc;
41
42 /**
43  * TreeTableModel is the model used by a JTreeTable. It extends TreeModel
44  * to add methods for getting inforamtion about the set of columns each
45  * node in the TreeTableModel may have. Each column, like a column in
46  * a TableModel, has a name and a type associated with it. Each node in
47  * the TreeTableModel can return a value for each of the columns and
48  * set that value if isCellEditable() returns true.
49  *
50  * @author Philip Milne
51  * @author Scott Violet
52  */

53 public interface TreeTableModel extends TreeModel JavaDoc
54 {
55     /**
56      * Returns the number ofs availible column.
57      */

58     public int getColumnCount();
59
60     /**
61      * Returns the name for column number <code>column</code>.
62      */

63     public String JavaDoc getColumnName(int column);
64
65     /**
66      * Returns the type for column number <code>column</code>.
67      */

68     public Class JavaDoc getColumnClass(int column);
69
70     /**
71      * Returns the value to be displayed for node <code>node</code>,
72      * at column number <code>column</code>.
73      */

74     public Object JavaDoc getValueAt(Object JavaDoc node, int column);
75
76     /**
77      * Indicates whether the the value for node <code>node</code>,
78      * at column number <code>column</code> is editable.
79      */

80     public boolean isCellEditable(Object JavaDoc node, int column);
81
82     /**
83      * Sets the value for node <code>node</code>,
84      * at column number <code>column</code>.
85      */

86     public void setValueAt(Object JavaDoc aValue, Object JavaDoc node, int column);
87 }
88
Popular Tags