KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > IDESettingsBeanInfo


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.core;
21
22 import java.awt.Image JavaDoc;
23 import java.beans.*;
24 import org.openide.util.Exceptions;
25
26 import org.openide.util.NbBundle;
27 import org.openide.util.Utilities;
28
29 /** A BeanInfo for global IDE settings.
30  *
31  * @author Ian Formanek
32  */

33 public class IDESettingsBeanInfo extends SimpleBeanInfo {
34
35     /** Provides an explicit property info. */
36     public PropertyDescriptor[] getPropertyDescriptors() {
37         try {
38             PropertyDescriptor[] desc = new PropertyDescriptor[] {
39                        new PropertyDescriptor (IDESettings.PROP_CONFIRM_DELETE, IDESettings.class,
40                                                "getConfirmDelete", "setConfirmDelete"), // NOI18N
41
new PropertyDescriptor (IDESettings.PROP_HOME_PAGE, IDESettings.class,
42                                                "getHomePage", "setHomePage"), // NOI18N
43
new PropertyDescriptor (IDESettings.PROP_SHOW_FILE_EXTENSIONS, IDESettings.class,
44                                                "getShowFileExtensions", "setShowFileExtensions"), // NOI18N
45
new PropertyDescriptor (IDESettings.PROP_SHOW_TOOLTIPS_IN_IDE, IDESettings.class,
46                                                "getShowToolTipsInIDE", "setShowToolTipsInIDE"), // NOI18N
47
new PropertyDescriptor (IDESettings.PROP_IGNORED_FILES, IDESettings.class,
48                                                "getIgnoredFiles", "setIgnoredFiles"), // NOI18N
49
};
50
51             desc[0].setDisplayName (NbBundle.getMessage (IDESettingsBeanInfo.class, "PROP_CONFIRM_DELETE"));
52             desc[0].setShortDescription (NbBundle.getMessage (IDESettingsBeanInfo.class, "HINT_CONFIRM_DELETE"));
53
54             desc[1].setHidden (true);
55             
56             desc[2].setHidden (true);
57
58             desc[3].setDisplayName (NbBundle.getMessage (IDESettingsBeanInfo.class, "PROP_SHOW_TOOLTIPS_IN_IDE"));
59             desc[3].setShortDescription (NbBundle.getMessage (IDESettingsBeanInfo.class, "HINT_SHOW_TOOLTIPS_IN_IDE"));
60             
61             desc[4].setDisplayName (NbBundle.getMessage (IDESettingsBeanInfo.class, "PROP_ignoredFiles"));
62             desc[4].setShortDescription (NbBundle.getMessage (IDESettingsBeanInfo.class,"HINT_ignoredFiles"));
63             
64             return desc;
65         } catch (IntrospectionException ex) {
66         Exceptions.printStackTrace(ex);
67         return null;
68         }
69
70     }
71
72     /** Returns the IDESettings' icon */
73     public Image JavaDoc getIcon(int type) {
74         if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16))
75         return Utilities.loadImage("org/netbeans/core/resources/ideSettings.gif"); // NOI18N
76
else
77             return Utilities.loadImage ("org/netbeans/core/resources/ideSettings32.gif"); // NOI18N
78
}
79
80 }
81
Popular Tags