1 /**********************************************************************
2 Copyright (c) 2000, 2002 IBM Corp. and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Common Public License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/legal/cpl-v10.html
9 IBM Corporation - Initial implementation
10 **********************************************************************/
12 package net.sourceforge.phpdt.internal.ui.preferences;
14 import java.io.BufferedReader;
15 import java.io.IOException;
16 import java.io.InputStreamReader;
17 import java.util.ArrayList;
18 import java.util.HashMap;
19 import java.util.Iterator;
22 import net.sourceforge.phpdt.internal.ui.PHPUIMessages;
23 import net.sourceforge.phpdt.internal.ui.dialog.StatusInfo;
24 import net.sourceforge.phpdt.internal.ui.dialog.StatusUtil;
25 import net.sourceforge.phpdt.internal.ui.util.TabFolderLayout;
26 import net.sourceforge.phpdt.ui.PreferenceConstants;
27 import net.sourceforge.phpdt.ui.text.JavaTextTools;
28 import net.sourceforge.phpeclipse.IPreferenceConstants;
29 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
30 import net.sourceforge.phpeclipse.phpeditor.PHPSourceViewerConfiguration;
31 import net.sourceforge.phpeclipse.preferences.ColorEditor;
33 import org.eclipse.core.runtime.IStatus;
34 import org.eclipse.jface.preference.IPreferenceStore;
35 import org.eclipse.jface.preference.PreferenceConverter;
36 import org.eclipse.jface.preference.PreferencePage;
37 import org.eclipse.jface.resource.JFaceResources;
38 import org.eclipse.jface.text.Document;
39 import org.eclipse.jface.text.IDocument;
40 import org.eclipse.jface.text.IDocumentPartitioner;
41 import org.eclipse.jface.text.source.ISourceViewer;
42 import org.eclipse.jface.text.source.SourceViewer;
43 import org.eclipse.jface.util.IPropertyChangeListener;
44 import org.eclipse.jface.util.PropertyChangeEvent;
45 import org.eclipse.swt.SWT;
46 import org.eclipse.swt.custom.StyledText;
47 import org.eclipse.swt.events.ModifyEvent;
48 import org.eclipse.swt.events.ModifyListener;
49 import org.eclipse.swt.events.SelectionAdapter;
50 import org.eclipse.swt.events.SelectionEvent;
51 import org.eclipse.swt.events.SelectionListener;
52 import org.eclipse.swt.graphics.Color;
53 import org.eclipse.swt.graphics.RGB;
54 import org.eclipse.swt.layout.GridData;
55 import org.eclipse.swt.layout.GridLayout;
56 import org.eclipse.swt.layout.RowLayout;
57 import org.eclipse.swt.widgets.Button;
58 import org.eclipse.swt.widgets.Composite;
59 import org.eclipse.swt.widgets.Control;
60 import org.eclipse.swt.widgets.Display;
61 import org.eclipse.swt.widgets.Group;
62 import org.eclipse.swt.widgets.Label;
63 import org.eclipse.swt.widgets.List;
64 import org.eclipse.swt.widgets.TabFolder;
65 import org.eclipse.swt.widgets.TabItem;
66 import org.eclipse.swt.widgets.Text;
67 import org.eclipse.ui.IWorkbench;
68 import org.eclipse.ui.IWorkbenchPreferencePage;
69 import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor;
72 * The page for setting the editor options.
74 public class PHPEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
76 private static final String BOLD = PreferenceConstants.EDITOR_BOLD_SUFFIX;
78 public final OverlayPreferenceStore.OverlayKey[] fKeys =
79 new OverlayPreferenceStore.OverlayKey[] {
80 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_FOREGROUND_COLOR),
81 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOREGROUND_DEFAULT_COLOR),
82 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_BACKGROUND_COLOR),
83 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR),
84 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.EDITOR_TAB_WIDTH),
85 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR),
86 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD),
87 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR),
88 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD),
89 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR),
90 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD),
91 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR),
92 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_BOLD),
93 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_VARIABLE_COLOR),
94 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_VARIABLE_BOLD),
95 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_CONSTANT_COLOR),
96 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_CONSTANT_BOLD),
97 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_TYPE_COLOR),
98 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_TYPE_BOLD),
99 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_STRING_COLOR),
100 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_STRING_BOLD),
101 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR),
102 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD),
103 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR),
104 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_BOLD),
105 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR),
106 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD),
107 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR),
108 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD),
109 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR),
110 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD),
111 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR),
112 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MATCHING_BRACKETS),
113 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CURRENT_LINE_COLOR),
114 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CURRENT_LINE),
115 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR),
116 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN),
117 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PRINT_MARGIN),
118 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_FIND_SCOPE_COLOR),
119 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_LINKED_POSITION_COLOR),
120 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_LINK_COLOR),
121 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PROBLEM_INDICATION_COLOR),
122 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PROBLEM_INDICATION),
123 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_WARNING_INDICATION_COLOR),
124 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_WARNING_INDICATION),
125 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_TASK_INDICATION_COLOR),
126 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION),
127 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_BOOKMARK_INDICATION_COLOR),
128 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_BOOKMARK_INDICATION),
129 new OverlayPreferenceStore.OverlayKey(
130 OverlayPreferenceStore.STRING,
131 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_COLOR),
132 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION),
133 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR),
134 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_UNKNOWN_INDICATION),
135 new OverlayPreferenceStore.OverlayKey(
136 OverlayPreferenceStore.BOOLEAN,
137 PreferenceConstants.EDITOR_ERROR_INDICATION_IN_OVERVIEW_RULER),
138 new OverlayPreferenceStore.OverlayKey(
139 OverlayPreferenceStore.BOOLEAN,
140 PreferenceConstants.EDITOR_WARNING_INDICATION_IN_OVERVIEW_RULER),
141 new OverlayPreferenceStore.OverlayKey(
142 OverlayPreferenceStore.BOOLEAN,
143 PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER),
144 new OverlayPreferenceStore.OverlayKey(
145 OverlayPreferenceStore.BOOLEAN,
146 PreferenceConstants.EDITOR_BOOKMARK_INDICATION_IN_OVERVIEW_RULER),
147 new OverlayPreferenceStore.OverlayKey(
148 OverlayPreferenceStore.BOOLEAN,
149 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER),
150 new OverlayPreferenceStore.OverlayKey(
151 OverlayPreferenceStore.BOOLEAN,
152 PreferenceConstants.EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER),
153 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CORRECTION_INDICATION),
154 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE),
155 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS),
156 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_OVERVIEW_RULER),
157 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR),
158 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_LINE_NUMBER_RULER),
159 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SPACES_FOR_TABS),
160 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_AUTOACTIVATION),
161 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY),
162 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_AUTOINSERT),
163 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND),
164 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND),
165 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND),
166 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND),
167 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND),
168 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND),
169 new OverlayPreferenceStore.OverlayKey(
170 OverlayPreferenceStore.STRING,
171 PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA),
172 new OverlayPreferenceStore.OverlayKey(
173 OverlayPreferenceStore.STRING,
174 PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC),
175 new OverlayPreferenceStore.OverlayKey(
176 OverlayPreferenceStore.STRING,
177 PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_HTML),
178 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS),
179 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS),
180 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_CASE_SENSITIVITY),
181 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_ADDIMPORT),
182 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_INSERT_COMPLETION),
183 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES),
184 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS),
185 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_PASTE),
186 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS_PHP),
187 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS_PHP),
188 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACES),
189 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_JAVADOCS),
190 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_WRAP_STRINGS),
191 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS),
192 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FORMAT_JAVADOCS),
193 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_HOME_END),
194 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS_HTML),
195 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS_HTML),
196 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_DEFAULT_HOVER),
197 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_NONE_HOVER),
198 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_HOVER),
199 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_SHIFT_HOVER),
200 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_SHIFT_HOVER),
201 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_ALT_HOVER),
202 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_ALT_SHIFT_HOVER),
203 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_SHIFT_HOVER),
204 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_ALT_SHIFT_HOVER),
205 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_USERDEF_XMLFILE),
208 private final String[][] fSyntaxColorListModel = new String[][] { { PHPUIMessages.getString("PHPEditorPreferencePage.multiLineComment"), PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR }, //$NON-NLS-1$
210 PHPUIMessages.getString("PHPEditorPreferencePage.singleLineComment"), PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR }, //$NON-NLS-1$
212 PHPUIMessages.getString("PHPEditorPreferencePage.keywords"), PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR }, //$NON-NLS-1$
214 PHPUIMessages.getString("PHPEditorPreferencePage.functionNames"), PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR }, //$NON-NLS-1$
216 PHPUIMessages.getString("PHPEditorPreferencePage.variables"), PreferenceConstants.EDITOR_PHP_VARIABLE_COLOR }, //$NON-NLS-1$
218 PHPUIMessages.getString("PHPEditorPreferencePage.constants"), PreferenceConstants.EDITOR_PHP_CONSTANT_COLOR }, //$NON-NLS-1$
220 PHPUIMessages.getString("PHPEditorPreferencePage.types"), PreferenceConstants.EDITOR_PHP_TYPE_COLOR }, //$NON-NLS-1$
222 PHPUIMessages.getString("PHPEditorPreferencePage.strings"), PreferenceConstants.EDITOR_STRING_COLOR }, //$NON-NLS-1$
224 PHPUIMessages.getString("PHPEditorPreferencePage.others"), PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR }, //$NON-NLS-1$
226 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocKeywords"), PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR }, //$NON-NLS-1$
228 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocHtmlTags"), PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR }, //$NON-NLS-1$
230 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocLinks"), PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR }, //$NON-NLS-1$
232 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocOthers"), PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR } //$NON-NLS-1$
235 private final String[][] fAppearanceColorListModel = new String[][] { { PHPUIMessages.getString("PHPEditorPreferencePage.lineNumberForegroundColor"), PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR }, //$NON-NLS-1$
237 PHPUIMessages.getString("PHPEditorPreferencePage.matchingBracketsHighlightColor2"), PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR }, //$NON-NLS-1$
239 PHPUIMessages.getString("PHPEditorPreferencePage.currentLineHighlighColor"), PreferenceConstants.EDITOR_CURRENT_LINE_COLOR }, //$NON-NLS-1$
241 PHPUIMessages.getString("PHPEditorPreferencePage.printMarginColor2"), PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR }, //$NON-NLS-1$
243 PHPUIMessages.getString("PHPEditorPreferencePage.findScopeColor2"), PreferenceConstants.EDITOR_FIND_SCOPE_COLOR }, //$NON-NLS-1$
245 PHPUIMessages.getString("PHPEditorPreferencePage.linkedPositionColor2"), PreferenceConstants.EDITOR_LINKED_POSITION_COLOR }, //$NON-NLS-1$
247 PHPUIMessages.getString("PHPEditorPreferencePage.linkColor2"), PreferenceConstants.EDITOR_LINK_COLOR }, //$NON-NLS-1$
250 private final String[][] fProblemIndicationColorListModel =
254 PreferenceConstants.EDITOR_PROBLEM_INDICATION_COLOR,
255 PreferenceConstants.EDITOR_PROBLEM_INDICATION,
256 PreferenceConstants.EDITOR_ERROR_INDICATION_IN_OVERVIEW_RULER },
259 PreferenceConstants.EDITOR_WARNING_INDICATION_COLOR,
260 PreferenceConstants.EDITOR_WARNING_INDICATION,
261 PreferenceConstants.EDITOR_WARNING_INDICATION_IN_OVERVIEW_RULER },
264 PreferenceConstants.EDITOR_TASK_INDICATION_COLOR,
265 PreferenceConstants.EDITOR_TASK_INDICATION,
266 PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER },
269 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_COLOR,
270 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION,
271 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER },
274 PreferenceConstants.EDITOR_BOOKMARK_INDICATION_COLOR,
275 PreferenceConstants.EDITOR_BOOKMARK_INDICATION,
276 PreferenceConstants.EDITOR_BOOKMARK_INDICATION_IN_OVERVIEW_RULER },
279 PreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR,
280 PreferenceConstants.EDITOR_UNKNOWN_INDICATION,
281 PreferenceConstants.EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER }
284 private OverlayPreferenceStore fOverlayStore;
285 private JavaTextTools fJavaTextTools;
286 // private JavaEditorHoverConfigurationBlock fJavaEditorHoverConfigurationBlock;
288 private Map fColorButtons = new HashMap();
289 private SelectionListener fColorButtonListener = new SelectionListener() {
290 public void widgetDefaultSelected(SelectionEvent e) {
292 public void widgetSelected(SelectionEvent e) {
293 ColorEditor editor = (ColorEditor) e.widget.getData();
294 PreferenceConverter.setValue(fOverlayStore, (String) fColorButtons.get(editor), editor.getColorValue());
298 private Map fCheckBoxes = new HashMap();
299 private SelectionListener fCheckBoxListener = new SelectionListener() {
300 public void widgetDefaultSelected(SelectionEvent e) {
302 public void widgetSelected(SelectionEvent e) {
303 Button button = (Button) e.widget;
304 fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
308 private Map fTextFields = new HashMap();
309 private ModifyListener fTextFieldListener = new ModifyListener() {
310 public void modifyText(ModifyEvent e) {
311 Text text = (Text) e.widget;
312 fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
316 private ArrayList fNumberFields = new ArrayList();
317 private ModifyListener fNumberFieldListener = new ModifyListener() {
318 public void modifyText(ModifyEvent e) {
319 numberFieldChanged((Text) e.widget);
323 private WorkbenchChainedTextFontFieldEditor fFontEditor;
324 private List fSyntaxColorList;
325 private List fAppearanceColorList;
326 private List fProblemIndicationList;
327 private ColorEditor fSyntaxForegroundColorEditor;
328 private ColorEditor fAppearanceForegroundColorEditor;
329 private ColorEditor fProblemIndicationForegroundColorEditor;
330 private ColorEditor fBackgroundColorEditor;
331 private Button fBackgroundDefaultRadioButton;
332 private Button fBackgroundCustomRadioButton;
333 private Button fBackgroundColorButton;
334 private Button fBoldCheckBox;
335 //private Button fAddJavaDocTagsButton;
336 // private Button fGuessMethodArgumentsButton;
337 private SourceViewer fPreviewViewer;
338 private Color fBackgroundColor;
339 private Control fAutoInsertDelayText;
340 private Control fAutoInsertJavaTriggerText;
341 private Control fAutoInsertJavaDocTriggerText;
342 private Control fAutoInsertHTMLTriggerText;
343 private Button fShowInTextCheckBox;
344 private Button fShowInOverviewRulerCheckBox;
345 // private FileFieldEditor fUserDefinedPHPSyntaxFileFFE;
347 public PHPEditorPreferencePage() {
348 setDescription(PHPUIMessages.getString("PHPEditorPreferencePage.description")); //$NON-NLS-1$
349 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
350 fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), fKeys);
354 * @see IWorkbenchPreferencePage#init()
356 public void init(IWorkbench workbench) {
360 * @see PreferencePage#createControl(Composite)
362 public void createControl(Composite parent) {
363 super.createControl(parent);
364 // WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
367 private void handleSyntaxColorListSelection() {
368 int i = fSyntaxColorList.getSelectionIndex();
369 String key = fSyntaxColorListModel[i][1];
370 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
371 fSyntaxForegroundColorEditor.setColorValue(rgb);
372 fBoldCheckBox.setSelection(fOverlayStore.getBoolean(key + BOLD));
375 private void handleAppearanceColorListSelection() {
376 int i = fAppearanceColorList.getSelectionIndex();
377 String key = fAppearanceColorListModel[i][1];
378 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
379 fAppearanceForegroundColorEditor.setColorValue(rgb);
382 private void handleProblemIndicationColorListSelection() {
383 int i = fProblemIndicationList.getSelectionIndex();
385 String key = fProblemIndicationColorListModel[i][1];
386 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
387 fProblemIndicationForegroundColorEditor.setColorValue(rgb);
389 key = fProblemIndicationColorListModel[i][2];
390 fShowInTextCheckBox.setSelection(fOverlayStore.getBoolean(key));
392 key = fProblemIndicationColorListModel[i][3];
393 fShowInOverviewRulerCheckBox.setSelection(fOverlayStore.getBoolean(key));
396 private Control createSyntaxPage(Composite parent) {
398 Composite colorComposite = new Composite(parent, SWT.NULL);
399 colorComposite.setLayout(new GridLayout());
401 Group backgroundComposite = new Group(colorComposite, SWT.SHADOW_ETCHED_IN);
402 backgroundComposite.setLayout(new RowLayout());
403 backgroundComposite.setText(PHPUIMessages.getString("PHPEditorPreferencePage.backgroundColor")); //$NON-NLS-1$
405 SelectionListener backgroundSelectionListener = new SelectionListener() {
406 public void widgetSelected(SelectionEvent e) {
407 boolean custom = fBackgroundCustomRadioButton.getSelection();
408 fBackgroundColorButton.setEnabled(custom);
409 fOverlayStore.setValue(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR, !custom);
411 public void widgetDefaultSelected(SelectionEvent e) {
415 fBackgroundDefaultRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
416 fBackgroundDefaultRadioButton.setText(PHPUIMessages.getString("PHPEditorPreferencePage.systemDefault")); //$NON-NLS-1$
417 fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener);
419 fBackgroundCustomRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
420 fBackgroundCustomRadioButton.setText(PHPUIMessages.getString("PHPEditorPreferencePage.custom")); //$NON-NLS-1$
421 fBackgroundCustomRadioButton.addSelectionListener(backgroundSelectionListener);
423 fBackgroundColorEditor = new ColorEditor(backgroundComposite);
424 fBackgroundColorButton = fBackgroundColorEditor.getButton();
426 // fUserDefinedPHPSyntaxFileFFE =
427 // new FileFieldEditor(
428 // IPreferenceConstants.PHP_USERDEF_XMLFILE,
429 // PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.syntaxdialog"),
431 // fUserDefinedPHPSyntaxFileFFE.setPreferencePage(this);
432 // fUserDefinedPHPSyntaxFileFFE.setPreferenceStore(getPreferenceStore());
433 // fUserDefinedPHPSyntaxFileFFE.load();
435 Label label = new Label(colorComposite, SWT.LEFT);
436 label.setText(PHPUIMessages.getString("PHPEditorPreferencePage.foreground")); //$NON-NLS-1$
437 label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
439 Composite editorComposite = new Composite(colorComposite, SWT.NONE);
440 GridLayout layout = new GridLayout();
441 layout.numColumns = 2;
442 layout.marginHeight = 0;
443 layout.marginWidth = 0;
444 editorComposite.setLayout(layout);
445 GridData gd = new GridData(GridData.FILL_BOTH);
446 editorComposite.setLayoutData(gd);
448 fSyntaxColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
449 gd = new GridData(GridData.FILL_BOTH);
450 gd.heightHint = convertHeightInCharsToPixels(5);
451 fSyntaxColorList.setLayoutData(gd);
453 Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
454 layout = new GridLayout();
455 layout.marginHeight = 0;
456 layout.marginWidth = 0;
457 layout.numColumns = 2;
458 stylesComposite.setLayout(layout);
459 stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
461 label = new Label(stylesComposite, SWT.LEFT);
462 label.setText(PHPUIMessages.getString("PHPEditorPreferencePage.color")); //$NON-NLS-1$
464 gd.horizontalAlignment = GridData.BEGINNING;
465 label.setLayoutData(gd);
467 fSyntaxForegroundColorEditor = new ColorEditor(stylesComposite);
468 Button foregroundColorButton = fSyntaxForegroundColorEditor.getButton();
469 gd = new GridData(GridData.FILL_HORIZONTAL);
470 gd.horizontalAlignment = GridData.BEGINNING;
471 foregroundColorButton.setLayoutData(gd);
473 fBoldCheckBox = new Button(stylesComposite, SWT.CHECK);
474 fBoldCheckBox.setText(PHPUIMessages.getString("PHPEditorPreferencePage.bold")); //$NON-NLS-1$
475 gd = new GridData(GridData.FILL_HORIZONTAL);
476 gd.horizontalAlignment = GridData.BEGINNING;
477 gd.horizontalSpan = 2;
478 fBoldCheckBox.setLayoutData(gd);
480 label = new Label(colorComposite, SWT.LEFT);
481 label.setText(PHPUIMessages.getString("PHPEditorPreferencePage.preview")); //$NON-NLS-1$
482 label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
484 Control previewer = createPreviewer(colorComposite);
485 gd = new GridData(GridData.FILL_BOTH);
486 gd.widthHint = convertWidthInCharsToPixels(20);
487 gd.heightHint = convertHeightInCharsToPixels(5);
488 previewer.setLayoutData(gd);
490 fSyntaxColorList.addSelectionListener(new SelectionListener() {
491 public void widgetDefaultSelected(SelectionEvent e) {
494 public void widgetSelected(SelectionEvent e) {
495 handleSyntaxColorListSelection();
499 foregroundColorButton.addSelectionListener(new SelectionListener() {
500 public void widgetDefaultSelected(SelectionEvent e) {
503 public void widgetSelected(SelectionEvent e) {
504 int i = fSyntaxColorList.getSelectionIndex();
505 String key = fSyntaxColorListModel[i][1];
507 PreferenceConverter.setValue(fOverlayStore, key, fSyntaxForegroundColorEditor.getColorValue());
511 fBackgroundColorButton.addSelectionListener(new SelectionListener() {
512 public void widgetDefaultSelected(SelectionEvent e) {
515 public void widgetSelected(SelectionEvent e) {
516 PreferenceConverter.setValue(
518 PreferenceConstants.EDITOR_BACKGROUND_COLOR,
519 fBackgroundColorEditor.getColorValue());
523 fBoldCheckBox.addSelectionListener(new SelectionListener() {
524 public void widgetDefaultSelected(SelectionEvent e) {
527 public void widgetSelected(SelectionEvent e) {
528 int i = fSyntaxColorList.getSelectionIndex();
529 String key = fSyntaxColorListModel[i][1];
530 fOverlayStore.setValue(key + BOLD, fBoldCheckBox.getSelection());
534 return colorComposite;
537 private Control createPreviewer(Composite parent) {
539 fJavaTextTools = new JavaTextTools(fOverlayStore);
541 fPreviewViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
542 fPreviewViewer.configure(new PHPSourceViewerConfiguration(fJavaTextTools, null));
543 fPreviewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
544 fPreviewViewer.setEditable(false);
546 initializeViewerColors(fPreviewViewer);
548 String content = loadPreviewContentFromFile("ColorSettingPreviewCode.txt"); //$NON-NLS-1$
549 IDocument document = new Document(content);
550 // PHPEditorEnvironment pe;
551 IDocumentPartitioner partitioner = fJavaTextTools.createDocumentPartitioner();
552 partitioner.connect(document);
553 document.setDocumentPartitioner(partitioner);
555 fPreviewViewer.setDocument(document);
557 fOverlayStore.addPropertyChangeListener(new IPropertyChangeListener() {
558 public void propertyChange(PropertyChangeEvent event) {
559 String p = event.getProperty();
560 if (p.equals(PreferenceConstants.EDITOR_BACKGROUND_COLOR)
561 || p.equals(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR)) {
562 initializeViewerColors(fPreviewViewer);
565 fPreviewViewer.invalidateTextPresentation();
569 return fPreviewViewer.getControl();
573 * Initializes the given viewer's colors.
575 * @param viewer the viewer to be initialized
577 private void initializeViewerColors(ISourceViewer viewer) {
579 IPreferenceStore store = fOverlayStore;
582 StyledText styledText = viewer.getTextWidget();
584 // ---------- background color ----------------------
586 store.getBoolean(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR)
588 : createColor(store, PreferenceConstants.EDITOR_BACKGROUND_COLOR, styledText.getDisplay());
589 styledText.setBackground(color);
591 if (fBackgroundColor != null)
592 fBackgroundColor.dispose();
594 fBackgroundColor = color;
599 * Creates a color from the information stored in the given preference store.
600 * Returns <code>null</code> if there is no such information available.
602 private Color createColor(IPreferenceStore store, String key, Display display) {
606 if (store.contains(key)) {
608 if (store.isDefault(key))
609 rgb = PreferenceConverter.getDefaultColor(store, key);
611 rgb = PreferenceConverter.getColor(store, key);
614 return new Color(display, rgb);
620 // sets enabled flag for a control and all its sub-tree
621 private static void setEnabled(Control control, boolean enable) {
622 control.setEnabled(enable);
623 if (control instanceof Composite) {
624 Composite composite = (Composite) control;
625 Control[] children = composite.getChildren();
626 for (int i = 0; i < children.length; i++)
627 setEnabled(children[i], enable);
631 private Control createAppearancePage(Composite parent) {
633 Composite appearanceComposite = new Composite(parent, SWT.NONE);
634 GridLayout layout = new GridLayout();
635 layout.numColumns = 2;
636 appearanceComposite.setLayout(layout);
638 String label = PHPUIMessages.getString("PHPEditorPreferencePage.textFont"); //$NON-NLS-1$
639 addTextFontEditor(appearanceComposite, label, JFaceResources.TEXT_FONT);
641 label = PHPUIMessages.getString("PHPEditorPreferencePage.displayedTabWidth"); //$NON-NLS-1$
642 addTextField(appearanceComposite, label, PreferenceConstants.EDITOR_TAB_WIDTH, 3, 0, true);
644 label = PHPUIMessages.getString("PHPEditorPreferencePage.printMarginColumn"); //$NON-NLS-1$
645 addTextField(appearanceComposite, label, PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 3, 0, true);
647 // label= PHPUIMessages.getString("PHPEditorPreferencePage.synchronizeOnCursor"); //$NON-NLS-1$
648 // addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, 0);
650 label = PHPUIMessages.getString("PHPEditorPreferencePage.showOverviewRuler"); //$NON-NLS-1$
651 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_OVERVIEW_RULER, 0);
653 label = PHPUIMessages.getString("PHPEditorPreferencePage.showLineNumbers"); //$NON-NLS-1$
654 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0);
656 label = PHPUIMessages.getString("PHPEditorPreferencePage.highlightMatchingBrackets"); //$NON-NLS-1$
657 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_MATCHING_BRACKETS, 0);
659 label = PHPUIMessages.getString("PHPEditorPreferencePage.highlightCurrentLine"); //$NON-NLS-1$
660 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_CURRENT_LINE, 0);
662 label = PHPUIMessages.getString("PHPEditorPreferencePage.showPrintMargin"); //$NON-NLS-1$
663 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_PRINT_MARGIN, 0);
665 Label l = new Label(appearanceComposite, SWT.LEFT);
666 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
667 gd.horizontalSpan = 2;
668 gd.heightHint = convertHeightInCharsToPixels(1) / 2;
671 l = new Label(appearanceComposite, SWT.LEFT);
672 l.setText(PHPUIMessages.getString("PHPEditorPreferencePage.appearanceOptions")); //$NON-NLS-1$
673 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
674 gd.horizontalSpan = 2;
677 Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
678 layout = new GridLayout();
679 layout.numColumns = 2;
680 layout.marginHeight = 0;
681 layout.marginWidth = 0;
682 editorComposite.setLayout(layout);
683 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
684 gd.horizontalSpan = 2;
685 editorComposite.setLayoutData(gd);
687 fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
688 gd = new GridData(GridData.FILL_BOTH);
689 gd.heightHint = convertHeightInCharsToPixels(5);
690 fAppearanceColorList.setLayoutData(gd);
692 Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
693 layout = new GridLayout();
694 layout.marginHeight = 0;
695 layout.marginWidth = 0;
696 layout.numColumns = 2;
697 stylesComposite.setLayout(layout);
698 stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
700 l = new Label(stylesComposite, SWT.LEFT);
701 l.setText(PHPUIMessages.getString("PHPEditorPreferencePage.color")); //$NON-NLS-1$
703 gd.horizontalAlignment = GridData.BEGINNING;
706 fAppearanceForegroundColorEditor = new ColorEditor(stylesComposite);
707 Button foregroundColorButton = fAppearanceForegroundColorEditor.getButton();
708 gd = new GridData(GridData.FILL_HORIZONTAL);
709 gd.horizontalAlignment = GridData.BEGINNING;
710 foregroundColorButton.setLayoutData(gd);
712 fAppearanceColorList.addSelectionListener(new SelectionListener() {
713 public void widgetDefaultSelected(SelectionEvent e) {
716 public void widgetSelected(SelectionEvent e) {
717 handleAppearanceColorListSelection();
720 foregroundColorButton.addSelectionListener(new SelectionListener() {
721 public void widgetDefaultSelected(SelectionEvent e) {
724 public void widgetSelected(SelectionEvent e) {
725 int i = fAppearanceColorList.getSelectionIndex();
726 String key = fAppearanceColorListModel[i][1];
728 PreferenceConverter.setValue(fOverlayStore, key, fAppearanceForegroundColorEditor.getColorValue());
731 return appearanceComposite;
734 private Control createProblemIndicationPage(Composite parent) {
735 Composite composite = new Composite(parent, SWT.NULL);
736 GridLayout layout = new GridLayout();
737 layout.numColumns = 2;
738 composite.setLayout(layout);
740 // String text = "Analyse &problems while typing";
741 // addCheckBox(composite, text, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, 0);
743 // text = PHPUIMessages.getString("PHPEditorPreferencePage.showQuickFixables"); //$NON-NLS-1$
744 // addCheckBox(composite, text, PreferenceConstants.EDITOR_CORRECTION_INDICATION, 0);
746 Label label = new Label(composite, SWT.LEFT);
747 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
748 gd.horizontalSpan = 2;
749 gd.heightHint = convertHeightInCharsToPixels(1) / 2;
750 label.setLayoutData(gd);
752 label = new Label(composite, SWT.LEFT);
753 label.setText("&Marker presentation options:");
754 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
755 gd.horizontalSpan = 2;
756 label.setLayoutData(gd);
758 Composite editorComposite = new Composite(composite, SWT.NONE);
759 layout = new GridLayout();
760 layout.numColumns = 2;
761 layout.marginHeight = 0;
762 layout.marginWidth = 0;
763 editorComposite.setLayout(layout);
764 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
765 gd.horizontalSpan = 2;
766 editorComposite.setLayoutData(gd);
768 fProblemIndicationList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
769 gd = new GridData(GridData.FILL_BOTH);
770 gd.heightHint = convertHeightInCharsToPixels(5);
771 fProblemIndicationList.setLayoutData(gd);
773 Composite optionsComposite = new Composite(editorComposite, SWT.NONE);
774 layout = new GridLayout();
775 layout.marginHeight = 0;
776 layout.marginWidth = 0;
777 layout.numColumns = 2;
778 optionsComposite.setLayout(layout);
779 optionsComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
781 fShowInTextCheckBox = new Button(optionsComposite, SWT.CHECK);
782 fShowInTextCheckBox.setText("Show in &text");
783 gd = new GridData(GridData.FILL_HORIZONTAL);
784 gd.horizontalAlignment = GridData.BEGINNING;
785 gd.horizontalSpan = 2;
786 fShowInTextCheckBox.setLayoutData(gd);
788 fShowInOverviewRulerCheckBox = new Button(optionsComposite, SWT.CHECK);
789 fShowInOverviewRulerCheckBox.setText("Show in overview &ruler");
790 gd = new GridData(GridData.FILL_HORIZONTAL);
791 gd.horizontalAlignment = GridData.BEGINNING;
792 gd.horizontalSpan = 2;
793 fShowInOverviewRulerCheckBox.setLayoutData(gd);
795 label = new Label(optionsComposite, SWT.LEFT);
796 label.setText("C&olor:");
798 gd.horizontalAlignment = GridData.BEGINNING;
799 label.setLayoutData(gd);
801 fProblemIndicationForegroundColorEditor = new ColorEditor(optionsComposite);
802 Button foregroundColorButton = fProblemIndicationForegroundColorEditor.getButton();
803 gd = new GridData(GridData.FILL_HORIZONTAL);
804 gd.horizontalAlignment = GridData.BEGINNING;
805 foregroundColorButton.setLayoutData(gd);
807 fProblemIndicationList.addSelectionListener(new SelectionListener() {
808 public void widgetDefaultSelected(SelectionEvent e) {
812 public void widgetSelected(SelectionEvent e) {
813 handleProblemIndicationColorListSelection();
817 fShowInTextCheckBox.addSelectionListener(new SelectionListener() {
818 public void widgetDefaultSelected(SelectionEvent e) {
822 public void widgetSelected(SelectionEvent e) {
823 int i = fProblemIndicationList.getSelectionIndex();
824 String key = fProblemIndicationColorListModel[i][2];
825 fOverlayStore.setValue(key, fShowInTextCheckBox.getSelection());
829 fShowInOverviewRulerCheckBox.addSelectionListener(new SelectionListener() {
830 public void widgetDefaultSelected(SelectionEvent e) {
834 public void widgetSelected(SelectionEvent e) {
835 int i = fProblemIndicationList.getSelectionIndex();
836 String key = fProblemIndicationColorListModel[i][3];
837 fOverlayStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection());
841 foregroundColorButton.addSelectionListener(new SelectionListener() {
842 public void widgetDefaultSelected(SelectionEvent e) {
846 public void widgetSelected(SelectionEvent e) {
847 int i = fProblemIndicationList.getSelectionIndex();
848 String key = fProblemIndicationColorListModel[i][1];
849 PreferenceConverter.setValue(fOverlayStore, key, fProblemIndicationForegroundColorEditor.getColorValue());
856 private Control createBehaviourPage(Composite parent) {
857 Composite composite= new Composite(parent, SWT.NULL);
858 GridLayout layout= new GridLayout(); layout.numColumns= 2;
859 composite.setLayout(layout);
861 // String label= PHPUIMessages.getString("PHPEditorPreferencePage.wrapStrings"); //$NON-NLS-1$
862 // addCheckBox(composite, label, PreferenceConstants.EDITOR_WRAP_STRINGS, 1);
864 // label= PHPUIMessages.getString("PHPEditorPreferencePage.smartHomeEnd"); //$NON-NLS-1$
865 // addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_HOME_END, 1);
867 // label= PHPUIMessages.getString("PHPEditorPreferencePage.smartPaste"); //$NON-NLS-1$
868 // addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_PASTE, 1);
870 label= PHPUIMessages.getString("PHPEditorPreferencePage.insertSpaceForTabs"); //$NON-NLS-1$
871 addCheckBox(composite, label, PreferenceConstants.EDITOR_SPACES_FOR_TABS, 1);
873 label= PHPUIMessages.getString("PHPEditorPreferencePage.closeStringsPHP"); //$NON-NLS-1$
874 addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS_PHP, 1);
876 label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBracketsPHP"); //$NON-NLS-1$
877 addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS_PHP, 1);
879 // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBraces"); //$NON-NLS-1$
880 // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACES, 1);
882 // label= PHPUIMessages.getString("PHPEditorPreferencePage.closePHPDocs"); //$NON-NLS-1$
883 // Button button= addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_JAVADOCS, 1);
885 // label= PHPUIMessages.getString("PHPEditorPreferencePage.addPHPDocTags"); //$NON-NLS-1$
886 // fAddJavaDocTagsButton= addCheckBox(composite, label, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, 1);
887 // createDependency(button, fAddJavaDocTagsButton);
889 // label= PHPUIMessages.getString("PHPEditorPreferencePage.formatPHPDocs"); //$NON-NLS-1$
890 // addCheckBox(composite, label, PreferenceConstants.EDITOR_FORMAT_JAVADOCS, 1);
892 label= PHPUIMessages.getString("PHPEditorPreferencePage.closeStringsHTML"); //$NON-NLS-1$
893 addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS_HTML, 1);
895 label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBracketsHTML"); //$NON-NLS-1$
896 addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS_HTML, 1);
900 private static void indent(Control control) {
901 GridData gridData = new GridData();
902 gridData.horizontalIndent = 20;
903 control.setLayoutData(gridData);
906 private static void createDependency(final Button master, final Control slave) {
908 master.addSelectionListener(new SelectionListener() {
909 public void widgetSelected(SelectionEvent e) {
910 slave.setEnabled(master.getSelection());
913 public void widgetDefaultSelected(SelectionEvent e) {
918 private Control createContentAssistPage(Composite parent) {
920 Composite contentAssistComposite = new Composite(parent, SWT.NULL);
921 GridLayout layout = new GridLayout();
922 layout.numColumns = 2;
923 contentAssistComposite.setLayout(layout);
925 // String label = PHPUIMessages.getString("PHPEditorPreferencePage.insertSingleProposalsAutomatically"); //$NON-NLS-1$
926 // addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOINSERT, 0);
928 // label = PHPUIMessages.getString("PHPEditorPreferencePage.showOnlyProposalsVisibleInTheInvocationContext"); //$NON-NLS-1$
929 // addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS, 0);
931 // label = PHPUIMessages.getString("PHPEditorPreferencePage.presentProposalsInAlphabeticalOrder"); //$NON-NLS-1$
932 // addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS, 0);
934 // label = PHPUIMessages.getString("PHPEditorPreferencePage.automaticallyAddImportInsteadOfQualifiedName"); //$NON-NLS-1$
935 // addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ADDIMPORT, 0);
937 // label = PHPUIMessages.getString("PHPEditorPreferencePage.insertCompletion"); //$NON-NLS-1$
938 // addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_INSERT_COMPLETION, 0);
940 // label = PHPUIMessages.getString("PHPEditorPreferencePage.fillArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
941 // Button button = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, 0);
943 // label = PHPUIMessages.getString("PHPEditorPreferencePage.guessArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
944 // fGuessMethodArgumentsButton =
945 // addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, 0);
946 // createDependency(button, fGuessMethodArgumentsButton);
948 label = PHPUIMessages.getString("PHPEditorPreferencePage.enableAutoActivation"); //$NON-NLS-1$
949 final Button autoactivation = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION, 0);
951 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationDelay"); //$NON-NLS-1$
952 fAutoInsertDelayText =
953 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY, 4, 0, true);
955 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationTriggersForPHP"); //$NON-NLS-1$
956 fAutoInsertJavaTriggerText =
957 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA, 4, 0, false);
959 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationTriggersForPHPDoc"); //$NON-NLS-1$
960 fAutoInsertJavaDocTriggerText =
961 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC, 4, 0, false);
963 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationTriggersForHTML"); //$NON-NLS-1$
964 fAutoInsertHTMLTriggerText =
965 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_HTML, 4, 0, false);
967 label = PHPUIMessages.getString("PHPEditorPreferencePage.backgroundForCompletionProposals"); //$NON-NLS-1$
968 addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, 0);
970 label = PHPUIMessages.getString("PHPEditorPreferencePage.foregroundForCompletionProposals"); //$NON-NLS-1$
971 addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, 0);
973 // label = PHPUIMessages.getString("PHPEditorPreferencePage.backgroundForMethodParameters"); //$NON-NLS-1$
974 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, 0);
976 // label = PHPUIMessages.getString("PHPEditorPreferencePage.foregroundForMethodParameters"); //$NON-NLS-1$
977 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, 0);
979 // label = PHPUIMessages.getString("PHPEditorPreferencePage.backgroundForCompletionReplacement"); //$NON-NLS-1$
980 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND, 0);
982 // label = PHPUIMessages.getString("PHPEditorPreferencePage.foregroundForCompletionReplacement"); //$NON-NLS-1$
983 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND, 0);
985 autoactivation.addSelectionListener(new SelectionAdapter() {
986 public void widgetSelected(SelectionEvent e) {
987 updateAutoactivationControls();
990 return contentAssistComposite;
994 * @see PreferencePage#createContents(Composite)
996 protected Control createContents(Composite parent) {
998 fOverlayStore.load();
999 fOverlayStore.start();
1001 TabFolder folder = new TabFolder(parent, SWT.NONE);
1002 folder.setLayout(new TabFolderLayout());
1003 folder.setLayoutData(new GridData(GridData.FILL_BOTH));
1005 TabItem item = new TabItem(folder, SWT.NONE);
1006 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.general")); //$NON-NLS-1$
1007 item.setControl(createAppearancePage(folder));
1009 item = new TabItem(folder, SWT.NONE);
1010 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.colors")); //$NON-NLS-1$
1011 item.setControl(createSyntaxPage(folder));
1013 item = new TabItem(folder, SWT.NONE);
1014 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.codeAssist")); //$NON-NLS-1$
1015 item.setControl(createContentAssistPage(folder));
1017 item = new TabItem(folder, SWT.NONE);
1018 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.problemIndicationTab.title")); //$NON-NLS-1$
1019 item.setControl(createProblemIndicationPage(folder));
1021 item= new TabItem(folder, SWT.NONE);
1022 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.behaviourTab.title")); //$NON-NLS-1$
1023 item.setControl(createBehaviourPage(folder));
1025 // item= new TabItem(folder, SWT.NONE);
1026 // item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.hoverTab.title")); //$NON-NLS-1$
1027 // fJavaEditorHoverConfigurationBlock= new JavaEditorHoverConfigurationBlock(fOverlayStore);
1028 // item.setControl(fJavaEditorHoverConfigurationBlock.createControl(folder));
1035 private void initialize() {
1037 fFontEditor.setPreferenceStore(getPreferenceStore());
1038 fFontEditor.setPreferencePage(this);
1043 for (int i = 0; i < fSyntaxColorListModel.length; i++)
1044 fSyntaxColorList.add(fSyntaxColorListModel[i][0]);
1046 fSyntaxColorList.getDisplay().asyncExec(new Runnable() {
1048 if (fSyntaxColorList != null && !fSyntaxColorList.isDisposed()) {
1049 fSyntaxColorList.select(0);
1050 handleSyntaxColorListSelection();
1055 for (int i = 0; i < fAppearanceColorListModel.length; i++)
1056 fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
1058 fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
1060 if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
1061 fAppearanceColorList.select(0);
1062 handleAppearanceColorListSelection();
1067 for (int i = 0; i < fProblemIndicationColorListModel.length; i++)
1068 fProblemIndicationList.add(fProblemIndicationColorListModel[i][0]);
1070 fProblemIndicationList.getDisplay().asyncExec(new Runnable() {
1072 if (fProblemIndicationList != null && !fProblemIndicationList.isDisposed()) {
1073 fProblemIndicationList.select(0);
1074 handleProblemIndicationColorListSelection();
1080 private void initializeFields() {
1082 Iterator e = fColorButtons.keySet().iterator();
1083 while (e.hasNext()) {
1084 ColorEditor c = (ColorEditor) e.next();
1085 String key = (String) fColorButtons.get(c);
1086 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
1087 c.setColorValue(rgb);
1090 e = fCheckBoxes.keySet().iterator();
1091 while (e.hasNext()) {
1092 Button b = (Button) e.next();
1093 String key = (String) fCheckBoxes.get(b);
1094 b.setSelection(fOverlayStore.getBoolean(key));
1097 e = fTextFields.keySet().iterator();
1098 while (e.hasNext()) {
1099 Text t = (Text) e.next();
1100 String key = (String) fTextFields.get(t);
1101 t.setText(fOverlayStore.getString(key));
1104 RGB rgb = PreferenceConverter.getColor(fOverlayStore, PreferenceConstants.EDITOR_BACKGROUND_COLOR);
1105 fBackgroundColorEditor.setColorValue(rgb);
1107 boolean default_ = fOverlayStore.getBoolean(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR);
1108 fBackgroundDefaultRadioButton.setSelection(default_);
1109 fBackgroundCustomRadioButton.setSelection(!default_);
1110 fBackgroundColorButton.setEnabled(!default_);
1112 // boolean closeJavaDocs= fOverlayStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_JAVADOCS);
1113 // fAddJavaDocTagsButton.setEnabled(closeJavaDocs);
1115 // boolean fillMethodArguments = fOverlayStore.getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES);
1116 // fGuessMethodArgumentsButton.setEnabled(fillMethodArguments);
1118 updateAutoactivationControls();
1120 // fJavaEditorHoverConfigurationBlock.initializeFields();
1123 private void updateAutoactivationControls() {
1124 boolean autoactivation = fOverlayStore.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
1125 fAutoInsertDelayText.setEnabled(autoactivation);
1126 fAutoInsertJavaTriggerText.setEnabled(autoactivation);
1127 fAutoInsertJavaDocTriggerText.setEnabled(autoactivation);
1128 fAutoInsertHTMLTriggerText.setEnabled(autoactivation);
1132 * @see PreferencePage#performOk()
1134 public boolean performOk() {
1135 fFontEditor.store();
1136 // fJavaEditorHoverConfigurationBlock.performOk();
1137 fOverlayStore.propagate();
1138 // fUserDefinedPHPSyntaxFileFFE.store();
1139 PHPeclipsePlugin.getDefault().savePluginPreferences();
1144 * @see PreferencePage#performDefaults()
1146 protected void performDefaults() {
1148 fFontEditor.loadDefault();
1150 fOverlayStore.loadDefaults();
1153 // fUserDefinedPHPSyntaxFileFFE.loadDefault();
1154 handleSyntaxColorListSelection();
1155 handleAppearanceColorListSelection();
1156 handleProblemIndicationColorListSelection();
1157 super.performDefaults();
1159 fPreviewViewer.invalidateTextPresentation();
1163 * @see DialogPage#dispose()
1165 public void dispose() {
1167 if (fJavaTextTools != null) {
1168 fJavaTextTools = null;
1171 fFontEditor.setPreferencePage(null);
1172 fFontEditor.setPreferenceStore(null);
1174 if (fOverlayStore != null) {
1175 fOverlayStore.stop();
1176 fOverlayStore = null;
1182 private Control addColorButton(Composite composite, String label, String key, int indentation) {
1184 Label labelControl = new Label(composite, SWT.NONE);
1185 labelControl.setText(label);
1187 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1188 gd.horizontalIndent = indentation;
1189 labelControl.setLayoutData(gd);
1191 ColorEditor editor = new ColorEditor(composite);
1192 Button button = editor.getButton();
1193 button.setData(editor);
1195 gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1196 button.setLayoutData(gd);
1197 button.addSelectionListener(fColorButtonListener);
1199 fColorButtons.put(editor, key);
1204 private Button addCheckBox(Composite parent, String label, String key, int indentation) {
1205 Button checkBox = new Button(parent, SWT.CHECK);
1206 checkBox.setText(label);
1208 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1209 gd.horizontalIndent = indentation;
1210 gd.horizontalSpan = 2;
1211 checkBox.setLayoutData(gd);
1212 checkBox.addSelectionListener(fCheckBoxListener);
1214 fCheckBoxes.put(checkBox, key);
1219 private Control addTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
1221 Label labelControl = new Label(composite, SWT.NONE);
1222 labelControl.setText(label);
1223 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1224 gd.horizontalIndent = indentation;
1225 labelControl.setLayoutData(gd);
1227 Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
1228 gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1229 gd.widthHint = convertWidthInCharsToPixels(textLimit + 1);
1230 textControl.setLayoutData(gd);
1231 textControl.setTextLimit(textLimit);
1232 fTextFields.put(textControl, key);
1234 fNumberFields.add(textControl);
1235 textControl.addModifyListener(fNumberFieldListener);
1237 textControl.addModifyListener(fTextFieldListener);
1243 private void addTextFontEditor(Composite parent, String label, String key) {
1245 Composite editorComposite = new Composite(parent, SWT.NONE);
1246 GridLayout layout = new GridLayout();
1247 layout.numColumns = 3;
1248 editorComposite.setLayout(layout);
1249 fFontEditor = new WorkbenchChainedTextFontFieldEditor(key, label, editorComposite);
1250 fFontEditor.setChangeButtonText(PHPUIMessages.getString("PHPEditorPreferencePage.change")); //$NON-NLS-1$
1252 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
1253 gd.horizontalSpan = 2;
1254 editorComposite.setLayoutData(gd);
1257 private String loadPreviewContentFromFile(String filename) {
1259 String separator = System.getProperty("line.separator"); //$NON-NLS-1$
1260 StringBuffer buffer = new StringBuffer(512);
1261 BufferedReader reader = null;
1263 reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));
1264 while ((line = reader.readLine()) != null) {
1265 buffer.append(line);
1266 buffer.append(separator);
1268 } catch (IOException io) {
1269 PHPeclipsePlugin.log(io);
1271 if (reader != null) {
1274 } catch (IOException e) {
1278 return buffer.toString();
1281 private void numberFieldChanged(Text textControl) {
1282 String number = textControl.getText();
1283 IStatus status = validatePositiveNumber(number);
1284 if (!status.matches(IStatus.ERROR))
1285 fOverlayStore.setValue((String) fTextFields.get(textControl), number);
1286 updateStatus(status);
1289 private IStatus validatePositiveNumber(String number) {
1290 StatusInfo status = new StatusInfo();
1291 if (number.length() == 0) {
1292 status.setError(PHPUIMessages.getString("PHPEditorPreferencePage.empty_input")); //$NON-NLS-1$
1295 int value = Integer.parseInt(number);
1297 status.setError(PHPUIMessages.getFormattedString("PHPEditorPreferencePage.invalid_input", number)); //$NON-NLS-1$
1298 } catch (NumberFormatException e) {
1299 status.setError(PHPUIMessages.getFormattedString("PHPEditorPreferencePage.invalid_input", number)); //$NON-NLS-1$
1305 private void updateStatus(IStatus status) {
1306 if (!status.matches(IStatus.ERROR)) {
1307 for (int i = 0; i < fNumberFields.size(); i++) {
1308 Text text = (Text) fNumberFields.get(i);
1309 IStatus s = validatePositiveNumber(text.getText());
1310 status = StatusUtil.getMoreSevere(s, status);
1313 setValid(!status.matches(IStatus.ERROR));
1314 StatusUtil.applyToStatusLine(this, status);
1318 * @deprecated Inline to avoid reference to preference page
1320 public static boolean indicateQuixFixableProblems() {
1321 return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_CORRECTION_INDICATION);
1325 * @deprecated Inline to avoid reference to preference page
1327 // static public boolean synchronizeOutlineOnCursorMove() {
1328 // return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);