KickJava   Java API By Example, From Geeks To Geeks.

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


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 import javax.swing.tree.TreePath JavaDoc;
22 import org.netbeans.jellytools.Bundle;
23 import org.netbeans.jellytools.actions.Action;
24 import org.netbeans.jellytools.actions.PropertiesAction;
25 import org.netbeans.jellytools.modules.xml.catalog.actions.MountCatalogAction;
26 import org.netbeans.jellytools.nodes.Node;
27 import org.netbeans.jemmy.operators.JTreeOperator;
28
29 /** XMLEntityCatalogsNode Class
30  * @author ms113234 */

31 public class XMLEntityCatalogsNode extends AbstractNode {
32     private static final String JavaDoc MY_PATH = Bundle
33     .getString("org.netbeans.modules.xml.catalog.Bundle", "TEXT_catalog_root"); // NOI18N
34

35     private static final Action mountCatalogAction = new MountCatalogAction();
36     private static final Action propertiesAction = new PropertiesAction();
37
38     /** creates new XMLEntityCatalogsNode
39      * @param tree JTreeOperator of tree
40      * @param treePath String tree path */

41     public XMLEntityCatalogsNode(JTreeOperator tree, String JavaDoc treePath) {
42         super(tree, treePath);
43     }
44
45     /** creates new XMLEntityCatalogsNode
46      * @param tree JTreeOperator of tree
47      * @param treePath TreePath of node */

48     public XMLEntityCatalogsNode(JTreeOperator tree, TreePath JavaDoc treePath) {
49         super(tree, treePath);
50     }
51
52     /** creates new XMLEntityCatalogsNode
53      * @param parent parent Node
54      * @param treePath String tree path from parent Node */

55     public XMLEntityCatalogsNode(Node parent, String JavaDoc treePath) {
56         super(parent, treePath);
57     }
58
59     /** tests popup menu items for presence */
60     public void verifyPopup() {
61         verifyPopup(new Action[]{
62             mountCatalogAction,
63             propertiesAction
64         });
65     }
66
67     /** performs MountCatalogAction with this node */
68     public void mountCatalog() {
69         mountCatalogAction.perform(this);
70     }
71
72     /** performs PropertiesAction with this node */
73     public void properties() {
74         propertiesAction.perform(this);
75     }
76     
77     // LIB /////////////////////////////////////////////////////////////////////
78

79     /** returns default XML Entity Catalogs node instance */
80     public static XMLEntityCatalogsNode getInstance() {
81         return new XMLEntityCatalogsNode(AbstractNode.getRuntimeTab().tree(), MY_PATH);
82     }
83     
84    /** returns catalog node with given name or <code>null</code> */
85     public CatalogNode getCatalog(String JavaDoc displayName) {
86         return (CatalogNode) getChild(displayName, CatalogNode.class);
87     }
88 }
89
90
Popular Tags