1 19 20 package org.netbeans.modules.xml.wsdlextui.property; 21 22 23 import java.util.Arrays ; 24 import java.util.Collection ; 25 26 import javax.xml.namespace.QName ; 27 28 import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement; 29 import org.netbeans.modules.xml.wsdl.ui.api.property.ExtensibilityElementPropertyAdapter; 30 import org.netbeans.modules.xml.wsdl.ui.api.property.StringAttributeProperty; 31 import org.netbeans.modules.xml.wsdl.ui.spi.ExtensibilityElementConfigurator; 32 import org.openide.ErrorManager; 33 import org.openide.nodes.Node; 34 import org.openide.util.NbBundle; 35 36 40 public class SoapBindingConfigurator extends ExtensibilityElementConfigurator { 41 42 43 private static QName bindingQName = new QName ("http://schemas.xmlsoap.org/wsdl/soap/", "binding"); 44 private static QName operationQName = new QName ("http://schemas.xmlsoap.org/wsdl/soap/", "operation"); 45 46 private static QName [] supportedQNames = {bindingQName, operationQName}; 47 48 private static String transport = "http://schemas.xmlsoap.org/soap/http"; 49 50 51 public SoapBindingConfigurator() { 52 } 53 54 @Override 55 public Collection <QName > getSupportedQNames() { 56 return Arrays.asList(supportedQNames); 57 } 58 59 @Override 60 public Node.Property getProperty(ExtensibilityElement extensibilityElement, QName qname, String attributeName) { 61 Node.Property property = null; 62 if (bindingQName.equals(qname)) { 63 if ("transport".equals(attributeName)) { 64 ExtensibilityElementPropertyAdapter adapter = new ExtensibilityElementPropertyAdapter(extensibilityElement, attributeName, transport); 65 try { 66 property = new StringAttributeProperty(adapter, String .class, "getValue", "setValue"); 67 property.setName(NbBundle.getMessage(SoapAddressConfigurator.class, "PROP_NAME_BINDING_TRANSPORT")); 68 } catch (NoSuchMethodException e) { 69 ErrorManager.getDefault().notify(e); 70 } 71 } 72 } 73 return property; 74 } 75 76 77 78 @Override 79 public String getDisplayAttributeName(ExtensibilityElement extensibilityElement, QName qname) { 80 return null; 81 } 82 83 @Override 84 public String getAttributeUniqueValuePrefix(ExtensibilityElement extensibilityElement, QName qname, String attributeName) { 85 return null; 87 } 88 89 @Override 90 public String getDefaultValue(ExtensibilityElement extensibilityElement, QName qname, String attributeName) { 91 if (qname.equals(bindingQName)) { 92 if ("transport".equals(attributeName)) { 93 return transport; 94 } 95 } 96 return null; 97 } 98 99 @Override 100 public String getTypeDisplayName(ExtensibilityElement extensibilityElement, QName qname) { 101 if (qname.equals(bindingQName)) 102 return NbBundle.getMessage(SoapBindingConfigurator.class, "LBL_SoapBinding_TypeDisplayName"); 103 else if (qname.equals(operationQName)) 104 return NbBundle.getMessage(SoapBindingConfigurator.class, "LBL_SoapOperation_TypeDisplayName"); 105 return null; 106 } 107 108 } 109 110 | Popular Tags |