KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdlextui > property > SoapFaultConfigurator


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 package org.netbeans.modules.xml.wsdlextui.property;
21
22
23 import java.util.Arrays JavaDoc;
24 import java.util.Collection JavaDoc;
25
26 import javax.xml.namespace.QName JavaDoc;
27
28 import org.netbeans.modules.xml.wsdl.model.BindingFault;
29 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;
30 import org.netbeans.modules.xml.wsdl.ui.api.property.ExtensibilityElementPropertyAdapter;
31 import org.netbeans.modules.xml.wsdl.ui.api.property.ReadOnlyProperty;
32 import org.netbeans.modules.xml.wsdl.ui.spi.ExtensibilityElementConfigurator;
33 import org.openide.nodes.Node;
34 import org.openide.util.NbBundle;
35
36 /**
37  *
38  * @author skini
39  */

40 public class SoapFaultConfigurator extends ExtensibilityElementConfigurator {
41     
42     
43     private static QName JavaDoc faultQName = new QName JavaDoc("http://schemas.xmlsoap.org/wsdl/soap/", "fault");
44     
45     private static QName JavaDoc[] supportedQNames = {faultQName};
46     /** Creates a new instance of SoapHeaderConfigurator */
47     public SoapFaultConfigurator() {
48     }
49     
50     @Override JavaDoc
51     public Collection JavaDoc<QName JavaDoc> getSupportedQNames() {
52         return Arrays.asList(supportedQNames);
53     }
54     
55     @Override JavaDoc
56     public Node.Property getProperty(ExtensibilityElement extensibilityElement, QName JavaDoc qname, String JavaDoc attributeName) {
57         Node.Property property = null;
58         if (faultQName.equals(qname)) {
59             if ("name".equals(attributeName)) {
60                 String JavaDoc name = NbBundle.getMessage(SoapFaultConfigurator.class, "PROP_NAME_FAULT_NAME");
61                 property = new ReadOnlyProperty(new ExtensibilityElementPropertyAdapter(extensibilityElement, "name"), name, String JavaDoc.class, name, null);
62             }
63         }
64         return property;
65     }
66     
67     @Override JavaDoc
68     public String JavaDoc getDisplayAttributeName(ExtensibilityElement extensibilityElement, QName JavaDoc qname) {
69         // TODO Auto-generated method stub
70
return null;
71     }
72
73     @Override JavaDoc
74     public String JavaDoc getAttributeUniqueValuePrefix(ExtensibilityElement extensibilityElement, QName JavaDoc qname, String JavaDoc attributeName) {
75         // TODO Auto-generated method stub
76
return null;
77     }
78
79     @Override JavaDoc
80     public String JavaDoc getDefaultValue(ExtensibilityElement extensibilityElement, QName JavaDoc qname, String JavaDoc attributeName) {
81         if ("name".equals(attributeName)) {
82             BindingFault fault = (BindingFault) extensibilityElement.getParent();
83             return fault.getName();
84         }
85         return null;
86     }
87     
88     @Override JavaDoc
89     public String JavaDoc getTypeDisplayName(ExtensibilityElement extensibilityElement, QName JavaDoc qname) {
90         return NbBundle.getMessage(SoapFaultConfigurator.class, "LBL_SoapFault_TypeDisplayName");
91     }
92 }
93
94
Popular Tags