1 19 20 21 package org.openidex.search; 22 23 24 import java.awt.Image ; 25 import java.beans.*; 26 27 import org.openide.ErrorManager; 28 29 33 public class SearchTypeBeanInfo extends SimpleBeanInfo { 34 35 47 public PropertyDescriptor[] getPropertyDescriptors() { 48 try { 49 PropertyDescriptor[] properties = new PropertyDescriptor[2]; 50 properties[0] = new PropertyDescriptor ( "name", SearchType.class, "getName", "setName" ); properties[0].setHidden ( true ); 52 properties[1] = new PropertyDescriptor ( "helpCtx", SearchType.class, "getHelpCtx", null ); properties[1].setHidden ( true ); 54 return properties; 55 } catch( IntrospectionException e) { 56 ErrorManager.getDefault().notify(e); 57 return null; 58 } 59 } 60 61 68 public EventSetDescriptor[] getEventSetDescriptors() { 69 try { 70 return new EventSetDescriptor[] { 71 new EventSetDescriptor ( SearchType.class, "propertyChangeListener", PropertyChangeListener.class, new String [0], "addPropertyChangeListener", "removePropertyChangeListener" ) }; 73 } catch( IntrospectionException e) { 74 ErrorManager.getDefault().notify(e); 75 return null; 76 } 77 } 78 79 80 101 102 public Image getIcon(int iconKind) { 103 if (iconKind == ICON_COLOR_16x16) 104 return loadImage( "org/openidex/search/res/find.gif" ); 106 return null; 107 } 108 109 public BeanDescriptor getBeanDescriptor(){ 110 BeanDescriptor descr = new BeanDescriptor(SearchType.class); 111 descr.setDisplayName(org.openide.util.NbBundle.getBundle(SearchTypeBeanInfo.class).getString("CTL_SearchTypes")); 112 return descr; 113 } 114 115 public BeanInfo[] getAdditionalBeanInfo () { 116 try { 117 return new BeanInfo[] { Introspector.getBeanInfo (org.openide.ServiceType.class) }; 118 } catch (IntrospectionException ie) { 119 ErrorManager.getDefault().notify(ie); 120 return null; 121 } 122 } 123 124 125 } 126 | Popular Tags |