KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > taglib > TLDNode


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.modules.web.taglib;
21
22 import org.openide.loaders.*;
23 import org.openide.util.HelpCtx;
24 import org.openide.nodes.Node;
25 import org.openide.nodes.Children;
26 import org.openide.util.actions.SystemAction;
27
28 /** TLD Node
29  * @author mk115033
30  */

31
32 public class TLDNode extends DataNode {
33
34     private static final boolean debug = false;
35
36     public static final int TLD_NODE = 0;
37     public static final int TAG_NODE = 2;
38     public static final int ATTRIBUTES_NODE = 3;
39     public static final int ATTRIBUTE_NODE = 4;
40     public static final int TEI_NODE = 5;
41     public static final int VARIABLE_NODE = 6;
42
43     ///
44
/// ICON specifications for the various node types.
45
///
46
public static final String JavaDoc ICON_BASE_CLASSES =
47         "org/netbeans/modules/web/taglib/default"; //NOI18N
48
public static final String JavaDoc ICON_BASE_DEFAULT =
49         "org/netbeans/modules/web/taglib/default"; // NOI18N
50

51     public static final String JavaDoc ICON_BASE_TLD =
52         "org/netbeans/modules/web/taglib/resources/tags"; //NOI18N
53
public static final String JavaDoc ICON_BASE_TAG =
54         "org/netbeans/modules/web/taglib/resources/tag"; //NOI18N
55
public static final String JavaDoc ICON_BASE_ATTRIBUTES =
56         "org/netbeans/modules/web/taglib/resources/attributes"; //NOI18N
57
public static final String JavaDoc ICON_BASE_ATTRIBUTE =
58         "org/netbeans/modules/web/taglib/resources/attribute"; //NOI18N
59
public static final String JavaDoc ICON_BASE_TEI =
60         "org/netbeans/modules/web/taglib/resources/variables"; //NOI18N
61
public static final String JavaDoc ICON_BASE_VARIABLES =
62         "org/netbeans/modules/web/taglib/resources/variables"; //NOI18N
63
public static final String JavaDoc ICON_BASE_VARIABLE =
64         "org/netbeans/modules/web/taglib/resources/variable"; //NOI18N
65

66     public TLDNode (final TLDDataObject dataObject) {
67     super(dataObject,Children.LEAF);
68         setIconBase(ICON_BASE_TLD);
69     }
70     
71     //
72
// We return null in createActions to signal that actions should be gotten from getActions(),
73
// so that we can vary the actions depending on the state of node.
74
//
75

76     protected SystemAction[] createActions () {
77     return null;
78     }
79
80     protected String JavaDoc getIconBase() {
81     return getIconBase(TLD_NODE);
82     }
83
84     public static String JavaDoc getIconBase(int type) {
85     switch (type) {
86     case TLD_NODE:
87         return ICON_BASE_TLD;
88     case TAG_NODE:
89         return ICON_BASE_TAG;
90     case ATTRIBUTES_NODE:
91         return ICON_BASE_ATTRIBUTES;
92     case ATTRIBUTE_NODE:
93         return ICON_BASE_ATTRIBUTE;
94     case TEI_NODE:
95         return ICON_BASE_TEI;
96     case VARIABLE_NODE:
97         return ICON_BASE_VARIABLE;
98         
99     }
100     return ICON_BASE_DEFAULT;
101     }
102
103     public String JavaDoc getDisplayName() {
104     String JavaDoc dn = super.getDisplayName();
105     return dn;
106     }
107
108     // test to see if we can use DeleteAction
109
public boolean canDestroy() {
110     return true;
111     }
112    
113 }
114
Popular Tags