KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > core > syntax > settings > JSPOptionsBeanInfo


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.web.core.syntax.settings;
21
22 import org.netbeans.modules.web.core.syntax.JSPKit;
23 import org.netbeans.modules.web.core.syntax.settings.JSPOptions;
24 import java.beans.*;
25 import java.util.MissingResourceException JavaDoc;
26 import org.openide.util.NbBundle;
27
28 /** BeanInfo for JSP editor options
29  *
30  * @author Petr Jiricka, Libor Kramolis
31  */

32 public class JSPOptionsBeanInfo extends org.netbeans.modules.editor.options.BaseOptionsBeanInfo {
33
34      private static final String JavaDoc[] EXPERT_PROP_NAMES = new String JavaDoc[] {
35         JSPOptions.JAVADOC_AUTO_POPUP_PROP,
36         JSPOptions.JAVADOC_PREFERRED_SIZE_PROP,
37         JSPOptions.JAVADOC_BGCOLOR,
38         JSPOptions.CODE_FOLDING_UPDATE_TIMEOUT_PROP
39             };
40     
41     public JSPOptionsBeanInfo() {
42         super ("/org/netbeans/modules/web/core/syntax/resources/jspOptions"); // NOI18N
43
}
44     
45     protected String JavaDoc[] getPropNames() {
46         return JSPOptions.JSP_PROP_NAMES;
47     }
48     
49     protected Class JavaDoc getBeanClass() {
50         return JSPOptions.class;
51     }
52     
53     protected void updatePropertyDescriptors() {
54         super.updatePropertyDescriptors();
55         setExpert(EXPERT_PROP_NAMES);
56     }
57     
58     //Try to find the key value in editor module first, then look to JSP syntax module bundle
59
protected String JavaDoc getString(String JavaDoc key) {
60         try {
61             return super.getString(key);
62         }catch(MissingResourceException JavaDoc mre) {
63             return NbBundle.getMessage(JSPKit.class, key);
64         }
65     }
66     
67 }
68
Popular Tags