1 19 20 package org.netbeans.modules.tasklist.suggestions.settings; 21 22 import java.beans.*; 23 import java.util.ResourceBundle ; 24 import java.awt.*; 25 26 import org.openide.util.NbBundle; 27 import org.openide.util.Utilities; 28 29 public class ManagerSettingsBeanInfo extends SimpleBeanInfo { 30 31 38 public BeanDescriptor getBeanDescriptor() { 39 BeanDescriptor beanDescriptor = new BeanDescriptor ( ManagerSettings.class , null ); 40 beanDescriptor.setExpert ( true ); beanDescriptor.setDisplayName(NbBundle.getBundle(ManagerSettings.class).getString("BK0007")); 42 beanDescriptor.setShortDescription(NbBundle.getBundle(ManagerSettings.class).getString("BK0008")); 43 44 45 return beanDescriptor; 46 } 47 48 60 public PropertyDescriptor[] getPropertyDescriptors() { 61 int PROPERTY_editScanDelay = 0; 62 int PROPERTY_node = 1; 63 int PROPERTY_saveScanDelay = 2; 64 int PROPERTY_scanOnEdit = 3; 65 int PROPERTY_scanOnSave = 4; 66 int PROPERTY_scanOnShow = 5; 67 int PROPERTY_showScanDelay = 6; 68 PropertyDescriptor[] properties = new PropertyDescriptor[7]; 69 70 try { 71 properties[PROPERTY_editScanDelay] = new PropertyDescriptor ( "editScanDelay", ManagerSettings.class, "getEditScanDelay", "setEditScanDelay" ); 72 properties[PROPERTY_editScanDelay].setExpert ( true ); 73 properties[PROPERTY_node] = new PropertyDescriptor ( "node", ManagerSettings.class, "getNode", null ); 74 properties[PROPERTY_node].setHidden ( true ); 75 properties[PROPERTY_saveScanDelay] = new PropertyDescriptor ( "saveScanDelay", ManagerSettings.class, "getSaveScanDelay", "setSaveScanDelay" ); 76 properties[PROPERTY_saveScanDelay].setExpert ( true ); 77 properties[PROPERTY_scanOnEdit] = new PropertyDescriptor ( "scanOnEdit", ManagerSettings.class, "isScanOnEdit", null ); 78 properties[PROPERTY_scanOnEdit].setHidden ( true ); 79 properties[PROPERTY_scanOnSave] = new PropertyDescriptor ( "scanOnSave", ManagerSettings.class, "isScanOnSave", null ); 80 properties[PROPERTY_scanOnSave].setHidden ( true ); 81 properties[PROPERTY_scanOnShow] = new PropertyDescriptor ( "scanOnShow", ManagerSettings.class, "isScanOnShow", null ); 82 properties[PROPERTY_scanOnShow].setHidden ( true ); 83 properties[PROPERTY_showScanDelay] = new PropertyDescriptor ( "showScanDelay", ManagerSettings.class, "getShowScanDelay", "setShowScanDelay" ); 84 properties[PROPERTY_showScanDelay].setExpert ( true ); 85 } 86 catch( IntrospectionException e) {} 88 ResourceBundle bundle = NbBundle.getBundle(ManagerSettingsBeanInfo.class); 89 90 properties[PROPERTY_showScanDelay].setName(bundle.getString("BK0001")); 91 properties[PROPERTY_showScanDelay].setShortDescription(bundle.getString("BK0002")); 92 properties[PROPERTY_editScanDelay].setName(bundle.getString("BK0003")); 93 properties[PROPERTY_editScanDelay].setShortDescription(bundle.getString("BK0004")); 94 properties[PROPERTY_saveScanDelay].setName(bundle.getString("BK0005")); 95 properties[PROPERTY_saveScanDelay].setShortDescription(bundle.getString("BK0006")); 96 97 return properties; 98 } 99 100 107 public EventSetDescriptor[] getEventSetDescriptors() { 108 return new EventSetDescriptor[0]; 109 } 110 111 118 public MethodDescriptor[] getMethodDescriptors() { 119 return new MethodDescriptor[0]; 120 } 121 122 public Image getIcon(int iconKind) { 123 return Utilities.loadImage("org/netbeans/modules/tasklist/suggestions/settings/setting.gif"); 124 } 125 } 126 127 | Popular Tags |