KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jellytools > modules > xml > catalog > nodes > CatalogNode


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.netbeans.jellytools.modules.xml.catalog.nodes;
20
21 /*
22  * CatalogNode.java
23  *
24  * Created on 11/13/03 4:01 PM
25  */

26
27 import org.netbeans.jellytools.actions.*;
28 import org.netbeans.jellytools.modules.jndi.actions.RefreshAction;
29 import org.netbeans.jellytools.modules.xml.catalog.actions.UnmountCatalogAction;
30 import org.netbeans.jellytools.nodes.Node;
31 import org.netbeans.jellytools.Bundle;
32 import javax.swing.tree.TreePath JavaDoc;
33 import java.awt.event.KeyEvent JavaDoc;
34 import org.netbeans.jemmy.operators.JTreeOperator;
35
36 /** CatalogNode Class
37  * @author ms113234 */

38 public class CatalogNode extends AbstractNode {
39     
40     private static final Action refreshAction = new RefreshAction();
41     private static final Action unmountCatalogAction = new UnmountCatalogAction();
42     private static final Action customizeAction = new CustomizeAction();
43     private static final Action propertiesAction = new PropertiesAction();
44
45     /** creates new CatalogNode
46      * @param tree JTreeOperator of tree
47      * @param treePath String tree path */

48     public CatalogNode(JTreeOperator tree, String JavaDoc treePath) {
49         super(tree, treePath);
50     }
51
52     /** creates new CatalogNode
53      * @param tree JTreeOperator of tree
54      * @param treePath TreePath of node */

55     public CatalogNode(JTreeOperator tree, TreePath JavaDoc treePath) {
56         super(tree, treePath);
57     }
58
59     /** creates new CatalogNode
60      * @param parent parent Node
61      * @param treePath String tree path from parent Node */

62     public CatalogNode(Node parent, String JavaDoc treePath) {
63         super(parent, treePath);
64     }
65
66     /** tests popup menu items for presence */
67     public void verifyPopup() {
68         verifyPopup(new Action[]{
69             refreshAction,
70             unmountCatalogAction,
71             customizeAction,
72             propertiesAction
73         });
74     }
75
76     /** performs RefreshAction with this node */
77     public void refresh() {
78         refreshAction.perform(this);
79     }
80
81     /** performs UnmountCatalogAction with this node */
82     public void unmountCatalog() {
83         unmountCatalogAction.perform(this);
84     }
85
86     /** performs CustomizeAction with this node */
87     public void customize() {
88         customizeAction.perform(this);
89     }
90
91     /** performs PropertiesAction with this node */
92     public void properties() {
93         propertiesAction.perform(this);
94     }
95     
96     // LIB /////////////////////////////////////////////////////////////////////
97

98    /** returns catalog entry node with given name or <code>null</code> */
99     public CatalogEntryNode getCatalogEntry(String JavaDoc displayName) {
100         return (CatalogEntryNode) getChild(displayName, CatalogEntryNode.class);
101     }
102 }
103
104
Popular Tags