1 19 20 package org.netbeans.modules.extbrowser; 21 22 import java.awt.Image ; 23 import java.beans.*; 24 25 import org.openide.util.NbBundle; 26 import org.openide.util.Utilities; 27 28 public class ExtWebBrowserBeanInfo extends SimpleBeanInfo { 29 30 public BeanDescriptor getBeanDescriptor() { 31 return new BeanDescriptor(ExtWebBrowser.class); 32 } 33 34 public PropertyDescriptor[] getPropertyDescriptors() { 35 PropertyDescriptor[] properties; 36 if (Utilities.isWindows()) { 37 try { 38 properties = new PropertyDescriptor [] { 39 new PropertyDescriptor(ExtWebBrowser.PROP_BROWSER_EXECUTABLE, ExtWebBrowser.class), 40 new PropertyDescriptor(ExtWebBrowser.PROP_DDE_ACTIVATE_TIMEOUT, ExtWebBrowser.class), 42 new PropertyDescriptor(ExtWebBrowser.PROP_DDE_OPENURL_TIMEOUT, ExtWebBrowser.class) 43 }; 44 45 properties[0].setDisplayName (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "PROP_browserExecutable")); 46 properties[0].setShortDescription (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "HINT_browserExecutable")); 47 48 52 properties[1].setDisplayName (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "PROP_DDE_ACTIVATE_TIMEOUT")); 53 properties[1].setShortDescription (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "HINT_DDE_ACTIVATE_TIMEOUT")); 54 properties[1].setExpert(true); 55 properties[1].setHidden(true); 56 57 properties[2].setDisplayName (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "PROP_DDE_OPENURL_TIMEOUT")); 58 properties[2].setShortDescription (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "HINT_DDE_OPENURL_TIMEOUT")); 59 properties[2].setExpert(true); 60 properties[2].setHidden(true); 61 62 } catch (IntrospectionException ie) { 63 org.openide.ErrorManager.getDefault().notify(ie); 64 return null; 65 } 66 } else { 67 try { 68 properties = new PropertyDescriptor [] { 69 new PropertyDescriptor (ExtWebBrowser.PROP_BROWSER_EXECUTABLE, ExtWebBrowser.class), 70 }; 71 72 properties[0].setDisplayName (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "PROP_browserExecutable")); 73 properties[0].setShortDescription (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "HINT_browserExecutable")); 74 75 } catch (IntrospectionException ie) { 76 org.openide.ErrorManager.getDefault().notify(ie); 77 return null; 78 } 79 } 80 return properties; 81 } 82 83 86 public Image getIcon (int type) { 87 return loadImage("/org/netbeans/modules/extbrowser/resources/extbrowser.gif"); } 89 90 } 91 | Popular Tags |