KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > nodes > NodeListener


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 package org.openide.nodes;
20
21
22 /** Listener to special changes in <code>Node</code>s. Is a property
23 * change listener so that all changes in properties in the {@link Node node} can be fired
24 * in the usual way.
25 * <P>
26 * Methods childrenAdded, childrenRemoved and childrenReordered are called
27 * with Children.MUTEX.writeAccess which guarantees that no other thread
28 * can change the hierarchy during that time, but also requires proper
29 * implementation of all NodeListeners which should avoid calls
30 * to other threads which might require access
31 * to Children.MUTEX due to changes nodes hierarchy or do any other kind of
32 * starvation.
33 *
34 *
35 * @author Jaroslav Tulach
36 */

37 public interface NodeListener extends java.beans.PropertyChangeListener JavaDoc {
38     /** Fired when a set of new children is added.
39     * @param ev event describing the action
40     */

41     public void childrenAdded(NodeMemberEvent ev);
42
43     /** Fired when a set of children is removed.
44     * @param ev event describing the action
45     */

46     public void childrenRemoved(NodeMemberEvent ev);
47
48     /** Fired when the order of children is changed.
49     * @param ev event describing the change
50     */

51     public void childrenReordered(NodeReorderEvent ev);
52
53     /** Fired when the node is deleted.
54     * @param ev event describing the node
55     */

56     public void nodeDestroyed(NodeEvent ev);
57 }
58
Popular Tags