KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > javadoc > settings > DocumentationSettingsBeanInfo


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.javadoc.settings;
21
22 import java.awt.Image JavaDoc;
23 import java.beans.*;
24
25 import org.openide.util.NbBundle;
26 import org.netbeans.modules.javadoc.search.JavadocSearchType;
27 import org.openide.util.Utilities;
28
29 /** BeanInfo for general documentation settings
30 *
31 * @author Petr Hrebejk
32 */

33 public class DocumentationSettingsBeanInfo extends SimpleBeanInfo {
34
35     /** descriptor of bean */
36     public BeanDescriptor getBeanDescriptor() {
37         BeanDescriptor descr = new BeanDescriptor(org.netbeans.modules.javadoc.search.Jdk12SearchType_japan.class);
38         descr.setDisplayName(NbBundle.getBundle(DocumentationSettings.class).getString("CTL_Documentation_settings")); //NOI18N
39
descr.setValue ("version", "1.1"); // NOI18N
40
descr.setValue ("global", Boolean.FALSE); //NOI18N
41
return descr;
42     }
43
44     /** Descriptor of valid properties
45     * @return array of properties
46     */

47     public PropertyDescriptor[] getPropertyDescriptors () {
48         PropertyDescriptor[] desc;
49         try {
50             desc = new PropertyDescriptor[] {
51                        new PropertyDescriptor("autocommentModifierMask", DocumentationSettings.class), // 0 // NOI18N
52
new PropertyDescriptor("autocommentPackage", DocumentationSettings.class), // 1 // NOI18N
53
new PropertyDescriptor("autocommentErrorMask", DocumentationSettings.class), // 2 // NOI18N
54
new PropertyDescriptor("idxSearchSort", DocumentationSettings.class), // 3 // NOI18N
55
new PropertyDescriptor("idxSearchNoHtml", DocumentationSettings.class), // 4 // NOI18N
56
new PropertyDescriptor("idxSearchSplit", DocumentationSettings.class), // 5 // NOI18N
57
new PropertyDescriptor("autocommentSplit", DocumentationSettings.class), // 6 // NOI18N
58
new PropertyDescriptor("searchEngine", DocumentationSettings.class), // 8 // NOI18N
59
new PropertyDescriptor("fileSystemSettings", DocumentationSettings.class), // 9 // NOI18N
60
};
61
62             desc[0].setDisplayName("autocommentModifierMask"); //NOI18N
63
desc[0].setHidden( true );
64             desc[1].setDisplayName("autocommentPackage"); //NOI18N
65
desc[1].setHidden( true );
66             desc[2].setDisplayName("autocommentErrorMask"); //NOI18N
67
desc[2].setHidden( true );
68             desc[3].setDisplayName("idxSearchSort"); //NOI18N
69
desc[3].setHidden( true );
70             desc[4].setDisplayName("idxSearchNoHtml"); //NOI18N
71
desc[4].setHidden( true );
72             desc[5].setDisplayName("idxSearchSplit"); //NOI18N
73
desc[5].setHidden( true );
74             desc[6].setDisplayName("autocommentSplit"); //NOI18N
75
desc[6].setHidden( true );
76             desc[7].setDisplayName(NbBundle.getMessage(DocumentationSettingsBeanInfo.class, "PROP_SetDefaultSearchEngine")); //NOI18N
77
desc[7].setShortDescription(NbBundle.getMessage(DocumentationSettingsBeanInfo.class, "HINT_SetDefaultSearchEngine")); //NOI18N
78
desc[7].setValue("superClass", JavadocSearchType.class); //NOI18N
79
desc[8].setDisplayName("fileSystemSettings"); //NOI18N
80
desc[8].setHidden(true); //file system setting
81
} catch (IntrospectionException ex) {
82             ex.printStackTrace ();
83             return null;
84         }
85         return desc;
86     }
87
88     /** Returns the ExternalCompilerSettings' icon */
89     public Image JavaDoc getIcon(int type) {
90         if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) {
91             return Utilities.loadImage("org/netbeans/modules/javadoc/resources/JavadocSettings.gif"); // NOI18N
92
} else {
93             return Utilities.loadImage ("org/netbeans/modules/javadoc/resources/JavadocSettings32.gif"); // NOI18N
94
}
95     }
96 }
97
Popular Tags