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