1 19 20 package org.openide.src.beaninfo; 21 22 import java.awt.Image ; 23 import java.beans.*; 24 import org.openide.explorer.propertysheet.editors.IdentifierArrayEditor; 25 import org.openide.explorer.propertysheet.editors.MethodParameterArrayEditor; 26 27 import org.openide.src.*; 28 import org.openide.util.Utilities; 29 30 35 public class ConstructorElementBeanInfo extends MemberElementBeanInfo { 36 37 40 public Image getIcon(int type) { 41 return Utilities.loadImage("org/openide/src/resources/class.gif"); } 43 44 45 public PropertyDescriptor[] getPropertyDescriptors() { 46 PropertyDescriptor[] inh = super.getPropertyDescriptors(); 47 PropertyDescriptor[] desc = new PropertyDescriptor[inh.length + 3]; 48 System.arraycopy(inh, 0, desc, 0, inh.length); 49 try { 50 desc[inh.length] = new PropertyDescriptor(PROP_BODY, ConstructorElement.class, "getBody", "setBody"); desc[inh.length].setDisplayName(getString("PROP_METHOD_BODY")); 52 desc[inh.length + 1] = new PropertyDescriptor(PROP_PARAMETERS, ConstructorElement.class, "getParameters", "setParameters"); desc[inh.length + 1].setPropertyEditorClass(MethodParameterArrayEditor.class); 54 desc[inh.length + 1].setValue("mnemonic_List", getString("MNEMO_METHOD_PARAMETERS")); 55 desc[inh.length + 1].setValue("label_List", getString("LAB_METHOD_PARAMETERS")); 56 desc[inh.length + 1].setDisplayName(getString("PROP_METHOD_PARAMETERS")); 57 desc[inh.length + 2] = new PropertyDescriptor(PROP_EXCEPTIONS, ConstructorElement.class, "getExceptions", "setExceptions"); desc[inh.length + 2].setPropertyEditorClass(IdentifierArrayEditor.class); 59 desc[inh.length + 2].setDisplayName(getString("PROP_METHOD_EXCEPTIONS")); 60 desc[inh.length + 2].setValue("mnemonic_List", getString("MNEMO_METHOD_EXCEPTIONS")); 61 desc[inh.length + 2].setValue("label_List", getString("LAB_METHOD_EXCEPTIONS")); 62 return desc; 63 } catch (IntrospectionException ex) { 64 return inh; 65 } 66 } 67 } 68 | Popular Tags |