KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > spi > project > ui > support > NodeList


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
20 package org.netbeans.spi.project.ui.support;
21
22 import java.util.List JavaDoc;
23 import javax.swing.event.ChangeListener JavaDoc;
24 import org.openide.nodes.Node;
25
26 /**
27  * A <code>Children.Keys</code>-like abstration for use in
28  * {@link org.netbeans.spi.project.ui.support.NodeFactory}
29  * instances. For utility methods of creating a <code>NodeList</code> instance, see
30  * {@link org.netbeans.spi.project.ui.support.NodeFactorySupport}
31
32  * @param K the type of key you would like to use to represent nodes
33  * @author mkleint
34  * @since org.netbeans.modules.projectuiapi/1 1.18
35  */

36 public interface NodeList<K> {
37     /**
38      * child keys for which we later create a {@link org.openide.nodes.Node}
39      * in the node() method. If the change set of keys changes based on external
40      * events, fire a <code>ChangeEvent</code> to notify the parent Node.
41      */

42     List JavaDoc<K> keys();
43     /**
44      * add a change listener, primarily to be used by the infrastructure
45      * A change in keys provided by this NodeList is supposed to trigger a ChangeEvent
46      */

47     void addChangeListener(ChangeListener JavaDoc l); // change in keys()
48
/**
49      * remove a change listener, primarily to be used by the infrastructure
50      * A change in keys is supposed to trigger ChangeEvent
51      */

52     void removeChangeListener(ChangeListener JavaDoc l);
53     /**
54      * create Node for a given key, equal in semantics to <code>Children.Keys.createNode()</code>
55      */

56     Node node(K key);
57     /**
58      * callback from Children instance of the parent node, called by the infrastructure at <code>Children.addNotify()</code> time.
59      * To be used primarily for registering of listeners and caching of state.
60      */

61     void addNotify();
62     /**
63      * callback from Children instance of the parent node, called by the infrastructure at <code>Children.removeNotify()</code> time.
64      * To be used primarily for unregistering of listeners and general cleanup.
65      */

66     void removeNotify();
67 }
68
Popular Tags