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.PHPEditorEnvironment;
31 import net.sourceforge.phpeclipse.phpeditor.PHPSourceViewerConfiguration;
32 import net.sourceforge.phpeclipse.preferences.ColorEditor;
33 import net.sourceforge.phpeclipse.preferences.PHPPreferencesMessages;
35 import org.eclipse.core.runtime.IStatus;
36 import org.eclipse.jface.preference.FileFieldEditor;
37 import org.eclipse.jface.preference.IPreferenceStore;
38 import org.eclipse.jface.preference.PreferenceConverter;
39 import org.eclipse.jface.preference.PreferencePage;
40 import org.eclipse.jface.resource.JFaceResources;
41 import org.eclipse.jface.text.Document;
42 import org.eclipse.jface.text.IDocument;
43 import org.eclipse.jface.text.IDocumentPartitioner;
44 import org.eclipse.jface.text.source.ISourceViewer;
45 import org.eclipse.jface.text.source.SourceViewer;
46 import org.eclipse.jface.util.IPropertyChangeListener;
47 import org.eclipse.jface.util.PropertyChangeEvent;
48 import org.eclipse.swt.SWT;
49 import org.eclipse.swt.custom.StyledText;
50 import org.eclipse.swt.events.ModifyEvent;
51 import org.eclipse.swt.events.ModifyListener;
52 import org.eclipse.swt.events.SelectionAdapter;
53 import org.eclipse.swt.events.SelectionEvent;
54 import org.eclipse.swt.events.SelectionListener;
55 import org.eclipse.swt.graphics.Color;
56 import org.eclipse.swt.graphics.RGB;
57 import org.eclipse.swt.layout.GridData;
58 import org.eclipse.swt.layout.GridLayout;
59 import org.eclipse.swt.layout.RowLayout;
60 import org.eclipse.swt.widgets.Button;
61 import org.eclipse.swt.widgets.Composite;
62 import org.eclipse.swt.widgets.Control;
63 import org.eclipse.swt.widgets.Display;
64 import org.eclipse.swt.widgets.Group;
65 import org.eclipse.swt.widgets.Label;
66 import org.eclipse.swt.widgets.List;
67 import org.eclipse.swt.widgets.TabFolder;
68 import org.eclipse.swt.widgets.TabItem;
69 import org.eclipse.swt.widgets.Text;
70 import org.eclipse.ui.IWorkbench;
71 import org.eclipse.ui.IWorkbenchPreferencePage;
72 import org.eclipse.ui.texteditor.AbstractTextEditor;
73 import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor;
76 * The page for setting the editor options.
78 public class PHPEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
80 private static final String BOLD = PreferenceConstants.EDITOR_BOLD_SUFFIX;
82 public final OverlayPreferenceStore.OverlayKey[] fKeys =
83 new OverlayPreferenceStore.OverlayKey[] {
84 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_FOREGROUND_COLOR),
85 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOREGROUND_DEFAULT_COLOR),
86 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_BACKGROUND_COLOR),
87 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR),
88 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.EDITOR_TAB_WIDTH),
89 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR),
90 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD),
91 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR),
92 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD),
93 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR),
94 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD),
95 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR),
96 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_BOLD),
97 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_VARIABLE_COLOR),
98 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_VARIABLE_BOLD),
99 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_CONSTANT_COLOR),
100 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_CONSTANT_BOLD),
101 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_TYPE_COLOR),
102 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PHP_TYPE_BOLD),
103 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_STRING_COLOR),
104 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_STRING_BOLD),
105 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR),
106 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD),
107 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR),
108 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_BOLD),
109 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD),
110 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD),
111 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR),
112 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD),
113 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR),
114 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD),
115 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR),
116 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MATCHING_BRACKETS),
117 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CURRENT_LINE_COLOR),
118 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CURRENT_LINE),
119 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR),
120 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN),
121 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PRINT_MARGIN),
122 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_FIND_SCOPE_COLOR),
123 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_LINKED_POSITION_COLOR),
124 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_LINK_COLOR),
125 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PROBLEM_INDICATION_COLOR),
126 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_PROBLEM_INDICATION),
127 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_WARNING_INDICATION_COLOR),
128 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_WARNING_INDICATION),
129 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_TASK_INDICATION_COLOR),
130 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_TASK_INDICATION),
131 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_BOOKMARK_INDICATION_COLOR),
132 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_BOOKMARK_INDICATION),
133 new OverlayPreferenceStore.OverlayKey(
134 OverlayPreferenceStore.STRING,
135 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_COLOR),
136 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION),
137 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR),
138 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_UNKNOWN_INDICATION),
139 new OverlayPreferenceStore.OverlayKey(
140 OverlayPreferenceStore.BOOLEAN,
141 PreferenceConstants.EDITOR_ERROR_INDICATION_IN_OVERVIEW_RULER),
142 new OverlayPreferenceStore.OverlayKey(
143 OverlayPreferenceStore.BOOLEAN,
144 PreferenceConstants.EDITOR_WARNING_INDICATION_IN_OVERVIEW_RULER),
145 new OverlayPreferenceStore.OverlayKey(
146 OverlayPreferenceStore.BOOLEAN,
147 PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER),
148 new OverlayPreferenceStore.OverlayKey(
149 OverlayPreferenceStore.BOOLEAN,
150 PreferenceConstants.EDITOR_BOOKMARK_INDICATION_IN_OVERVIEW_RULER),
151 new OverlayPreferenceStore.OverlayKey(
152 OverlayPreferenceStore.BOOLEAN,
153 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER),
154 new OverlayPreferenceStore.OverlayKey(
155 OverlayPreferenceStore.BOOLEAN,
156 PreferenceConstants.EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER),
157 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CORRECTION_INDICATION),
158 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE),
159 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS),
160 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_OVERVIEW_RULER),
161 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR),
162 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_LINE_NUMBER_RULER),
163 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SPACES_FOR_TABS),
164 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_AUTOACTIVATION),
165 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY),
166 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_AUTOINSERT),
167 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND),
168 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND),
169 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND),
170 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND),
171 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND),
172 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND),
173 new OverlayPreferenceStore.OverlayKey(
174 OverlayPreferenceStore.STRING,
175 PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA),
176 new OverlayPreferenceStore.OverlayKey(
177 OverlayPreferenceStore.STRING,
178 PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC),
179 new OverlayPreferenceStore.OverlayKey(
180 OverlayPreferenceStore.STRING,
181 PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_HTML),
182 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS),
183 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS),
184 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_CASE_SENSITIVITY),
185 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_ADDIMPORT),
186 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_INSERT_COMPLETION),
187 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES),
188 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS),
189 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_PASTE),
190 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS),
191 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS),
192 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACES),
193 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_JAVADOCS),
194 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_WRAP_STRINGS),
195 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS),
196 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FORMAT_JAVADOCS),
197 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_HOME_END),
198 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_DEFAULT_HOVER),
199 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_NONE_HOVER),
200 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_HOVER),
201 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_SHIFT_HOVER),
202 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_SHIFT_HOVER),
203 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_ALT_HOVER),
204 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_ALT_SHIFT_HOVER),
205 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_SHIFT_HOVER),
206 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_ALT_SHIFT_HOVER),
207 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_USERDEF_XMLFILE),
210 private final String[][] fSyntaxColorListModel = new String[][] { { PHPUIMessages.getString("PHPEditorPreferencePage.multiLineComment"), PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR }, //$NON-NLS-1$
212 PHPUIMessages.getString("PHPEditorPreferencePage.singleLineComment"), PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR }, //$NON-NLS-1$
214 PHPUIMessages.getString("PHPEditorPreferencePage.keywords"), PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR }, //$NON-NLS-1$
216 PHPUIMessages.getString("PHPEditorPreferencePage.functionNames"), PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR }, //$NON-NLS-1$
218 PHPUIMessages.getString("PHPEditorPreferencePage.variables"), PreferenceConstants.EDITOR_PHP_VARIABLE_COLOR }, //$NON-NLS-1$
220 PHPUIMessages.getString("PHPEditorPreferencePage.constants"), PreferenceConstants.EDITOR_PHP_CONSTANT_COLOR }, //$NON-NLS-1$
222 PHPUIMessages.getString("PHPEditorPreferencePage.types"), PreferenceConstants.EDITOR_PHP_TYPE_COLOR }, //$NON-NLS-1$
224 PHPUIMessages.getString("PHPEditorPreferencePage.strings"), PreferenceConstants.EDITOR_STRING_COLOR }, //$NON-NLS-1$
226 PHPUIMessages.getString("PHPEditorPreferencePage.others"), PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR }, //$NON-NLS-1$
228 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocKeywords"), PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR }, //$NON-NLS-1$
230 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocHtmlTags"), PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD }, //$NON-NLS-1$
232 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocLinks"), PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR }, //$NON-NLS-1$
234 PHPUIMessages.getString("PHPEditorPreferencePage.phpDocOthers"), PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR } //$NON-NLS-1$
237 private final String[][] fAppearanceColorListModel = new String[][] { { PHPUIMessages.getString("PHPEditorPreferencePage.lineNumberForegroundColor"), PreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR }, //$NON-NLS-1$
239 PHPUIMessages.getString("PHPEditorPreferencePage.matchingBracketsHighlightColor2"), PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR }, //$NON-NLS-1$
241 PHPUIMessages.getString("PHPEditorPreferencePage.currentLineHighlighColor"), PreferenceConstants.EDITOR_CURRENT_LINE_COLOR }, //$NON-NLS-1$
243 PHPUIMessages.getString("PHPEditorPreferencePage.printMarginColor2"), PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR }, //$NON-NLS-1$
245 PHPUIMessages.getString("PHPEditorPreferencePage.findScopeColor2"), PreferenceConstants.EDITOR_FIND_SCOPE_COLOR }, //$NON-NLS-1$
247 PHPUIMessages.getString("PHPEditorPreferencePage.linkedPositionColor2"), PreferenceConstants.EDITOR_LINKED_POSITION_COLOR }, //$NON-NLS-1$
249 PHPUIMessages.getString("PHPEditorPreferencePage.linkColor2"), PreferenceConstants.EDITOR_LINK_COLOR }, //$NON-NLS-1$
252 private final String[][] fProblemIndicationColorListModel =
256 PreferenceConstants.EDITOR_PROBLEM_INDICATION_COLOR,
257 PreferenceConstants.EDITOR_PROBLEM_INDICATION,
258 PreferenceConstants.EDITOR_ERROR_INDICATION_IN_OVERVIEW_RULER },
261 PreferenceConstants.EDITOR_WARNING_INDICATION_COLOR,
262 PreferenceConstants.EDITOR_WARNING_INDICATION,
263 PreferenceConstants.EDITOR_WARNING_INDICATION_IN_OVERVIEW_RULER },
266 PreferenceConstants.EDITOR_TASK_INDICATION_COLOR,
267 PreferenceConstants.EDITOR_TASK_INDICATION,
268 PreferenceConstants.EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER },
271 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_COLOR,
272 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION,
273 PreferenceConstants.EDITOR_SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER },
276 PreferenceConstants.EDITOR_BOOKMARK_INDICATION_COLOR,
277 PreferenceConstants.EDITOR_BOOKMARK_INDICATION,
278 PreferenceConstants.EDITOR_BOOKMARK_INDICATION_IN_OVERVIEW_RULER },
281 PreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR,
282 PreferenceConstants.EDITOR_UNKNOWN_INDICATION,
283 PreferenceConstants.EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER }
286 private OverlayPreferenceStore fOverlayStore;
287 private JavaTextTools fJavaTextTools;
288 // private JavaEditorHoverConfigurationBlock fJavaEditorHoverConfigurationBlock;
290 private Map fColorButtons = new HashMap();
291 private SelectionListener fColorButtonListener = new SelectionListener() {
292 public void widgetDefaultSelected(SelectionEvent e) {
294 public void widgetSelected(SelectionEvent e) {
295 ColorEditor editor = (ColorEditor) e.widget.getData();
296 PreferenceConverter.setValue(fOverlayStore, (String) fColorButtons.get(editor), editor.getColorValue());
300 private Map fCheckBoxes = new HashMap();
301 private SelectionListener fCheckBoxListener = new SelectionListener() {
302 public void widgetDefaultSelected(SelectionEvent e) {
304 public void widgetSelected(SelectionEvent e) {
305 Button button = (Button) e.widget;
306 fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
310 private Map fTextFields = new HashMap();
311 private ModifyListener fTextFieldListener = new ModifyListener() {
312 public void modifyText(ModifyEvent e) {
313 Text text = (Text) e.widget;
314 fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
318 private ArrayList fNumberFields = new ArrayList();
319 private ModifyListener fNumberFieldListener = new ModifyListener() {
320 public void modifyText(ModifyEvent e) {
321 numberFieldChanged((Text) e.widget);
325 private WorkbenchChainedTextFontFieldEditor fFontEditor;
326 private List fSyntaxColorList;
327 private List fAppearanceColorList;
328 private List fProblemIndicationList;
329 private ColorEditor fSyntaxForegroundColorEditor;
330 private ColorEditor fAppearanceForegroundColorEditor;
331 private ColorEditor fProblemIndicationForegroundColorEditor;
332 private ColorEditor fBackgroundColorEditor;
333 private Button fBackgroundDefaultRadioButton;
334 private Button fBackgroundCustomRadioButton;
335 private Button fBackgroundColorButton;
336 private Button fBoldCheckBox;
337 // private Button fAddJavaDocTagsButton;
338 private Button fGuessMethodArgumentsButton;
339 private SourceViewer fPreviewViewer;
340 private Color fBackgroundColor;
341 private Control fAutoInsertDelayText;
342 private Control fAutoInsertJavaTriggerText;
343 private Control fAutoInsertJavaDocTriggerText;
344 private Control fAutoInsertHTMLTriggerText;
345 private Button fShowInTextCheckBox;
346 private Button fShowInOverviewRulerCheckBox;
347 // private FileFieldEditor fUserDefinedPHPSyntaxFileFFE;
349 public PHPEditorPreferencePage() {
350 setDescription(PHPUIMessages.getString("PHPEditorPreferencePage.description")); //$NON-NLS-1$
351 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
352 fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), fKeys);
356 * @see IWorkbenchPreferencePage#init()
358 public void init(IWorkbench workbench) {
362 * @see PreferencePage#createControl(Composite)
364 public void createControl(Composite parent) {
365 super.createControl(parent);
366 // WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE);
369 private void handleSyntaxColorListSelection() {
370 int i = fSyntaxColorList.getSelectionIndex();
371 String key = fSyntaxColorListModel[i][1];
372 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
373 fSyntaxForegroundColorEditor.setColorValue(rgb);
374 fBoldCheckBox.setSelection(fOverlayStore.getBoolean(key + BOLD));
377 private void handleAppearanceColorListSelection() {
378 int i = fAppearanceColorList.getSelectionIndex();
379 String key = fAppearanceColorListModel[i][1];
380 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
381 fAppearanceForegroundColorEditor.setColorValue(rgb);
384 private void handleProblemIndicationColorListSelection() {
385 int i = fProblemIndicationList.getSelectionIndex();
387 String key = fProblemIndicationColorListModel[i][1];
388 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
389 fProblemIndicationForegroundColorEditor.setColorValue(rgb);
391 key = fProblemIndicationColorListModel[i][2];
392 fShowInTextCheckBox.setSelection(fOverlayStore.getBoolean(key));
394 key = fProblemIndicationColorListModel[i][3];
395 fShowInOverviewRulerCheckBox.setSelection(fOverlayStore.getBoolean(key));
398 private Control createSyntaxPage(Composite parent) {
400 Composite colorComposite = new Composite(parent, SWT.NULL);
401 colorComposite.setLayout(new GridLayout());
403 Group backgroundComposite = new Group(colorComposite, SWT.SHADOW_ETCHED_IN);
404 backgroundComposite.setLayout(new RowLayout());
405 backgroundComposite.setText(PHPUIMessages.getString("PHPEditorPreferencePage.backgroundColor")); //$NON-NLS-1$
407 SelectionListener backgroundSelectionListener = new SelectionListener() {
408 public void widgetSelected(SelectionEvent e) {
409 boolean custom = fBackgroundCustomRadioButton.getSelection();
410 fBackgroundColorButton.setEnabled(custom);
411 fOverlayStore.setValue(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR, !custom);
413 public void widgetDefaultSelected(SelectionEvent e) {
417 fBackgroundDefaultRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
418 fBackgroundDefaultRadioButton.setText(PHPUIMessages.getString("PHPEditorPreferencePage.systemDefault")); //$NON-NLS-1$
419 fBackgroundDefaultRadioButton.addSelectionListener(backgroundSelectionListener);
421 fBackgroundCustomRadioButton = new Button(backgroundComposite, SWT.RADIO | SWT.LEFT);
422 fBackgroundCustomRadioButton.setText(PHPUIMessages.getString("PHPEditorPreferencePage.custom")); //$NON-NLS-1$
423 fBackgroundCustomRadioButton.addSelectionListener(backgroundSelectionListener);
425 fBackgroundColorEditor = new ColorEditor(backgroundComposite);
426 fBackgroundColorButton = fBackgroundColorEditor.getButton();
428 // fUserDefinedPHPSyntaxFileFFE =
429 // new FileFieldEditor(
430 // IPreferenceConstants.PHP_USERDEF_XMLFILE,
431 // PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.syntaxdialog"),
433 // fUserDefinedPHPSyntaxFileFFE.setPreferencePage(this);
434 // fUserDefinedPHPSyntaxFileFFE.setPreferenceStore(getPreferenceStore());
435 // fUserDefinedPHPSyntaxFileFFE.load();
437 Label label = new Label(colorComposite, SWT.LEFT);
438 label.setText(PHPUIMessages.getString("PHPEditorPreferencePage.foreground")); //$NON-NLS-1$
439 label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
441 Composite editorComposite = new Composite(colorComposite, SWT.NONE);
442 GridLayout layout = new GridLayout();
443 layout.numColumns = 2;
444 layout.marginHeight = 0;
445 layout.marginWidth = 0;
446 editorComposite.setLayout(layout);
447 GridData gd = new GridData(GridData.FILL_BOTH);
448 editorComposite.setLayoutData(gd);
450 fSyntaxColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
451 gd = new GridData(GridData.FILL_BOTH);
452 gd.heightHint = convertHeightInCharsToPixels(5);
453 fSyntaxColorList.setLayoutData(gd);
455 Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
456 layout = new GridLayout();
457 layout.marginHeight = 0;
458 layout.marginWidth = 0;
459 layout.numColumns = 2;
460 stylesComposite.setLayout(layout);
461 stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
463 label = new Label(stylesComposite, SWT.LEFT);
464 label.setText(PHPUIMessages.getString("PHPEditorPreferencePage.color")); //$NON-NLS-1$
466 gd.horizontalAlignment = GridData.BEGINNING;
467 label.setLayoutData(gd);
469 fSyntaxForegroundColorEditor = new ColorEditor(stylesComposite);
470 Button foregroundColorButton = fSyntaxForegroundColorEditor.getButton();
471 gd = new GridData(GridData.FILL_HORIZONTAL);
472 gd.horizontalAlignment = GridData.BEGINNING;
473 foregroundColorButton.setLayoutData(gd);
475 fBoldCheckBox = new Button(stylesComposite, SWT.CHECK);
476 fBoldCheckBox.setText(PHPUIMessages.getString("PHPEditorPreferencePage.bold")); //$NON-NLS-1$
477 gd = new GridData(GridData.FILL_HORIZONTAL);
478 gd.horizontalAlignment = GridData.BEGINNING;
479 gd.horizontalSpan = 2;
480 fBoldCheckBox.setLayoutData(gd);
482 label = new Label(colorComposite, SWT.LEFT);
483 label.setText(PHPUIMessages.getString("PHPEditorPreferencePage.preview")); //$NON-NLS-1$
484 label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
486 Control previewer = createPreviewer(colorComposite);
487 gd = new GridData(GridData.FILL_BOTH);
488 gd.widthHint = convertWidthInCharsToPixels(20);
489 gd.heightHint = convertHeightInCharsToPixels(5);
490 previewer.setLayoutData(gd);
492 fSyntaxColorList.addSelectionListener(new SelectionListener() {
493 public void widgetDefaultSelected(SelectionEvent e) {
496 public void widgetSelected(SelectionEvent e) {
497 handleSyntaxColorListSelection();
501 foregroundColorButton.addSelectionListener(new SelectionListener() {
502 public void widgetDefaultSelected(SelectionEvent e) {
505 public void widgetSelected(SelectionEvent e) {
506 int i = fSyntaxColorList.getSelectionIndex();
507 String key = fSyntaxColorListModel[i][1];
509 PreferenceConverter.setValue(fOverlayStore, key, fSyntaxForegroundColorEditor.getColorValue());
513 fBackgroundColorButton.addSelectionListener(new SelectionListener() {
514 public void widgetDefaultSelected(SelectionEvent e) {
517 public void widgetSelected(SelectionEvent e) {
518 PreferenceConverter.setValue(
520 PreferenceConstants.EDITOR_BACKGROUND_COLOR,
521 fBackgroundColorEditor.getColorValue());
525 fBoldCheckBox.addSelectionListener(new SelectionListener() {
526 public void widgetDefaultSelected(SelectionEvent e) {
529 public void widgetSelected(SelectionEvent e) {
530 int i = fSyntaxColorList.getSelectionIndex();
531 String key = fSyntaxColorListModel[i][1];
532 fOverlayStore.setValue(key + BOLD, fBoldCheckBox.getSelection());
536 return colorComposite;
539 private Control createPreviewer(Composite parent) {
541 fJavaTextTools = new JavaTextTools(fOverlayStore);
543 fPreviewViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
544 fPreviewViewer.configure(new PHPSourceViewerConfiguration(fJavaTextTools, null));
545 fPreviewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
546 fPreviewViewer.setEditable(false);
548 initializeViewerColors(fPreviewViewer);
550 String content = loadPreviewContentFromFile("ColorSettingPreviewCode.txt"); //$NON-NLS-1$
551 IDocument document = new Document(content);
552 PHPEditorEnvironment pe;
553 IDocumentPartitioner partitioner = fJavaTextTools.createDocumentPartitioner();
554 partitioner.connect(document);
555 document.setDocumentPartitioner(partitioner);
557 fPreviewViewer.setDocument(document);
559 fOverlayStore.addPropertyChangeListener(new IPropertyChangeListener() {
560 public void propertyChange(PropertyChangeEvent event) {
561 String p = event.getProperty();
562 if (p.equals(PreferenceConstants.EDITOR_BACKGROUND_COLOR)
563 || p.equals(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR)) {
564 initializeViewerColors(fPreviewViewer);
567 fPreviewViewer.invalidateTextPresentation();
571 return fPreviewViewer.getControl();
575 * Initializes the given viewer's colors.
577 * @param viewer the viewer to be initialized
579 private void initializeViewerColors(ISourceViewer viewer) {
581 IPreferenceStore store = fOverlayStore;
584 StyledText styledText = viewer.getTextWidget();
586 // ---------- background color ----------------------
588 store.getBoolean(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR)
590 : createColor(store, PreferenceConstants.EDITOR_BACKGROUND_COLOR, styledText.getDisplay());
591 styledText.setBackground(color);
593 if (fBackgroundColor != null)
594 fBackgroundColor.dispose();
596 fBackgroundColor = color;
601 * Creates a color from the information stored in the given preference store.
602 * Returns <code>null</code> if there is no such information available.
604 private Color createColor(IPreferenceStore store, String key, Display display) {
608 if (store.contains(key)) {
610 if (store.isDefault(key))
611 rgb = PreferenceConverter.getDefaultColor(store, key);
613 rgb = PreferenceConverter.getColor(store, key);
616 return new Color(display, rgb);
622 // sets enabled flag for a control and all its sub-tree
623 private static void setEnabled(Control control, boolean enable) {
624 control.setEnabled(enable);
625 if (control instanceof Composite) {
626 Composite composite = (Composite) control;
627 Control[] children = composite.getChildren();
628 for (int i = 0; i < children.length; i++)
629 setEnabled(children[i], enable);
633 private Control createAppearancePage(Composite parent) {
635 Composite appearanceComposite = new Composite(parent, SWT.NONE);
636 GridLayout layout = new GridLayout();
637 layout.numColumns = 2;
638 appearanceComposite.setLayout(layout);
640 String label = PHPUIMessages.getString("PHPEditorPreferencePage.textFont"); //$NON-NLS-1$
641 addTextFontEditor(appearanceComposite, label, AbstractTextEditor.PREFERENCE_FONT);
643 label = PHPUIMessages.getString("PHPEditorPreferencePage.displayedTabWidth"); //$NON-NLS-1$
644 addTextField(appearanceComposite, label, PreferenceConstants.EDITOR_TAB_WIDTH, 3, 0, true);
646 label = PHPUIMessages.getString("PHPEditorPreferencePage.printMarginColumn"); //$NON-NLS-1$
647 addTextField(appearanceComposite, label, PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 3, 0, true);
649 // label= PHPUIMessages.getString("PHPEditorPreferencePage.synchronizeOnCursor"); //$NON-NLS-1$
650 // addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE, 0);
652 label = PHPUIMessages.getString("PHPEditorPreferencePage.showOverviewRuler"); //$NON-NLS-1$
653 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_OVERVIEW_RULER, 0);
655 label = PHPUIMessages.getString("PHPEditorPreferencePage.showLineNumbers"); //$NON-NLS-1$
656 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0);
658 label = PHPUIMessages.getString("PHPEditorPreferencePage.highlightMatchingBrackets"); //$NON-NLS-1$
659 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_MATCHING_BRACKETS, 0);
661 label = PHPUIMessages.getString("PHPEditorPreferencePage.highlightCurrentLine"); //$NON-NLS-1$
662 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_CURRENT_LINE, 0);
664 label = PHPUIMessages.getString("PHPEditorPreferencePage.showPrintMargin"); //$NON-NLS-1$
665 addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_PRINT_MARGIN, 0);
667 Label l = new Label(appearanceComposite, SWT.LEFT);
668 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
669 gd.horizontalSpan = 2;
670 gd.heightHint = convertHeightInCharsToPixels(1) / 2;
673 l = new Label(appearanceComposite, SWT.LEFT);
674 l.setText(PHPUIMessages.getString("PHPEditorPreferencePage.appearanceOptions")); //$NON-NLS-1$
675 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
676 gd.horizontalSpan = 2;
679 Composite editorComposite = new Composite(appearanceComposite, SWT.NONE);
680 layout = new GridLayout();
681 layout.numColumns = 2;
682 layout.marginHeight = 0;
683 layout.marginWidth = 0;
684 editorComposite.setLayout(layout);
685 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
686 gd.horizontalSpan = 2;
687 editorComposite.setLayoutData(gd);
689 fAppearanceColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
690 gd = new GridData(GridData.FILL_BOTH);
691 gd.heightHint = convertHeightInCharsToPixels(5);
692 fAppearanceColorList.setLayoutData(gd);
694 Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
695 layout = new GridLayout();
696 layout.marginHeight = 0;
697 layout.marginWidth = 0;
698 layout.numColumns = 2;
699 stylesComposite.setLayout(layout);
700 stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
702 l = new Label(stylesComposite, SWT.LEFT);
703 l.setText(PHPUIMessages.getString("PHPEditorPreferencePage.color")); //$NON-NLS-1$
705 gd.horizontalAlignment = GridData.BEGINNING;
708 fAppearanceForegroundColorEditor = new ColorEditor(stylesComposite);
709 Button foregroundColorButton = fAppearanceForegroundColorEditor.getButton();
710 gd = new GridData(GridData.FILL_HORIZONTAL);
711 gd.horizontalAlignment = GridData.BEGINNING;
712 foregroundColorButton.setLayoutData(gd);
714 fAppearanceColorList.addSelectionListener(new SelectionListener() {
715 public void widgetDefaultSelected(SelectionEvent e) {
718 public void widgetSelected(SelectionEvent e) {
719 handleAppearanceColorListSelection();
722 foregroundColorButton.addSelectionListener(new SelectionListener() {
723 public void widgetDefaultSelected(SelectionEvent e) {
726 public void widgetSelected(SelectionEvent e) {
727 int i = fAppearanceColorList.getSelectionIndex();
728 String key = fAppearanceColorListModel[i][1];
730 PreferenceConverter.setValue(fOverlayStore, key, fAppearanceForegroundColorEditor.getColorValue());
733 return appearanceComposite;
736 private Control createProblemIndicationPage(Composite parent) {
737 Composite composite = new Composite(parent, SWT.NULL);
738 GridLayout layout = new GridLayout();
739 layout.numColumns = 2;
740 composite.setLayout(layout);
742 String text = "Analyse &problems while typing";
743 addCheckBox(composite, text, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, 0);
745 text = PHPUIMessages.getString("PHPEditorPreferencePage.showQuickFixables"); //$NON-NLS-1$
746 addCheckBox(composite, text, PreferenceConstants.EDITOR_CORRECTION_INDICATION, 0);
748 Label label = new Label(composite, SWT.LEFT);
749 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
750 gd.horizontalSpan = 2;
751 gd.heightHint = convertHeightInCharsToPixels(1) / 2;
752 label.setLayoutData(gd);
754 label = new Label(composite, SWT.LEFT);
755 label.setText("&Marker presentation options:");
756 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
757 gd.horizontalSpan = 2;
758 label.setLayoutData(gd);
760 Composite editorComposite = new Composite(composite, SWT.NONE);
761 layout = new GridLayout();
762 layout.numColumns = 2;
763 layout.marginHeight = 0;
764 layout.marginWidth = 0;
765 editorComposite.setLayout(layout);
766 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
767 gd.horizontalSpan = 2;
768 editorComposite.setLayoutData(gd);
770 fProblemIndicationList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
771 gd = new GridData(GridData.FILL_BOTH);
772 gd.heightHint = convertHeightInCharsToPixels(5);
773 fProblemIndicationList.setLayoutData(gd);
775 Composite optionsComposite = new Composite(editorComposite, SWT.NONE);
776 layout = new GridLayout();
777 layout.marginHeight = 0;
778 layout.marginWidth = 0;
779 layout.numColumns = 2;
780 optionsComposite.setLayout(layout);
781 optionsComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
783 fShowInTextCheckBox = new Button(optionsComposite, SWT.CHECK);
784 fShowInTextCheckBox.setText("Show in &text");
785 gd = new GridData(GridData.FILL_HORIZONTAL);
786 gd.horizontalAlignment = GridData.BEGINNING;
787 gd.horizontalSpan = 2;
788 fShowInTextCheckBox.setLayoutData(gd);
790 fShowInOverviewRulerCheckBox = new Button(optionsComposite, SWT.CHECK);
791 fShowInOverviewRulerCheckBox.setText("Show in overview &ruler");
792 gd = new GridData(GridData.FILL_HORIZONTAL);
793 gd.horizontalAlignment = GridData.BEGINNING;
794 gd.horizontalSpan = 2;
795 fShowInOverviewRulerCheckBox.setLayoutData(gd);
797 label = new Label(optionsComposite, SWT.LEFT);
798 label.setText("C&olor:");
800 gd.horizontalAlignment = GridData.BEGINNING;
801 label.setLayoutData(gd);
803 fProblemIndicationForegroundColorEditor = new ColorEditor(optionsComposite);
804 Button foregroundColorButton = fProblemIndicationForegroundColorEditor.getButton();
805 gd = new GridData(GridData.FILL_HORIZONTAL);
806 gd.horizontalAlignment = GridData.BEGINNING;
807 foregroundColorButton.setLayoutData(gd);
809 fProblemIndicationList.addSelectionListener(new SelectionListener() {
810 public void widgetDefaultSelected(SelectionEvent e) {
814 public void widgetSelected(SelectionEvent e) {
815 handleProblemIndicationColorListSelection();
819 fShowInTextCheckBox.addSelectionListener(new SelectionListener() {
820 public void widgetDefaultSelected(SelectionEvent e) {
824 public void widgetSelected(SelectionEvent e) {
825 int i = fProblemIndicationList.getSelectionIndex();
826 String key = fProblemIndicationColorListModel[i][2];
827 fOverlayStore.setValue(key, fShowInTextCheckBox.getSelection());
831 fShowInOverviewRulerCheckBox.addSelectionListener(new SelectionListener() {
832 public void widgetDefaultSelected(SelectionEvent e) {
836 public void widgetSelected(SelectionEvent e) {
837 int i = fProblemIndicationList.getSelectionIndex();
838 String key = fProblemIndicationColorListModel[i][3];
839 fOverlayStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection());
843 foregroundColorButton.addSelectionListener(new SelectionListener() {
844 public void widgetDefaultSelected(SelectionEvent e) {
848 public void widgetSelected(SelectionEvent e) {
849 int i = fProblemIndicationList.getSelectionIndex();
850 String key = fProblemIndicationColorListModel[i][1];
851 PreferenceConverter.setValue(fOverlayStore, key, fProblemIndicationForegroundColorEditor.getColorValue());
858 // private Control createBehaviourPage(Composite parent) {
859 // Composite composite= new Composite(parent, SWT.NULL);
860 // GridLayout layout= new GridLayout(); layout.numColumns= 2;
861 // composite.setLayout(layout);
863 // String label= PHPUIMessages.getString("PHPEditorPreferencePage.wrapStrings"); //$NON-NLS-1$
864 // addCheckBox(composite, label, PreferenceConstants.EDITOR_WRAP_STRINGS, 1);
866 // label= PHPUIMessages.getString("PHPEditorPreferencePage.smartHomeEnd"); //$NON-NLS-1$
867 // addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_HOME_END, 1);
869 // label= PHPUIMessages.getString("PHPEditorPreferencePage.smartPaste"); //$NON-NLS-1$
870 // addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_PASTE, 1);
872 // label= PHPUIMessages.getString("PHPEditorPreferencePage.insertSpaceForTabs"); //$NON-NLS-1$
873 // addCheckBox(composite, label, PreferenceConstants.EDITOR_SPACES_FOR_TABS, 1);
875 // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeStrings"); //$NON-NLS-1$
876 // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS, 1);
878 // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBrackets"); //$NON-NLS-1$
879 // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS, 1);
881 // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBraces"); //$NON-NLS-1$
882 // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACES, 1);
884 // label= PHPUIMessages.getString("PHPEditorPreferencePage.closePHPDocs"); //$NON-NLS-1$
885 // Button button= addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_JAVADOCS, 1);
887 // label= PHPUIMessages.getString("PHPEditorPreferencePage.addPHPDocTags"); //$NON-NLS-1$
888 // fAddJavaDocTagsButton= addCheckBox(composite, label, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, 1);
889 // createDependency(button, fAddJavaDocTagsButton);
891 // label= PHPUIMessages.getString("PHPEditorPreferencePage.formatPHPDocs"); //$NON-NLS-1$
892 // addCheckBox(composite, label, PreferenceConstants.EDITOR_FORMAT_JAVADOCS, 1);
897 private static void indent(Control control) {
898 GridData gridData = new GridData();
899 gridData.horizontalIndent = 20;
900 control.setLayoutData(gridData);
903 private static void createDependency(final Button master, final Control slave) {
905 master.addSelectionListener(new SelectionListener() {
906 public void widgetSelected(SelectionEvent e) {
907 slave.setEnabled(master.getSelection());
910 public void widgetDefaultSelected(SelectionEvent e) {
915 private Control createContentAssistPage(Composite parent) {
917 Composite contentAssistComposite = new Composite(parent, SWT.NULL);
918 GridLayout layout = new GridLayout();
919 layout.numColumns = 2;
920 contentAssistComposite.setLayout(layout);
922 String label = PHPUIMessages.getString("PHPEditorPreferencePage.insertSingleProposalsAutomatically"); //$NON-NLS-1$
923 addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOINSERT, 0);
925 label = PHPUIMessages.getString("PHPEditorPreferencePage.showOnlyProposalsVisibleInTheInvocationContext"); //$NON-NLS-1$
926 addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS, 0);
928 label = PHPUIMessages.getString("PHPEditorPreferencePage.presentProposalsInAlphabeticalOrder"); //$NON-NLS-1$
929 addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS, 0);
931 label = PHPUIMessages.getString("PHPEditorPreferencePage.automaticallyAddImportInsteadOfQualifiedName"); //$NON-NLS-1$
932 addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ADDIMPORT, 0);
934 label = PHPUIMessages.getString("PHPEditorPreferencePage.insertCompletion"); //$NON-NLS-1$
935 addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_INSERT_COMPLETION, 0);
937 label = PHPUIMessages.getString("PHPEditorPreferencePage.fillArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
938 Button button = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, 0);
940 label = PHPUIMessages.getString("PHPEditorPreferencePage.guessArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
941 fGuessMethodArgumentsButton =
942 addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, 0);
943 createDependency(button, fGuessMethodArgumentsButton);
945 label = PHPUIMessages.getString("PHPEditorPreferencePage.enableAutoActivation"); //$NON-NLS-1$
946 final Button autoactivation = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION, 0);
948 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationDelay"); //$NON-NLS-1$
949 fAutoInsertDelayText =
950 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY, 4, 0, true);
952 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationTriggersForPHP"); //$NON-NLS-1$
953 fAutoInsertJavaTriggerText =
954 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA, 4, 0, false);
956 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationTriggersForPHPDoc"); //$NON-NLS-1$
957 fAutoInsertJavaDocTriggerText =
958 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC, 4, 0, false);
960 label = PHPUIMessages.getString("PHPEditorPreferencePage.autoActivationTriggersForHTML"); //$NON-NLS-1$
961 fAutoInsertHTMLTriggerText =
962 addTextField(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_HTML, 4, 0, false);
964 label = PHPUIMessages.getString("PHPEditorPreferencePage.backgroundForCompletionProposals"); //$NON-NLS-1$
965 addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, 0);
967 label = PHPUIMessages.getString("PHPEditorPreferencePage.foregroundForCompletionProposals"); //$NON-NLS-1$
968 addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, 0);
970 // label = PHPUIMessages.getString("PHPEditorPreferencePage.backgroundForMethodParameters"); //$NON-NLS-1$
971 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND, 0);
973 // label = PHPUIMessages.getString("PHPEditorPreferencePage.foregroundForMethodParameters"); //$NON-NLS-1$
974 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND, 0);
976 // label = PHPUIMessages.getString("PHPEditorPreferencePage.backgroundForCompletionReplacement"); //$NON-NLS-1$
977 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND, 0);
979 // label = PHPUIMessages.getString("PHPEditorPreferencePage.foregroundForCompletionReplacement"); //$NON-NLS-1$
980 // addColorButton(contentAssistComposite, label, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND, 0);
982 autoactivation.addSelectionListener(new SelectionAdapter() {
983 public void widgetSelected(SelectionEvent e) {
984 updateAutoactivationControls();
987 return contentAssistComposite;
991 * @see PreferencePage#createContents(Composite)
993 protected Control createContents(Composite parent) {
995 fOverlayStore.load();
996 fOverlayStore.start();
998 TabFolder folder = new TabFolder(parent, SWT.NONE);
999 folder.setLayout(new TabFolderLayout());
1000 folder.setLayoutData(new GridData(GridData.FILL_BOTH));
1002 TabItem item = new TabItem(folder, SWT.NONE);
1003 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.general")); //$NON-NLS-1$
1004 item.setControl(createAppearancePage(folder));
1006 item = new TabItem(folder, SWT.NONE);
1007 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.colors")); //$NON-NLS-1$
1008 item.setControl(createSyntaxPage(folder));
1010 item = new TabItem(folder, SWT.NONE);
1011 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.codeAssist")); //$NON-NLS-1$
1012 item.setControl(createContentAssistPage(folder));
1014 item = new TabItem(folder, SWT.NONE);
1015 item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.problemIndicationTab.title")); //$NON-NLS-1$
1016 item.setControl(createProblemIndicationPage(folder));
1018 // item= new TabItem(folder, SWT.NONE);
1019 // item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.behaviourTab.title")); //$NON-NLS-1$
1020 // item.setControl(createBehaviourPage(folder));
1022 // item= new TabItem(folder, SWT.NONE);
1023 // item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.hoverTab.title")); //$NON-NLS-1$
1024 // fJavaEditorHoverConfigurationBlock= new JavaEditorHoverConfigurationBlock(fOverlayStore);
1025 // item.setControl(fJavaEditorHoverConfigurationBlock.createControl(folder));
1032 private void initialize() {
1034 fFontEditor.setPreferenceStore(getPreferenceStore());
1035 fFontEditor.setPreferencePage(this);
1040 for (int i = 0; i < fSyntaxColorListModel.length; i++)
1041 fSyntaxColorList.add(fSyntaxColorListModel[i][0]);
1043 fSyntaxColorList.getDisplay().asyncExec(new Runnable() {
1045 if (fSyntaxColorList != null && !fSyntaxColorList.isDisposed()) {
1046 fSyntaxColorList.select(0);
1047 handleSyntaxColorListSelection();
1052 for (int i = 0; i < fAppearanceColorListModel.length; i++)
1053 fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
1055 fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
1057 if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
1058 fAppearanceColorList.select(0);
1059 handleAppearanceColorListSelection();
1064 for (int i = 0; i < fProblemIndicationColorListModel.length; i++)
1065 fProblemIndicationList.add(fProblemIndicationColorListModel[i][0]);
1067 fProblemIndicationList.getDisplay().asyncExec(new Runnable() {
1069 if (fProblemIndicationList != null && !fProblemIndicationList.isDisposed()) {
1070 fProblemIndicationList.select(0);
1071 handleProblemIndicationColorListSelection();
1077 private void initializeFields() {
1079 Iterator e = fColorButtons.keySet().iterator();
1080 while (e.hasNext()) {
1081 ColorEditor c = (ColorEditor) e.next();
1082 String key = (String) fColorButtons.get(c);
1083 RGB rgb = PreferenceConverter.getColor(fOverlayStore, key);
1084 c.setColorValue(rgb);
1087 e = fCheckBoxes.keySet().iterator();
1088 while (e.hasNext()) {
1089 Button b = (Button) e.next();
1090 String key = (String) fCheckBoxes.get(b);
1091 b.setSelection(fOverlayStore.getBoolean(key));
1094 e = fTextFields.keySet().iterator();
1095 while (e.hasNext()) {
1096 Text t = (Text) e.next();
1097 String key = (String) fTextFields.get(t);
1098 t.setText(fOverlayStore.getString(key));
1101 RGB rgb = PreferenceConverter.getColor(fOverlayStore, PreferenceConstants.EDITOR_BACKGROUND_COLOR);
1102 fBackgroundColorEditor.setColorValue(rgb);
1104 boolean default_ = fOverlayStore.getBoolean(PreferenceConstants.EDITOR_BACKGROUND_DEFAULT_COLOR);
1105 fBackgroundDefaultRadioButton.setSelection(default_);
1106 fBackgroundCustomRadioButton.setSelection(!default_);
1107 fBackgroundColorButton.setEnabled(!default_);
1109 // boolean closeJavaDocs= fOverlayStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_JAVADOCS);
1110 // fAddJavaDocTagsButton.setEnabled(closeJavaDocs);
1112 boolean fillMethodArguments = fOverlayStore.getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES);
1113 fGuessMethodArgumentsButton.setEnabled(fillMethodArguments);
1115 updateAutoactivationControls();
1117 // fJavaEditorHoverConfigurationBlock.initializeFields();
1120 private void updateAutoactivationControls() {
1121 boolean autoactivation = fOverlayStore.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
1122 fAutoInsertDelayText.setEnabled(autoactivation);
1123 fAutoInsertJavaTriggerText.setEnabled(autoactivation);
1124 fAutoInsertJavaDocTriggerText.setEnabled(autoactivation);
1125 fAutoInsertHTMLTriggerText.setEnabled(autoactivation);
1129 * @see PreferencePage#performOk()
1131 public boolean performOk() {
1132 fFontEditor.store();
1133 // fJavaEditorHoverConfigurationBlock.performOk();
1134 fOverlayStore.propagate();
1135 // fUserDefinedPHPSyntaxFileFFE.store();
1136 PHPeclipsePlugin.getDefault().savePluginPreferences();
1141 * @see PreferencePage#performDefaults()
1143 protected void performDefaults() {
1145 fFontEditor.loadDefault();
1147 fOverlayStore.loadDefaults();
1150 // fUserDefinedPHPSyntaxFileFFE.loadDefault();
1151 handleSyntaxColorListSelection();
1152 handleAppearanceColorListSelection();
1153 handleProblemIndicationColorListSelection();
1154 super.performDefaults();
1156 fPreviewViewer.invalidateTextPresentation();
1160 * @see DialogPage#dispose()
1162 public void dispose() {
1164 if (fJavaTextTools != null) {
1165 fJavaTextTools = null;
1168 fFontEditor.setPreferencePage(null);
1169 fFontEditor.setPreferenceStore(null);
1171 if (fOverlayStore != null) {
1172 fOverlayStore.stop();
1173 fOverlayStore = null;
1179 private Control addColorButton(Composite composite, String label, String key, int indentation) {
1181 Label labelControl = new Label(composite, SWT.NONE);
1182 labelControl.setText(label);
1184 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1185 gd.horizontalIndent = indentation;
1186 labelControl.setLayoutData(gd);
1188 ColorEditor editor = new ColorEditor(composite);
1189 Button button = editor.getButton();
1190 button.setData(editor);
1192 gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1193 button.setLayoutData(gd);
1194 button.addSelectionListener(fColorButtonListener);
1196 fColorButtons.put(editor, key);
1201 private Button addCheckBox(Composite parent, String label, String key, int indentation) {
1202 Button checkBox = new Button(parent, SWT.CHECK);
1203 checkBox.setText(label);
1205 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1206 gd.horizontalIndent = indentation;
1207 gd.horizontalSpan = 2;
1208 checkBox.setLayoutData(gd);
1209 checkBox.addSelectionListener(fCheckBoxListener);
1211 fCheckBoxes.put(checkBox, key);
1216 private Control addTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
1218 Label labelControl = new Label(composite, SWT.NONE);
1219 labelControl.setText(label);
1220 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1221 gd.horizontalIndent = indentation;
1222 labelControl.setLayoutData(gd);
1224 Text textControl = new Text(composite, SWT.BORDER | SWT.SINGLE);
1225 gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1226 gd.widthHint = convertWidthInCharsToPixels(textLimit + 1);
1227 textControl.setLayoutData(gd);
1228 textControl.setTextLimit(textLimit);
1229 fTextFields.put(textControl, key);
1231 fNumberFields.add(textControl);
1232 textControl.addModifyListener(fNumberFieldListener);
1234 textControl.addModifyListener(fTextFieldListener);
1240 private void addTextFontEditor(Composite parent, String label, String key) {
1242 Composite editorComposite = new Composite(parent, SWT.NONE);
1243 GridLayout layout = new GridLayout();
1244 layout.numColumns = 3;
1245 editorComposite.setLayout(layout);
1246 fFontEditor = new WorkbenchChainedTextFontFieldEditor(key, label, editorComposite);
1247 fFontEditor.setChangeButtonText(PHPUIMessages.getString("PHPEditorPreferencePage.change")); //$NON-NLS-1$
1249 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
1250 gd.horizontalSpan = 2;
1251 editorComposite.setLayoutData(gd);
1254 private String loadPreviewContentFromFile(String filename) {
1256 String separator = System.getProperty("line.separator"); //$NON-NLS-1$
1257 StringBuffer buffer = new StringBuffer(512);
1258 BufferedReader reader = null;
1260 reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));
1261 while ((line = reader.readLine()) != null) {
1262 buffer.append(line);
1263 buffer.append(separator);
1265 } catch (IOException io) {
1266 PHPeclipsePlugin.log(io);
1268 if (reader != null) {
1271 } catch (IOException e) {
1275 return buffer.toString();
1278 private void numberFieldChanged(Text textControl) {
1279 String number = textControl.getText();
1280 IStatus status = validatePositiveNumber(number);
1281 if (!status.matches(IStatus.ERROR))
1282 fOverlayStore.setValue((String) fTextFields.get(textControl), number);
1283 updateStatus(status);
1286 private IStatus validatePositiveNumber(String number) {
1287 StatusInfo status = new StatusInfo();
1288 if (number.length() == 0) {
1289 status.setError(PHPUIMessages.getString("PHPEditorPreferencePage.empty_input")); //$NON-NLS-1$
1292 int value = Integer.parseInt(number);
1294 status.setError(PHPUIMessages.getFormattedString("PHPEditorPreferencePage.invalid_input", number)); //$NON-NLS-1$
1295 } catch (NumberFormatException e) {
1296 status.setError(PHPUIMessages.getFormattedString("PHPEditorPreferencePage.invalid_input", number)); //$NON-NLS-1$
1302 private void updateStatus(IStatus status) {
1303 if (!status.matches(IStatus.ERROR)) {
1304 for (int i = 0; i < fNumberFields.size(); i++) {
1305 Text text = (Text) fNumberFields.get(i);
1306 IStatus s = validatePositiveNumber(text.getText());
1307 status = StatusUtil.getMoreSevere(s, status);
1310 setValid(!status.matches(IStatus.ERROR));
1311 StatusUtil.applyToStatusLine(this, status);
1315 * @deprecated Inline to avoid reference to preference page
1317 public static boolean indicateQuixFixableProblems() {
1318 return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_CORRECTION_INDICATION);
1322 * @deprecated Inline to avoid reference to preference page
1324 // static public boolean synchronizeOutlineOnCursorMove() {
1325 // return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);