KickJava   Java API By Example, From Geeks To Geeks.

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


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 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_BROWSER_START_TIMEOUT, ExtWebBrowser.class),
41
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 // properties[1].setDisplayName (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "PROP_BROWSER_START_TIMEOUT"));
49
// properties[1].setShortDescription (NbBundle.getMessage (ExtWebBrowserBeanInfo.class, "HINT_BROWSER_START_TIMEOUT"));
50
// properties[1].setExpert(true);
51

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     /**
84     * Returns the icon.
85     */

86     public Image JavaDoc getIcon (int type) {
87         return loadImage("/org/netbeans/modules/extbrowser/resources/extbrowser.gif"); // NOI18N
88
}
89     
90 }
91
Popular Tags