1 19 20 26 27 package org.netbeans.modules.xml.schema.ui.nodes.schema.properties; 28 29 import java.beans.PropertyEditor ; 30 import java.lang.reflect.InvocationTargetException ; 31 import java.util.Set ; 32 import org.openide.util.NbBundle; 33 import org.netbeans.modules.xml.schema.model.SchemaComponent; 34 import org.netbeans.modules.xml.schema.ui.basic.editors.DerivationTypeEditor; 35 36 40 public class DerivationTypeProperty extends BaseSchemaProperty { 41 42 private String parentDisplayName; 43 44 45 public DerivationTypeProperty(SchemaComponent component, String property, 46 String propName, String propDesc, String parentDisplayName) 47 throws NoSuchMethodException { 48 super(component, Set .class, property, propName, propDesc, null); 49 this.parentDisplayName = parentDisplayName; 50 } 51 52 public PropertyEditor getPropertyEditor() { 53 return new DerivationTypeEditor(getComponent(), 54 super.getName(), 55 parentDisplayName); 56 } 57 58 public Object getValue() throws IllegalAccessException , 59 IllegalAccessException , InvocationTargetException { 60 try { 61 return super.getValue(); 62 } catch (InvocationTargetException ite) { 63 if(ite.getCause() instanceof IllegalArgumentException ) { 64 return NbBundle.getMessage(DerivationTypeProperty.class, 65 "LBL_Invalid_DerivationType_Value", 66 getComponent().getAnyAttribute( 67 new javax.xml.namespace.QName ("",getName()))); 68 } 69 throw ite; 70 } 71 } 72 } 73 | Popular Tags |