1 19 20 26 package org.netbeans.modules.xml.wsdl.ui.commands; 27 28 import java.io.IOException ; 29 30 import org.netbeans.modules.xml.wsdl.model.WSDLComponent; 31 import org.netbeans.modules.xml.wsdl.ui.model.StringAttribute; 32 import org.openide.ErrorManager; 33 34 35 41 public class XMLAttributePropertyAdapter extends CommonAttributePropertyAdapter { 42 43 private String mAttrName; 44 45 public XMLAttributePropertyAdapter(String attrName, WSDLComponent mWSDLConstruct) { 46 super(mWSDLConstruct); 47 this.mAttrName = attrName; 48 } 49 50 @Override 51 public void setValue(String value) { 52 getDelegate().getModel().startTransaction(); 53 if (value == null || value.length() == 0) 54 value = null; 55 getDelegate().setAttribute(this.mAttrName, new StringAttribute(this.mAttrName), value); 56 getDelegate().getModel().endTransaction(); 57 58 } 59 60 @Override 61 public String getValue() { 62 String value = getDelegate().getAttribute(new StringAttribute(this.mAttrName)); 63 if(value == null) { 64 value = ""; 65 } 66 67 return value; 68 } 69 } 70 | Popular Tags |