1 19 20 package org.netbeans.modules.httpserver; 21 22 import java.awt.Image ; 23 import java.beans.*; 24 import java.util.ResourceBundle ; 25 26 import org.openide.ErrorManager; 27 import org.openide.util.NbBundle; 28 import org.openide.util.Utilities; 29 30 34 public class HttpServerSettingsBeanInfo extends SimpleBeanInfo { 35 36 37 public Image getIcon(int type) { 38 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 39 return Utilities.loadImage("org/netbeans/modules/httpserver/httpServerSettings.gif"); } else { 41 return Utilities.loadImage ("org/netbeans/modules/httpserver/httpServerSettings32.gif"); } 43 } 44 45 48 public PropertyDescriptor[] getPropertyDescriptors () { 49 try { 50 PropertyDescriptor[] desc = new PropertyDescriptor[] { 51 new PropertyDescriptor("port", HttpServerSettings.class), new PropertyDescriptor("running", HttpServerSettings.class, "isRunning", null), new PropertyDescriptor("hostProperty", HttpServerSettings.class), new PropertyDescriptor("showGrantAccess", HttpServerSettings.class, "isShowGrantAccessDialog", "setShowGrantAccessDialog") }; 56 ResourceBundle bundle = NbBundle.getBundle(HttpServerSettingsBeanInfo.class); 57 desc[0].setDisplayName(bundle.getString("PROP_Port")); 58 desc[0].setShortDescription(bundle.getString("HINT_Port")); 59 desc[1].setDisplayName(bundle.getString("PROP_Running")); 60 desc[1].setShortDescription(bundle.getString("HINT_Running")); 61 desc[2].setDisplayName(bundle.getString("PROP_HostProperty")); 62 desc[2].setShortDescription(bundle.getString("HINT_HostProperty")); 63 desc[2].setPropertyEditorClass (HostPropertyEditor.class); 64 desc[3].setDisplayName(bundle.getString("PROP_showGrantAccess")); 65 desc[3].setShortDescription(bundle.getString("HINT_showGrantAccess")); 66 return desc; 67 } catch (IntrospectionException ex) { 68 ErrorManager.getDefault().notify(ex); 69 return null; 70 } 71 } 72 73 public BeanDescriptor getBeanDescriptor(){ 74 BeanDescriptor bd = new BeanDescriptor(HttpServerSettings.class); 75 bd.setDisplayName(NbBundle.getMessage(HttpServerSettingsBeanInfo.class, "LBL_HTTPServerSettings")); 76 bd.setShortDescription(NbBundle.getMessage(HttpServerSettingsBeanInfo.class, "CTL_HTTP_sett_HINT")); 77 return bd; 78 } 79 80 81 } 82 | Popular Tags |