KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > properties > syntax > PropertiesOptions


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
21 package org.netbeans.modules.properties.syntax;
22
23
24 import java.awt.Color JavaDoc;
25
26 import org.netbeans.modules.editor.options.BaseOptions;
27 import org.netbeans.modules.editor.options.OptionSupport;
28
29 import org.openide.util.HelpCtx;
30 import org.openide.util.NbBundle;
31
32
33 /**
34  * Options for the properties editor kit.
35  *
36  * @author Libor Kramolis
37  */

38 public class PropertiesOptions extends BaseOptions {
39
40     /** Generated serial version UID. */
41     static final long serialVersionUID = 2347735706857337892L;
42
43     /** Name of property. */
44     public static final String JavaDoc PROPERTIES = "properties"; // NOI18N
45

46     /** Name of property. */
47     public static final String JavaDoc SHADOW_TABLE_CELL_PROP = "shadowTableCell"; // NOI18N
48

49     /** Array of prperty names. */
50     static final String JavaDoc[] PROPERTIES_PROP_NAMES = OptionSupport.mergeStringArrays(
51         BaseOptions.BASE_PROP_NAMES,
52         new String JavaDoc[] {
53             SHADOW_TABLE_CELL_PROP
54         }
55     );
56
57     
58     /** Constructor. */
59     public PropertiesOptions() {
60         super(PropertiesKit.class, PROPERTIES);
61     }
62
63     
64     /**
65      * Gets localized string.
66      * @return localized string */

67     protected String JavaDoc getString(String JavaDoc s) {
68         try {
69             String JavaDoc res = NbBundle.getBundle(PropertiesOptions.class).getString(s);
70         return (res == null) ? super.getString(s) : res;
71         } catch (Exception JavaDoc e) {
72             return super.getString(s);
73         }
74     }
75
76     /** Gets <code>SHADOW_TABLE_CELL_PROP</code> property. */
77     public Color JavaDoc getShadowTableCell() {
78         return (Color JavaDoc) getSettingValue(SHADOW_TABLE_CELL_PROP);
79     }
80
81     /** Sets <code>SHADOW_TABLE_CELL_PROP</code> property.*/
82     public void setShadowTableCell(Color JavaDoc color) {
83         setSettingValue(SHADOW_TABLE_CELL_PROP, color);
84     }
85     
86     /** Gets help context. Overrides superclass method. */
87     public HelpCtx getHelpCtx() {
88         return new HelpCtx("editing.editor.properties"); // NOI18N
89
}
90 }
91
Popular Tags