1 24 25 26 package org.netbeans.modules.javadoc.httpfs; 27 28 import java.beans.*; 29 import java.awt.Image ; 30 31 import org.openide.util.NbBundle; 32 import org.openide.filesystems.FileSystem; 33 import org.openide.util.Utilities; 34 35 36 41 public class HTTPFileSystemBeanInfo extends SimpleBeanInfo { 42 43 private PropertyDescriptor[] propertyDescriptors = null; 45 46 51 public PropertyDescriptor[] getPropertyDescriptors() { 52 53 if( propertyDescriptors == null ){ 54 try { 55 56 propertyDescriptors = new PropertyDescriptor[ 3 ]; 57 58 propertyDescriptors[ 0 ] = new PropertyDescriptor( HTTPFileSystem.PROP_URL, HTTPFileSystem.class, "getURL", "setURL" ); propertyDescriptors[ 0 ].setDisplayName( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "PROP_URLPropertyName" ) ); propertyDescriptors[ 0 ].setShortDescription( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "HINT_URLPropertyName" ) ); propertyDescriptors[ 0 ].setBound( true ); 63 propertyDescriptors[ 0 ].setConstrained( true ); 64 propertyDescriptors[ 0 ].setPreferred( true ); 65 66 propertyDescriptors[ 1 ] = new PropertyDescriptor( HTTPFileSystem.PROP_REFRESH_RATE, HTTPFileSystem.class, "getRefreshRate", "setRefreshRate" ); propertyDescriptors[ 1 ].setDisplayName( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "PROP_RefreshRatePropertyName" ) ); propertyDescriptors[ 1 ].setShortDescription( NbBundle.getMessage(HTTPFileSystemBeanInfo.class, "HINT_RefreshRatePropertyName" ) ); propertyDescriptors[ 1 ].setBound( true ); 71 propertyDescriptors[ 1 ].setConstrained( true ); 72 propertyDescriptors[ 1 ].setExpert( true ); 73 74 propertyDescriptors[ 2 ] = new PropertyDescriptor( HTTPFileSystem.PROP_STATE, HTTPFileSystem.class, "getState", null ); propertyDescriptors[ 2 ].setBound( true ); 77 propertyDescriptors[ 2 ].setConstrained( false ); 78 propertyDescriptors[ 2 ].setHidden( true ); 79 80 } 81 catch( IntrospectionException e ) { 82 org.openide.ErrorManager.getDefault().notify(e); 83 } 84 } 85 return propertyDescriptors; 86 } 87 88 93 public BeanInfo[] getAdditionalBeanInfo () { 94 try { 95 return new BeanInfo[] { Introspector.getBeanInfo (FileSystem.class) }; 96 } catch (IntrospectionException ie) { 97 org.openide.ErrorManager.getDefault().notify(ie); 98 return null; 99 } 100 } 101 102 103 107 public Image getIcon (int kind) { 108 return Utilities.loadImage( "org/netbeans/modules/javadoc/httpfs/resources/BeanIcon16C.gif" ); } 110 111 } 112 | Popular Tags |