1 13 14 15 package org.netbeans.modules.tasklist.checkstyle.options; 16 17 import java.awt.Image ; 18 import java.beans.BeanDescriptor ; 19 import java.beans.IntrospectionException ; 20 import java.beans.PropertyDescriptor ; 21 import java.beans.SimpleBeanInfo ; 22 import org.openide.ErrorManager; 23 24 import org.openide.util.NbBundle; 25 import org.openide.util.Utilities; 26 27 32 public class CheckstyleSettingsBeanInfo extends SimpleBeanInfo { 33 34 public BeanDescriptor getBeanDescriptor() { 35 BeanDescriptor bdesc = new BeanDescriptor (CheckstyleSettings.class); 36 bdesc.setDisplayName(NbBundle.getMessage(CheckstyleSettingsBeanInfo.class, 37 "OPTION_CHECKSTYLE_SETTINGS_NAME")); bdesc.setShortDescription(NbBundle.getMessage(CheckstyleSettingsBeanInfo.class, 39 "HINT_CHECKSTYLE_SETTINGS_NAME")); return bdesc; 41 } 42 43 48 public PropertyDescriptor [] getPropertyDescriptors() { 49 50 int i = 0; 51 PropertyDescriptor [] desc = null; 52 try { 53 desc = new PropertyDescriptor []{ 54 new PropertyDescriptor (CheckstyleSettings.PROP_SCAN_CHECKSTYLE, 55 CheckstyleSettings.class) 56 }; 57 58 desc[i].setDisplayName(NbBundle.getMessage( 59 CheckstyleSettingsBeanInfo.class, 60 "PROP_SCAN_CHECKSTYLE")); desc[i++].setShortDescription(NbBundle.getMessage( 62 CheckstyleSettingsBeanInfo.class, 63 "HINT_SCAN_CHECKSTYLE")); } catch (IntrospectionException ex) { 65 66 ErrorManager.getDefault().notify(ex); 67 throw new InternalError (); 68 } 69 return desc; 70 } 71 72 73 public Image getIcon(int type) { 74 return Utilities.loadImage("org/netbeans/modules/tasklist/checkstyle/checkstyle.gif"); } 76 } 77 | Popular Tags |