KickJava   Java API By Example, From Geeks To Geeks.

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


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 SimpleExtBrowserBeanInfo extends SimpleBeanInfo {
28
29     public BeanDescriptor getBeanDescriptor () {
30         BeanDescriptor descr = new BeanDescriptor (SimpleExtBrowser.class);
31         descr.setDisplayName (NbBundle.getMessage (SimpleExtBrowserBeanInfo.class, "CTL_SimpleExtBrowser"));
32         descr.setShortDescription (NbBundle.getMessage (SimpleExtBrowserBeanInfo.class, "HINT_SimpleExtBrowser"));
33         descr.setValue ("helpID", "org.netbeans.modules.extbrowser.SimpleExtBrowser"); // NOI18N
34
return descr;
35     }
36
37     /**
38      * Gets the bean's <code>PropertyDescriptor</code>s.
39      *
40      * @return An array of PropertyDescriptors describing the editable
41      * properties supported by this bean. May return null if the
42      * information should be obtained by automatic analysis.
43      * <p>
44      * If a property is indexed, then its entry in the result array will
45      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
46      * A client of getPropertyDescriptors can use "instanceof" to check
47      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
48      */

49     public PropertyDescriptor[] getPropertyDescriptors() {
50         PropertyDescriptor[] properties;
51         try {
52             properties = new PropertyDescriptor [] {
53                 new PropertyDescriptor (SimpleExtBrowser.PROP_BROWSER_EXECUTABLE, SimpleExtBrowser.class) // NOI18N
54
};
55             properties[0].setDisplayName (NbBundle.getMessage (SimpleExtBrowserBeanInfo.class, "PROP_browserExecutable"));
56             properties[0].setShortDescription (NbBundle.getMessage (SimpleExtBrowserBeanInfo.class, "HINT_browserExecutable"));
57         } catch (IntrospectionException ie) {
58             org.openide.ErrorManager.getDefault().notify(ie);
59             return null;
60         }
61         return properties;
62     }
63
64     /**
65     * Returns the icon.
66     */

67     public Image JavaDoc getIcon (int type) {
68         return loadImage("/org/netbeans/modules/extbrowser/resources/extbrowser.gif"); // NOI18N
69
}
70 }
71
72
Popular Tags