KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > tree > model > TreeModelListener


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.model;
17
18
19 /**
20  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
21  * @version $Revision: 1.4 $ $Date: 2004/10/13 11:50:58 $
22  * $Log: TreeModelListener.java,v $
23  * Revision 1.4 2004/10/13 11:50:58 matze
24  * renamed packages to org.apache
25  *
26  * Revision 1.3 2004/07/01 21:53:04 mwessendorf
27  * ASF switch
28  *
29  * Revision 1.2 2004/05/04 00:28:17 o_rossmueller
30  * model event handling
31  *
32  * Revision 1.1 2004/04/22 10:20:24 manolito
33  * tree component
34  *
35  */

36 public interface TreeModelListener
37 {
38     /**
39      * <p>Invoked after a node (or a set of siblings) has changed in some
40      * way. The node(s) have not changed locations in the tree or
41      * altered their children arrays, but other attributes have
42      * changed and may affect presentation. Example: the name of a
43      * file has changed, but it is in the same location in the file
44      * system.</p>
45      * <p>To indicate the root has changed, childIndices and children
46      * will be null. </p>
47      * <p/>
48      * <p>Use <code>e.getPath()</code>
49      * to get the parent of the changed node(s).
50      * <code>e.getChildIndices()</code>
51      * returns the index(es) of the changed node(s).</p>
52      */

53     void treeNodesChanged(TreeModelEvent e);
54
55     /**
56      * <p>Invoked after nodes have been inserted into the tree.</p>
57      * <p/>
58      * <p>Use <code>e.getPath()</code>
59      * to get the parent of the new node(s).
60      * <code>e.getChildIndices()</code>
61      * returns the index(es) of the new node(s)
62      * in ascending order.</p>
63      */

64     void treeNodesInserted(TreeModelEvent e);
65
66     /**
67      * <p>Invoked after nodes have been removed from the tree. Note that
68      * if a subtree is removed from the tree, this method may only be
69      * invoked once for the root of the removed subtree, not once for
70      * each individual set of siblings removed.</p>
71      * <p/>
72      * <p>Use <code>e.getPath()</code>
73      * to get the former parent of the deleted node(s).
74      * <code>e.getChildIndices()</code>
75      * returns, in ascending order, the index(es)
76      * the node(s) had before being deleted.</p>
77      */

78     void treeNodesRemoved(TreeModelEvent e);
79
80     /**
81      * <p>Invoked after the tree has drastically changed structure from a
82      * given node down. If the path returned by e.getPath() is of length
83      * one and the first element does not identify the current root node
84      * the first element should become the new root of the tree.<p>
85      * <p/>
86      * <p>Use <code>e.getPath()</code>
87      * to get the path to the node.
88      * <code>e.getChildIndices()</code>
89      * returns null.</p>
90      */

91     void treeStructureChanged(TreeModelEvent e);
92
93 }
94
Popular Tags