KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > ui > actions > extensibility > AddAttributeAction


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /*
21  * AddAttributeAction.java
22  *
23  * Created on April 25, 2006, 11:29 PM
24  *
25  * To change this template, choose Tools | Template Manager
26  * and open the template in the editor.
27  */

28
29 package org.netbeans.modules.xml.wsdl.ui.actions.extensibility;
30
31 import java.util.HashSet JavaDoc;
32 import java.util.Map JavaDoc;
33 import java.util.Set JavaDoc;
34 import java.util.Vector JavaDoc;
35
36 import javax.xml.namespace.QName JavaDoc;
37
38 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
39 import org.netbeans.modules.xml.wsdl.ui.actions.CommonAddExtensibilityAttributeAction;
40 import org.netbeans.modules.xml.wsdl.ui.common.Constants;
41 import org.netbeans.modules.xml.wsdl.ui.netbeans.module.Utility;
42 import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent;
43
44 /**
45  *
46  * @author radval
47  */

48 public class AddAttributeAction extends CommonAddExtensibilityAttributeAction {
49     
50     /** Creates a new instance of AddAttributeAction */
51     public AddAttributeAction() {
52     }
53     
54         
55     @Override JavaDoc
56     protected Vector JavaDoc<String JavaDoc> getNamespaces(WSDLComponent wsdlComponent) {
57         Map JavaDoc<String JavaDoc, String JavaDoc> prefixToNameSpaceMap = Utility.getPrefixes(wsdlComponent);
58         Set JavaDoc<String JavaDoc> namespaceSet = new HashSet JavaDoc<String JavaDoc>();
59         namespaceSet.addAll(prefixToNameSpaceMap.values());
60         
61         namespaceSet.remove(Constants.WSDL_DEFAUL_NAMESPACE);
62         QName JavaDoc qName = ((AbstractDocumentComponent) wsdlComponent).getQName();
63         namespaceSet.remove(qName.getNamespaceURI());
64         
65         return new Vector JavaDoc<String JavaDoc>(namespaceSet);
66     }
67 }
68
Popular Tags