KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > extbrowser > SystemDefaultBrowserBeanInfo


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.extbrowser;
21
22 import java.awt.Image JavaDoc;
23 import java.beans.*;
24
25 import org.openide.util.NbBundle;
26
27 public class SystemDefaultBrowserBeanInfo extends SimpleBeanInfo {
28
29     public BeanDescriptor getBeanDescriptor() {
30         BeanDescriptor descr = new BeanDescriptor (SystemDefaultBrowser.class);
31         descr.setDisplayName (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "CTL_SystemDefaultBrowserName"));
32         descr.setShortDescription (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "HINT_SystemDefaultBrowserName"));
33
34         descr.setValue ("helpID", "org.netbeans.modules.extbrowser.ExtWebBrowser"); // NOI18N //TODO
35
return descr;
36     }
37
38     public PropertyDescriptor[] getPropertyDescriptors() {
39         PropertyDescriptor[] properties;
40         
41         try {
42             properties = new PropertyDescriptor [] {
43                                 new PropertyDescriptor(ExtWebBrowser.PROP_BROWSER_EXECUTABLE, SystemDefaultBrowser.class, "getBrowserExecutable", null), // NOI18N
44
// new PropertyDescriptor(ExtWebBrowser.PROP_BROWSER_START_TIMEOUT, SystemDefaultBrowser.class),
45
new PropertyDescriptor(ExtWebBrowser.PROP_DDE_ACTIVATE_TIMEOUT, SystemDefaultBrowser.class),
46                                 new PropertyDescriptor(ExtWebBrowser.PROP_DDE_OPENURL_TIMEOUT, SystemDefaultBrowser.class)
47                              };
48
49             properties[0].setDisplayName (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "PROP_browserExecutable"));
50             properties[0].setShortDescription (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "HINT_browserExecutable"));
51
52 // properties[1].setDisplayName (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "PROP_BROWSER_START_TIMEOUT"));
53
// properties[1].setShortDescription (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "HINT_BROWSER_START_TIMEOUT"));
54
// properties[1].setExpert(Boolean.TRUE.booleanValue());
55

56             properties[1].setDisplayName (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "PROP_DDE_ACTIVATE_TIMEOUT"));
57             properties[1].setShortDescription (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "HINT_DDE_ACTIVATE_TIMEOUT"));
58             properties[1].setExpert(Boolean.TRUE.booleanValue());
59             properties[1].setHidden(true);
60
61             properties[2].setDisplayName (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "PROP_DDE_OPENURL_TIMEOUT"));
62             properties[2].setShortDescription (NbBundle.getMessage (SystemDefaultBrowserBeanInfo.class, "HINT_DDE_OPENURL_TIMEOUT"));
63             properties[2].setExpert(Boolean.TRUE.booleanValue());
64             properties[2].setHidden(true);
65
66         } catch (IntrospectionException ie) {
67             org.openide.ErrorManager.getDefault().notify(ie);
68             return null;
69         }
70         
71         return properties;
72     }
73
74     /**
75     * Returns the icon.
76     */

77     public Image JavaDoc getIcon (int type) {
78         return loadImage("/org/netbeans/modules/extbrowser/resources/extbrowser.png"); // NOI18N
79
}
80     
81 }
82
Popular Tags