KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > tree > MutableTreeNode


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 package org.apache.myfaces.custom.tree;
17
18 /**
19  * Defines the requirements for a tree node object that can change -- by adding or removing
20  * child nodes, or by changing the contents of a user object stored in the node.
21  * (inspired by javax.swing.tree.MutableTreeNode).
22  *
23  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
24  * @version $Revision: 1.3 $ $Date: 2004/10/13 11:50:58 $
25  * $Log: MutableTreeNode.java,v $
26  * Revision 1.3 2004/10/13 11:50:58 matze
27  * renamed packages to org.apache
28  *
29  * Revision 1.2 2004/07/01 21:53:07 mwessendorf
30  * ASF switch
31  *
32  * Revision 1.1 2004/04/22 10:20:23 manolito
33  * tree component
34  *
35  */

36 public interface MutableTreeNode
37         extends TreeNode
38 {
39
40     /**
41      * Add the given child to the children of this node.
42      * This will set this node as the parent of the child using {#setParent}.
43      */

44     void insert(MutableTreeNode child);
45
46
47     /**
48      * Add the given child to the children of this node at index.
49      * This will set this node as the parent of the child using {#setParent}.
50      */

51     void insert(MutableTreeNode child, int index);
52
53
54     /**
55      * Remove the child at the given index.
56      */

57     void remove(int index);
58
59
60     /**
61      * Remove the given node.
62      */

63     void remove(MutableTreeNode node);
64
65
66     /**
67      * Sets the user object of this node.
68      */

69     void setUserObject(Object JavaDoc object);
70
71
72     /**
73      * Remove this node from its parent.
74      */

75     void removeFromParent();
76
77
78     /**
79      * Set the parent node.
80      */

81     void setParent(MutableTreeNode parent);
82 }
83
Popular Tags