KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > changelog > settings > ChangeLogSettingsBeanInfo


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 Ralph Krueger.
17  */

18
19 package org.netbeans.modules.changelog.settings;
20
21 import java.awt.Image JavaDoc;
22 import java.beans.*;
23
24 import org.openide.util.NbBundle;
25
26 /** BeanInfo for ChangeLogSettings
27 *
28 * @author Ralph Krueger
29 */

30 public class ChangeLogSettingsBeanInfo extends SimpleBeanInfo {
31
32
33     /** @return the icon */
34     public Image JavaDoc getIcon(int type) {
35         if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) {
36             return org.openide.util.Utilities.loadImage("org/netbeans/modules/changelog/resources/setting.gif"); //NOI18N;
37
} else {
38             return null;
39         }
40
41     }
42
43     /** Descriptor of valid properties
44     * @return array of properties
45     */

46     public PropertyDescriptor[] getPropertyDescriptors () {
47         try {
48
49             java.util.ResourceBundle JavaDoc bundle =
50                 NbBundle.getBundle(ChangeLogSettingsBeanInfo.class);
51
52             
53             PropertyDescriptor defaultServer = new PropertyDescriptor ("defaultServerInfo", ChangeLogSettings.class); // NOI18N
54
defaultServer.setDisplayName (bundle.getString("PROP_defaultServerInfo")); // NOI18N
55
defaultServer.setShortDescription (bundle.getString("HINT_defaultServerInfo")); // NOI18N
56
defaultServer.setPropertyEditorClass(DefaultServerInfoPE.class);
57
58             PropertyDescriptor showBranchesByDefault = new PropertyDescriptor ("showBranchesByDefault", ChangeLogSettings.class); // NOI18N
59
showBranchesByDefault.setDisplayName (bundle.getString("PROP_showBranchesByDefault")); // NOI18N
60
showBranchesByDefault.setShortDescription (bundle.getString("HINT_showBranchesByDefault")); // NOI18N
61

62             return new PropertyDescriptor[] { defaultServer, showBranchesByDefault };
63             
64         } catch (IntrospectionException ie) {
65             org.openide.ErrorManager.getDefault().notify();
66             return null;
67         }
68     }
69 }
70
71
Popular Tags