1 package org.netbeans.modules.settings.examples; 2 3 import java.beans.*; 4 5 public class JavaCompilerSettingBeanInfo extends SimpleBeanInfo { 6 7 ; 9 private static BeanDescriptor getBdescriptor(){ 10 BeanDescriptor beanDescriptor = new BeanDescriptor ( JavaCompilerSetting.class , null ); 11 beanDescriptor.setDisplayName ( "External Compiler" ); 13 15 return beanDescriptor; } 17 18 private static final int PROPERTY_classpath = 0; 20 private static final int PROPERTY_path = 1; 21 private static final int PROPERTY_deprecation = 2; 22 private static final int PROPERTY_debug = 3; 23 24 ; 26 private static PropertyDescriptor[] getPdescriptor(){ 27 PropertyDescriptor[] properties = new PropertyDescriptor[4]; 28 29 try { 30 properties[PROPERTY_classpath] = new PropertyDescriptor ( "classpath", JavaCompilerSetting.class, "getClasspath", "setClasspath" ); 31 properties[PROPERTY_classpath].setDisplayName ( "Class Path" ); 32 properties[PROPERTY_path] = new PropertyDescriptor ( "path", JavaCompilerSetting.class, "getPath", "setPath" ); 33 properties[PROPERTY_path].setDisplayName ( "Path to javac" ); 34 properties[PROPERTY_deprecation] = new PropertyDescriptor ( "deprecation", JavaCompilerSetting.class, "isDeprecation", "setDeprecation" ); 35 properties[PROPERTY_deprecation].setDisplayName ( "Deprecation" ); 36 properties[PROPERTY_debug] = new PropertyDescriptor ( "debug", JavaCompilerSetting.class, "isDebug", "setDebug" ); 37 properties[PROPERTY_debug].setDisplayName ( "Debug" ); 38 } 39 catch( IntrospectionException e) {} 41 43 return properties; } 45 private static final int EVENT_propertyChangeListener = 0; 47 48 ; 50 private static EventSetDescriptor[] getEdescriptor(){ 51 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 52 53 try { 54 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.settings.examples.JavaCompilerSetting.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); 55 } 56 catch( IntrospectionException e) {} 58 60 return eventSets; } 62 64 ; 66 private static MethodDescriptor[] getMdescriptor(){ 67 MethodDescriptor[] methods = new MethodDescriptor[0]; 69 71 return methods; } 73 74 private static final int defaultPropertyIndex = -1; private static final int defaultEventIndex = -1; 77 78 80 82 84 91 public BeanDescriptor getBeanDescriptor() { 92 return getBdescriptor(); 93 } 94 95 107 public PropertyDescriptor[] getPropertyDescriptors() { 108 return getPdescriptor(); 109 } 110 111 118 public EventSetDescriptor[] getEventSetDescriptors() { 119 return getEdescriptor(); 120 } 121 122 129 public MethodDescriptor[] getMethodDescriptors() { 130 return getMdescriptor(); 131 } 132 133 141 public int getDefaultPropertyIndex() { 142 return defaultPropertyIndex; 143 } 144 145 152 public int getDefaultEventIndex() { 153 return defaultEventIndex; 154 } 155 } 156 157 | Popular Tags |