KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > tree2 > TreeNode


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.myfaces.custom.tree2;
18
19 import java.util.List JavaDoc;
20 import java.io.Serializable JavaDoc;
21
22 /**
23  * Defines the requirements for an object that can be used as a tree node for
24  * use in a {@link UITreeData} component. (inspired by javax.swing.tree.TreeNode).
25  *
26  * @author Sean Schofield
27  * @version $Revision: 1.4 $ $Date: 2005/03/16 19:32:01 $
28  */

29
30 public interface TreeNode extends Serializable JavaDoc
31 {
32     public boolean isLeaf();
33
34     public void setLeaf(boolean leaf);
35
36     public List JavaDoc getChildren();
37
38     /**
39      * Gets the type of {@link TreeNode}.
40      * @return The node type
41      */

42     public String JavaDoc getType();
43
44
45     /**
46      * Sets the type of {@link TreeNode}.
47      * @param type The node type
48      */

49     public void setType(String JavaDoc type);
50
51
52     public String JavaDoc getDescription();
53
54
55     public void setDescription(String JavaDoc description);
56
57
58     /**
59      * Sets the identifier associated with the {@link TreeNode}.
60      * @param id The identifier
61      */

62     public void setIdentifier(String JavaDoc identifier);
63
64
65     /**
66      * Gets the identifier asociated with the {@link TreeNode}.
67      * @return the identifier
68      */

69     public String JavaDoc getIdentifier();
70
71
72     /**
73      * Gets the number of children this node has.
74      * @return the number of children
75      */

76     public int getChildCount();
77
78 }
79
Popular Tags