KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > suggestions > settings > ManagerSettingsBeanInfo


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.tasklist.suggestions.settings;
21
22 import java.beans.*;
23 import java.util.ResourceBundle JavaDoc;
24 import java.awt.*;
25
26 import org.openide.util.NbBundle;
27 import org.openide.util.Utilities;
28
29 public class ManagerSettingsBeanInfo extends SimpleBeanInfo {
30
31     /**
32      * Gets the bean's <code>BeanDescriptor</code>s.
33      *
34      * @return BeanDescriptor describing the editable
35      * properties of this bean. May return null if the
36      * information should be obtained by automatic analysis.
37      */

38     public BeanDescriptor getBeanDescriptor() {
39         BeanDescriptor beanDescriptor = new BeanDescriptor ( ManagerSettings.class , null );
40         beanDescriptor.setExpert ( true );//GEN-HEADEREND:BeanDescriptor
41
beanDescriptor.setDisplayName(NbBundle.getBundle(ManagerSettings.class).getString("BK0007"));
42         beanDescriptor.setShortDescription(NbBundle.getBundle(ManagerSettings.class).getString("BK0008"));
43
44
45         return beanDescriptor;
46     }
47     
48     /**
49      * Gets the bean's <code>PropertyDescriptor</code>s.
50      *
51      * @return An array of PropertyDescriptors describing the editable
52      * properties supported by this bean. May return null if the
53      * information should be obtained by automatic analysis.
54      * <p>
55      * If a property is indexed, then its entry in the result array will
56      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
57      * A client of getPropertyDescriptors can use "instanceof" to check
58      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
59      */

60     public PropertyDescriptor[] getPropertyDescriptors() {
61         int PROPERTY_editScanDelay = 0;
62         int PROPERTY_node = 1;
63         int PROPERTY_saveScanDelay = 2;
64         int PROPERTY_scanOnEdit = 3;
65         int PROPERTY_scanOnSave = 4;
66         int PROPERTY_scanOnShow = 5;
67         int PROPERTY_showScanDelay = 6;
68         PropertyDescriptor[] properties = new PropertyDescriptor[7];
69
70         try {
71             properties[PROPERTY_editScanDelay] = new PropertyDescriptor ( "editScanDelay", ManagerSettings.class, "getEditScanDelay", "setEditScanDelay" );
72             properties[PROPERTY_editScanDelay].setExpert ( true );
73             properties[PROPERTY_node] = new PropertyDescriptor ( "node", ManagerSettings.class, "getNode", null );
74             properties[PROPERTY_node].setHidden ( true );
75             properties[PROPERTY_saveScanDelay] = new PropertyDescriptor ( "saveScanDelay", ManagerSettings.class, "getSaveScanDelay", "setSaveScanDelay" );
76             properties[PROPERTY_saveScanDelay].setExpert ( true );
77             properties[PROPERTY_scanOnEdit] = new PropertyDescriptor ( "scanOnEdit", ManagerSettings.class, "isScanOnEdit", null );
78             properties[PROPERTY_scanOnEdit].setHidden ( true );
79             properties[PROPERTY_scanOnSave] = new PropertyDescriptor ( "scanOnSave", ManagerSettings.class, "isScanOnSave", null );
80             properties[PROPERTY_scanOnSave].setHidden ( true );
81             properties[PROPERTY_scanOnShow] = new PropertyDescriptor ( "scanOnShow", ManagerSettings.class, "isScanOnShow", null );
82             properties[PROPERTY_scanOnShow].setHidden ( true );
83             properties[PROPERTY_showScanDelay] = new PropertyDescriptor ( "showScanDelay", ManagerSettings.class, "getShowScanDelay", "setShowScanDelay" );
84             properties[PROPERTY_showScanDelay].setExpert ( true );
85         }
86         catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
87

88         ResourceBundle JavaDoc bundle = NbBundle.getBundle(ManagerSettingsBeanInfo.class);
89
90         properties[PROPERTY_showScanDelay].setName(bundle.getString("BK0001"));
91         properties[PROPERTY_showScanDelay].setShortDescription(bundle.getString("BK0002"));
92         properties[PROPERTY_editScanDelay].setName(bundle.getString("BK0003"));
93         properties[PROPERTY_editScanDelay].setShortDescription(bundle.getString("BK0004"));
94         properties[PROPERTY_saveScanDelay].setName(bundle.getString("BK0005"));
95         properties[PROPERTY_saveScanDelay].setShortDescription(bundle.getString("BK0006"));
96
97         return properties;
98     }
99     
100     /**
101      * Gets the bean's <code>EventSetDescriptor</code>s.
102      *
103      * @return An array of EventSetDescriptors describing the kinds of
104      * events fired by this bean. May return null if the information
105      * should be obtained by automatic analysis.
106      */

107     public EventSetDescriptor[] getEventSetDescriptors() {
108         return new EventSetDescriptor[0];
109     }
110     
111     /**
112      * Gets the bean's <code>MethodDescriptor</code>s.
113      *
114      * @return An array of MethodDescriptors describing the methods
115      * implemented by this bean. May return null if the information
116      * should be obtained by automatic analysis.
117      */

118     public MethodDescriptor[] getMethodDescriptors() {
119         return new MethodDescriptor[0];
120     }
121     
122     public Image getIcon(int iconKind) {
123         return Utilities.loadImage("org/netbeans/modules/tasklist/suggestions/settings/setting.gif");
124     }
125 }
126
127
Popular Tags