1 19 20 package org.openide.src.nodes; 21 22 import java.beans.*; 23 import java.awt.Image ; 24 import java.util.ResourceBundle ; 25 26 import org.openide.util.NbBundle; 27 import org.openide.util.Utilities; 28 import org.openide.ErrorManager; 29 30 34 public final class SourceOptionsBeanInfo extends SimpleBeanInfo { 35 36 37 public BeanDescriptor getBeanDescriptor() { 38 ResourceBundle bundle = NbBundle.getBundle(SourceOptionsBeanInfo.class); 39 BeanDescriptor desc = new BeanDescriptor(SourceOptions.class); 40 desc.setDisplayName(bundle.getString("MSG_sourceOptions")); 41 42 return desc; 43 } 44 45 49 public PropertyDescriptor[] getPropertyDescriptors () { 50 try { 51 ResourceBundle bundle = NbBundle.getBundle(SourceOptionsBeanInfo.class); 52 PropertyDescriptor[] descriptors = new PropertyDescriptor[6]; 53 for (int i = 0; i < 6; i++) { 54 descriptors[i] = new PropertyDescriptor(SourceOptions.PROP_NAMES[i], SourceOptions.class); 55 descriptors[i].setDisplayName(bundle.getString("PROP_"+SourceOptions.PROP_NAMES[i])); 56 descriptors[i].setShortDescription(bundle.getString("HINT_"+SourceOptions.PROP_NAMES[i])); 57 } 58 return descriptors; 62 } catch (IntrospectionException e) { 63 ErrorManager.getDefault().notify(e); 64 return null; 65 } 66 } 67 68 71 public Image getIcon(final int type) { 72 if ((type == BeanInfo.ICON_COLOR_16x16) || (type == BeanInfo.ICON_MONO_16x16)) { 73 return Utilities.loadImage("org/openide/src/resources/sourceOptions.gif"); } 75 else { 76 return Utilities.loadImage("org/openide/src/resources/sourceOptions32.gif"); } 78 } 79 } 80 | Popular Tags |