1 19 20 package org.netbeans.modules.xml.wsdl.ui.api.property; 21 22 import java.beans.PropertyEditor ; 23 24 import org.netbeans.modules.xml.xam.ui.XAMUtils; 25 import org.openide.ErrorManager; 26 import org.openide.nodes.PropertySupport; 27 28 33 public class ElementOrTypeAttributeProperty 34 extends PropertySupport.Reflection { 35 public static final String ELEMENT_ATTRIBUTE_NAME = "elementAttributeName"; 36 public static final String TYPE_ATTRIBUTE_NAME = "typeAttributeName"; 37 38 private ElementOrTypeProvider mProv; 39 40 public ElementOrTypeAttributeProperty(ElementOrTypeProvider prov) throws NoSuchMethodException { 41 super(prov, ElementOrType.class, "elementOrType"); mProv = prov; 43 } 44 45 46 50 @Override 51 public PropertyEditor getPropertyEditor() { 52 53 ElementOrTypePropertyEditor editor = new ElementOrTypePropertyEditor(mProv); 54 try { 55 editor.setValue(this.getValue()); 56 } catch(Exception ex) { 57 ErrorManager.getDefault().notify(ex); 58 } 59 return editor; 60 61 } 62 63 @Override 64 public boolean canWrite() { 65 return XAMUtils.isWritable(mProv.getModel()); 66 } 67 68 } | Popular Tags |