KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > ruby > rhtml > RhtmlOptions


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.ruby.rhtml;
21
22 import java.util.MissingResourceException JavaDoc;
23 import org.netbeans.editor.SettingsNames;
24 import org.netbeans.editor.ext.ExtSettingsNames;
25 //import org.netbeans.editor.ext.html.HTMLSettingsNames;
26
//import org.netbeans.modules.editor.html.HTMLKit;
27
//import org.netbeans.modules.editor.html.HTMLIndentEngine;
28
import org.netbeans.modules.editor.options.OptionSupport;
29 import org.openide.util.HelpCtx;
30 import org.netbeans.modules.editor.NbEditorUtilities;
31 import org.netbeans.modules.editor.options.BaseOptions;
32 import org.openide.util.NbBundle;
33 import java.awt.Color JavaDoc;
34 import java.awt.Dimension JavaDoc;
35
36 /**
37 * Options for the RHTML editor kit
38 *
39 * @author Miloslav Metelka
40 * @author Tor Norbye
41 * @version 1.00
42 */

43 public class RhtmlOptions extends BaseOptions {
44
45     public static final String JavaDoc RHTML = "rhtml"; // NOI18N
46

47 // public static final String COMPLETION_AUTO_POPUP_PROP = "completionAutoPopup"; // NOI18N
48
//
49
// public static final String COMPLETION_AUTO_POPUP_DELAY_PROP = "completionAutoPopupDelay"; // NOI18N
50
//
51
// public static final String COMPLETION_INSTANT_SUBSTITUTION_PROP = "completionInstantSubstitution"; // NOI18N
52
//
53
// public static final String COMPLETION_LOWER_CASE_PROP = "completionLowerCase"; // NOI18N
54

55     private static final String JavaDoc HELP_ID = "editing.editor.html"; // !!! NOI18N
56

57 // public static final String JAVADOC_AUTO_POPUP_PROP = "javaDocAutoPopup"; //NOI18N
58
//
59
// public static final String JAVADOC_BGCOLOR = "javaDocBGColor"; // NOI18N
60
//
61
// public static final String JAVADOC_PREFERRED_SIZE_PROP = "javaDocPreferredSize"; //NOI18N
62
//
63
// //code folding properties
64
// public static final String CODE_FOLDING_UPDATE_TIMEOUT_PROP = "codeFoldingUpdateInterval"; //NOI18N
65
//
66
// public static final String CODE_FOLDING_ENABLE_PROP = "codeFoldingEnable"; //NOI18N
67
//
68
// static final String[] HTML_PROP_NAMES = OptionSupport.mergeStringArrays(BaseOptions.BASE_PROP_NAMES, new String[] {
69
// COMPLETION_AUTO_POPUP_PROP,
70
// COMPLETION_AUTO_POPUP_DELAY_PROP,
71
// COMPLETION_INSTANT_SUBSTITUTION_PROP,
72
// COMPLETION_LOWER_CASE_PROP,
73
// JAVADOC_AUTO_POPUP_PROP,
74
// JAVADOC_PREFERRED_SIZE_PROP,
75
// JAVADOC_BGCOLOR,
76
// CODE_FOLDING_UPDATE_TIMEOUT_PROP,
77
// CODE_FOLDING_ENABLE_PROP
78
// });
79
//
80

81     static final long serialVersionUID = 75289734362748537L;
82    
83     public RhtmlOptions() {
84         super(RhtmlKit.class, RHTML);
85     }
86
87 // public boolean getCompletionAutoPopup() {
88
// return getSettingBoolean(ExtSettingsNames.COMPLETION_AUTO_POPUP);
89
// }
90
//
91
// public void setCompletionAutoPopup(boolean v) {
92
// setSettingBoolean(ExtSettingsNames.COMPLETION_AUTO_POPUP, v, COMPLETION_AUTO_POPUP_PROP);
93
// }
94
//
95
// public int getCompletionAutoPopupDelay() {
96
// return getSettingInteger(ExtSettingsNames.COMPLETION_AUTO_POPUP_DELAY);
97
// }
98
//
99
// public void setCompletionAutoPopupDelay(int delay) {
100
// if (delay < 0) {
101
// NbEditorUtilities.invalidArgument("MSG_NegativeValue"); // NOI18N
102
// return;
103
// }
104
// setSettingInteger(ExtSettingsNames.COMPLETION_AUTO_POPUP_DELAY, delay,
105
// COMPLETION_AUTO_POPUP_DELAY_PROP);
106
// }
107
//
108
// public boolean getCompletionInstantSubstitution() {
109
// return getSettingBoolean(ExtSettingsNames.COMPLETION_INSTANT_SUBSTITUTION);
110
// }
111
// public void setCompletionInstantSubstitution(boolean v) {
112
// setSettingBoolean(ExtSettingsNames.COMPLETION_INSTANT_SUBSTITUTION, v,
113
// COMPLETION_INSTANT_SUBSTITUTION_PROP);
114
// }
115
//
116
// public boolean getCompletionLowerCase() {
117
// return getSettingBoolean(HTMLSettingsNames.COMPLETION_LOWER_CASE);
118
// }
119
// public void setCompletionLowerCase(boolean v) {
120
// setSettingBoolean(HTMLSettingsNames.COMPLETION_LOWER_CASE, v,
121
// COMPLETION_LOWER_CASE_PROP);
122
// }
123
//
124
// protected Class getDefaultIndentEngineClass() {
125
// return HTMLIndentEngine.class;
126
// }
127

128     public HelpCtx getHelpCtx () {
129         return new HelpCtx (HELP_ID);
130     }
131     
132 // public boolean getJavaDocAutoPopup() {
133
// return getSettingBoolean(ExtSettingsNames.JAVADOC_AUTO_POPUP);
134
// }
135
//
136
// public void setJavaDocAutoPopup(boolean auto) {
137
// setSettingBoolean(ExtSettingsNames.JAVADOC_AUTO_POPUP, auto,
138
// JAVADOC_AUTO_POPUP_PROP);
139
// }
140
//
141
// public Color getJavaDocBGColor() {
142
// return (Color)getSettingValue(ExtSettingsNames.JAVADOC_BG_COLOR);
143
// }
144
// public void setJavaDocBGColor(Color c) {
145
// setSettingValue(ExtSettingsNames.JAVADOC_BG_COLOR, c,
146
// JAVADOC_BGCOLOR);
147
// }
148
//
149
// public Dimension getJavaDocPreferredSize() {
150
// return (Dimension)getSettingValue(ExtSettingsNames.JAVADOC_PREFERRED_SIZE);
151
// }
152
// public void setJavaDocPreferredSize(Dimension d) {
153
// setSettingValue(ExtSettingsNames.JAVADOC_PREFERRED_SIZE, d,
154
// JAVADOC_PREFERRED_SIZE_PROP);
155
// }
156
//
157
//
158
// public int getCodeFoldingUpdateInterval() {
159
// return getSettingInteger(HTMLSettingsNames.CODE_FOLDING_UPDATE_TIMEOUT);
160
// }
161
//
162
// public void setCodeFoldingUpdateInterval(int timeout) {
163
// if (timeout < 0) {
164
// NbEditorUtilities.invalidArgument("MSG_NegativeValue"); // NOI18N
165
// return;
166
// }
167
// setSettingInteger(HTMLSettingsNames.CODE_FOLDING_UPDATE_TIMEOUT, timeout, CODE_FOLDING_UPDATE_TIMEOUT_PROP);
168
// }
169
//
170
// public boolean getCodeFoldingEnable() {
171
// return getSettingBoolean(SettingsNames.CODE_FOLDING_ENABLE);
172
// }
173
//
174
// public void setCodeFoldingEnable(boolean state) {
175
// setSettingBoolean(SettingsNames.CODE_FOLDING_ENABLE, state, CODE_FOLDING_ENABLE_PROP);
176
// }
177

178     /**
179      * Get localized string
180      */

181     protected String JavaDoc getString(String JavaDoc key) {
182         try {
183             return NbBundle.getMessage(RhtmlOptions.class, key);
184         } catch (MissingResourceException JavaDoc e) {
185             return super.getString(key);
186         }
187     }
188
189 }
190
Popular Tags