1 19 20 package org.netbeans.modules.autoupdate; 21 22 import java.awt.Image ; 23 import java.beans.*; 24 import org.openide.util.Exceptions; 25 26 import org.openide.util.NbBundle; 27 28 32 class AutoupdateTypeBeanInfo extends SimpleBeanInfo { 33 34 37 public AutoupdateTypeBeanInfo() { 38 } 39 40 41 public Image getIcon(int type) { 42 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 43 return org.openide.util.Utilities.loadImage("org/netbeans/modules/autoupdate/resources/updateAction.gif"); } else { 45 return org.openide.util.Utilities.loadImage("org/netbeans/modules/autoupdate/resources/updateAction32.gif"); } 47 } 48 49 public BeanInfo[] getAdditionalBeanInfo () { 50 try { 51 return new BeanInfo[] { Introspector.getBeanInfo (org.openide.ServiceType.class) }; 52 } catch (IntrospectionException ie) { 53 Exceptions.printStackTrace(ie); 54 return null; 55 } 56 } 57 58 public BeanDescriptor getBeanDescriptor () { 59 BeanDescriptor bdesc = new BeanDescriptor (AutoupdateType.class); 60 61 bdesc.setDisplayName (getBundle("CTL_AutoupdateType_Name")); 62 bdesc.setValue ("version", "1.1"); return bdesc; 64 } 65 66 69 public PropertyDescriptor[] getPropertyDescriptors () { 70 PropertyDescriptor[] desc = null; 71 72 try { 73 desc = new PropertyDescriptor[] { 74 new PropertyDescriptor("enabled", AutoupdateType.class), 75 new PropertyDescriptor("lastTimeStamp", AutoupdateType.class) 76 }; 77 78 desc[0].setDisplayName(getBundle("PROP_Enabled")); 79 desc[0].setShortDescription(getBundle("HINT_Enabled")); 80 81 desc[1].setDisplayName(getBundle("PROP_LastTimeStamp")); 82 desc[1].setShortDescription(getBundle("HINT_LastTimeStamp")); 83 desc[1].setPropertyEditorClass(Settings.LastCheckPropertyEditor.class); 84 desc[1].setValue("canEditAsText",Boolean.FALSE); 86 87 } catch (IntrospectionException ex) { 88 ex.printStackTrace (); 90 } 91 return desc; 92 } 93 94 private String getBundle( String key ) { 95 return NbBundle.getMessage( AutoupdateTypeBeanInfo.class, key ); 96 } 97 } 98 | Popular Tags |