1 19 20 package org.netbeans.modules.java.settings; 21 22 import java.awt.Image ; 23 import java.awt.Toolkit ; 24 import java.beans.SimpleBeanInfo ; 25 import java.beans.PropertyDescriptor ; 26 import java.beans.IntrospectionException ; 27 import java.beans.BeanDescriptor ; 28 29 import org.openide.ErrorManager; 30 34 public class JavaSettingsBeanInfo extends SimpleBeanInfo { 35 36 public BeanDescriptor getBeanDescriptor() { 37 BeanDescriptor desc = new BeanDescriptor (JavaSettings.class); 38 desc.setDisplayName(JavaSettings.getString("CTL_Java_option")); 39 40 return desc; 41 } 42 43 44 47 public PropertyDescriptor [] getPropertyDescriptors () { 48 try { 49 PropertyDescriptor [] desc = new PropertyDescriptor [] { 50 new PropertyDescriptor (JavaSettings.PROP_REPLACEABLE_STRINGS_TABLE, JavaSettings.class), 51 new PropertyDescriptor (JavaSettings.PROP_AUTO_PARSING_DELAY, JavaSettings.class), 52 new PropertyDescriptor (JavaSettings.PROP_PARSING_ERRORS, JavaSettings.class), 53 new PropertyDescriptor (JavaSettings.PROP_SHOW_COMPILE_STATUS, JavaSettings.class, "isCompileStatusEnabled", "enableCompileStatus"), new PropertyDescriptor (JavaSettings.PROP_DEFAULT_ENCODING, JavaSettings.class), 55 new PropertyDescriptor (JavaSettings.PROP_SHOW_OVERRIDING, JavaSettings.class) 56 }; 57 58 int index = 0; 59 60 desc[index].setDisplayName (JavaSettings.getString("PROP_REPLACEABLE_STRINGS")); 61 desc[index].setShortDescription (JavaSettings.getString("HINT_REPLACEABLE_STRINGS")); 62 index++; 63 desc[index].setDisplayName (JavaSettings.getString("PROP_AUTO_PARSING_DELAY")); 64 desc[index].setShortDescription (JavaSettings.getString("HINT_AUTO_PARSING_DELAY")); 65 index++; 66 desc[index].setDisplayName (JavaSettings.getString("PROP_PARSING_ERRORS")); 67 desc[index].setShortDescription (JavaSettings.getString("HINT_PARSING_ERRORS")); 68 index++; 69 desc[index].setDisplayName(JavaSettings.getString("PROP_SHOW_COMPILE_STATUS")); 70 desc[index].setShortDescription(JavaSettings.getString("HINT_SHOW_COMPILE_STATUS")); 71 index++; 72 desc[index].setExpert(true); 73 desc[index].setDisplayName(JavaSettings.getString("PROP_DEFAULT_ENCODING")); 74 desc[index].setShortDescription(JavaSettings.getString("HINT_DEFAULT_ENCODING")); 75 index++; 76 desc[index].setDisplayName(JavaSettings.getString("PROP_SHOW_OVERRIDING")); 77 desc[index].setShortDescription(JavaSettings.getString("HINT_SHOW_OVERRIDING")); 78 return desc; 79 } catch (IntrospectionException ex) { 80 ErrorManager.getDefault().notify(ex); 81 return null; 82 } 83 } 84 85 89 public Image getIcon(int type) { 90 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 91 return org.openide.util.Utilities.loadImage("org/netbeans/modules/java/resources/class.gif"); } else { return org.openide.util.Utilities.loadImage("org/netbeans/modules/java/resources/class32.gif"); } 95 } 96 } 97 | Popular Tags |