KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > src > nodes > FilterFactory


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.openide.src.nodes;
21
22 import org.openide.nodes.Node;
23 import org.openide.src.*;
24
25 /** A factory used to create
26 * instances of hierarchy node implementations.
27 * Loaders that use the element hierarchy
28 * should implement this factory
29 * so as to provide their own implementations of hierarchy element nodes.
30 * @see ClassChildren
31 * @see SourceChildren
32 *
33 * @author Petr Hrebejk
34 */

35 public class FilterFactory implements ElementNodeFactory {
36
37     private ElementNodeFactory delegate;
38
39
40     public final void attachTo( ElementNodeFactory factory ) {
41         delegate = factory;
42     }
43
44     /** Make a node representing a constructor.
45     * @param element the constructor
46     * @return a constructor node instance
47     */

48     public Node createConstructorNode (ConstructorElement element) {
49         return delegate.createConstructorNode( element );
50     }
51
52     /** Make a node representing a method.
53     * @param element the method
54     * @return a method node instance
55     */

56     public Node createMethodNode (MethodElement element) {
57         return delegate.createMethodNode( element );
58     }
59
60     /** Make a node representing a field.
61     * @param element the field
62     * @return a field node instance
63     */

64     public Node createFieldNode (FieldElement element) {
65         return delegate.createFieldNode( element );
66     }
67
68     /** Make a node representing an initializer.
69     * @param element the initializer
70     * @return an initializer node instance
71     */

72     public Node createInitializerNode (InitializerElement element) {
73         return delegate.createInitializerNode( element );
74     }
75
76     /** Make a node representing a class.
77     * @param element the class
78     * @return a class node instance
79     */

80     public Node createClassNode (ClassElement element) {
81         return delegate.createClassNode( element );
82     }
83
84     /** Make a node indicating that the creation of children
85     * is still under way.
86     * It should be used when the process is slow.
87     * @return a wait node
88     */

89     public Node createWaitNode () {
90         return delegate.createWaitNode( );
91     }
92
93     /** Make a node indicating that there was an error creating
94     * the element children.
95     * @return the error node
96     */

97     public Node createErrorNode () {
98         return delegate.createErrorNode( );
99     }
100
101 }
102
Popular Tags