KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > checkstyle > options > CheckstyleSettingsBeanInfo


1 /*
2  * Sun Public License Notice
3  *
4  * The contents of this file are subject to the Sun Public License
5  * Version 1.0 (the "License"). You may not use this file except in
6  * compliance with the License. A copy of the License is available at
7  * http://www.sun.com/
8  *
9  * The Original Code is NetBeans. The Initial Developer of the Original
10  * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11  * Microsystems, Inc. All Rights Reserved.
12  */

13
14
15 package org.netbeans.modules.tasklist.checkstyle.options;
16
17 import java.awt.Image JavaDoc;
18 import java.beans.BeanDescriptor JavaDoc;
19 import java.beans.IntrospectionException JavaDoc;
20 import java.beans.PropertyDescriptor JavaDoc;
21 import java.beans.SimpleBeanInfo JavaDoc;
22 import org.openide.ErrorManager;
23
24 import org.openide.util.NbBundle;
25 import org.openide.util.Utilities;
26
27 /**
28  * Bean info for Checkstyle settings.
29  * @author hair
30  * @version $Id: CheckstyleSettingsBeanInfo.java,v 1.1 2006/07/12 15:23:35 hair Exp $
31  */

32 public class CheckstyleSettingsBeanInfo extends SimpleBeanInfo JavaDoc {
33
34     public BeanDescriptor JavaDoc getBeanDescriptor() {
35         BeanDescriptor JavaDoc bdesc = new BeanDescriptor JavaDoc(CheckstyleSettings.class);
36         bdesc.setDisplayName(NbBundle.getMessage(CheckstyleSettingsBeanInfo.class,
37                 "OPTION_CHECKSTYLE_SETTINGS_NAME")); //NOI18N
38
bdesc.setShortDescription(NbBundle.getMessage(CheckstyleSettingsBeanInfo.class,
39                 "HINT_CHECKSTYLE_SETTINGS_NAME")); //NOI18N
40
return bdesc;
41     }
42
43     /**
44      * Descriptor of valid properties.
45      *
46      * @return array of properties
47      */

48     public PropertyDescriptor JavaDoc[] getPropertyDescriptors() {
49
50         int i = 0;
51         PropertyDescriptor JavaDoc[] desc = null;
52         try {
53             desc = new PropertyDescriptor JavaDoc[]{
54                 new PropertyDescriptor JavaDoc(CheckstyleSettings.PROP_SCAN_CHECKSTYLE,
55                         CheckstyleSettings.class)
56             };
57
58             desc[i].setDisplayName(NbBundle.getMessage(
59                     CheckstyleSettingsBeanInfo.class,
60                     "PROP_SCAN_CHECKSTYLE")); //NOI18N
61
desc[i++].setShortDescription(NbBundle.getMessage(
62                     CheckstyleSettingsBeanInfo.class,
63                     "HINT_SCAN_CHECKSTYLE")); //NOI18N
64
} catch (IntrospectionException JavaDoc ex) {
65             
66             ErrorManager.getDefault().notify(ex);
67             throw new InternalError JavaDoc();
68         }
69         return desc;
70     }
71
72     /** (Placeholder) icon in options window */
73     public Image JavaDoc getIcon(int type) {
74         return Utilities.loadImage("org/netbeans/modules/tasklist/checkstyle/checkstyle.gif"); //NOI18N
75
}
76 }
77
Popular Tags