1 19 20 package org.apache.tools.ant.module.loader; 21 22 import java.awt.Image ; 23 import java.beans.BeanInfo ; 24 import java.beans.IntrospectionException ; 25 import java.beans.Introspector ; 26 import java.beans.PropertyDescriptor ; 27 import java.beans.SimpleBeanInfo ; 28 import org.apache.tools.ant.module.AntModule; 29 import org.openide.loaders.DataLoader; 30 import org.openide.util.NbBundle; 31 32 public class AntProjectDataLoaderBeanInfo extends SimpleBeanInfo { 33 34 @Override  35 public BeanInfo [] getAdditionalBeanInfo () { 36 try { 37 return new BeanInfo [] { Introspector.getBeanInfo (DataLoader.class) }; 38 } catch (IntrospectionException ie) { 39 AntModule.err.notify(ie); 40 return null; 41 } 42 } 43 44 @Override  45 public PropertyDescriptor [] getPropertyDescriptors() { 46 try { 54 PropertyDescriptor extensions = new PropertyDescriptor ("extensions", AntProjectDataLoader.class, "getExtensions", null); extensions.setDisplayName(NbBundle.getMessage(AntProjectDataLoaderBeanInfo.class, "PROP_extensions")); 56 extensions.setShortDescription(NbBundle.getMessage(AntProjectDataLoaderBeanInfo.class, "HINT_extensions")); 57 extensions.setExpert(true); 58 return new PropertyDescriptor [] {extensions}; 59 } catch (IntrospectionException ie) { 60 AntModule.err.notify(ie); 61 return null; 62 } 63 } 64 65 @Override  66 public Image getIcon (int type) { 67 if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { 68 return org.openide.util.Utilities.loadImage ("org/apache/tools/ant/module/resources/AntIcon.gif"); 69 } else { 70 return null; 71 } 72 } 73 74 } 75 | Popular Tags |