1 19 20 21 package org.netbeans.modules.properties; 22 23 24 import java.awt.Image ; 25 import java.beans.BeanInfo ; 26 import java.beans.IntrospectionException ; 27 import java.beans.Introspector ; 28 import java.beans.PropertyDescriptor ; 29 import java.beans.SimpleBeanInfo ; 30 import org.openide.ErrorManager; 31 32 import org.openide.loaders.MultiFileLoader; 33 import org.openide.util.NbBundle; 34 import org.openide.util.Utilities; 35 36 37 41 public final class PropertiesDataLoaderBeanInfo extends SimpleBeanInfo { 42 43 public BeanInfo [] getAdditionalBeanInfo () { 44 try { 45 return new BeanInfo [] { Introspector.getBeanInfo (MultiFileLoader.class) }; 46 } catch (IntrospectionException ie) { 47 ErrorManager.getDefault().notify(ie); 48 return null; 49 } 50 } 51 52 55 public PropertyDescriptor [] getPropertyDescriptors () { 56 try { 57 58 PropertyDescriptor p2 = new PropertyDescriptor ( 59 "extensions", PropertiesDataLoader.class, 61 "getExtensions", "setExtensions"); 64 p2.setDisplayName(NbBundle.getBundle(PropertiesDataLoaderBeanInfo.class).getString("PROP_Ext")); 65 p2.setShortDescription(NbBundle.getBundle(PropertiesDataLoaderBeanInfo.class).getString("HINT_Ext")); 66 67 return new PropertyDescriptor [] {p2}; 68 } catch(IntrospectionException ie) { 69 ErrorManager.getDefault().notify(ie); 70 71 return null; 72 } 73 } 74 75 77 public Image getIcon(final int type) { 78 if((type == BeanInfo.ICON_COLOR_16x16) || (type == BeanInfo.ICON_MONO_16x16)) { 79 return Utilities.loadImage("org/netbeans/modules/properties/propertiesObject.png"); } else { 81 return Utilities.loadImage("org/netbeans/modules/properties/propertiesObject32.gif"); } 83 } 84 } 85 | Popular Tags |