1 package net.sourceforge.phpeclipse;
3 import java.util.HashMap;
4 import java.util.Iterator;
7 import net.sourceforge.phpeclipse.preferences.ColorEditor;
8 import net.sourceforge.phpeclipse.preferences.OverlayPreferenceStore;
9 import net.sourceforge.phpeclipse.preferences.PHPPreferencesMessages;
11 import org.eclipse.core.runtime.IStatus;
12 import org.eclipse.jface.preference.BooleanFieldEditor;
13 import org.eclipse.jface.preference.FileFieldEditor;
14 import org.eclipse.jface.preference.IPreferenceStore;
15 import org.eclipse.jface.preference.IntegerFieldEditor;
16 import org.eclipse.jface.preference.PreferenceConverter;
17 import org.eclipse.jface.preference.PreferencePage;
18 import org.eclipse.jface.text.source.ISourceViewer;
19 import org.eclipse.swt.SWT;
20 import org.eclipse.swt.custom.StyledText;
21 import org.eclipse.swt.events.SelectionEvent;
22 import org.eclipse.swt.events.SelectionListener;
23 import org.eclipse.swt.graphics.Color;
24 import org.eclipse.swt.graphics.RGB;
25 import org.eclipse.swt.layout.GridData;
26 import org.eclipse.swt.layout.GridLayout;
27 import org.eclipse.swt.widgets.Button;
28 import org.eclipse.swt.widgets.Composite;
29 import org.eclipse.swt.widgets.Control;
30 import org.eclipse.swt.widgets.Display;
31 import org.eclipse.swt.widgets.Group;
32 import org.eclipse.swt.widgets.Label;
33 import org.eclipse.swt.widgets.List;
34 import org.eclipse.ui.IWorkbench;
35 import org.eclipse.ui.IWorkbenchPreferencePage;
38 * The preference page for setting the PHP Editor options.
40 public class PHPSyntaxEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
42 public final OverlayPreferenceStore.OverlayKey[] Keys =
43 new OverlayPreferenceStore.OverlayKey[] {
44 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_MULTILINE_COMMENT),
45 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_MULTILINE_COMMENT_BOLD),
46 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_MULTILINE_COMMENT_ITALIC),
47 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_MULTILINE_COMMENT_UNDERLINE),
48 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_SINGLELINE_COMMENT),
49 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_SINGLELINE_COMMENT_BOLD),
50 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_SINGLELINE_COMMENT_ITALIC),
51 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_SINGLELINE_COMMENT_UNDERLINE),
52 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_KEYWORD),
53 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_KEYWORD_BOLD),
54 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_KEYWORD_ITALIC),
55 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_KEYWORD_UNDERLINE),
56 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_VARIABLE),
57 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_VARIABLE_BOLD),
58 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_VARIABLE_ITALIC),
59 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_VARIABLE_UNDERLINE),
60 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_TYPE),
61 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_TYPE_BOLD),
62 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_TYPE_ITALIC),
63 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_TYPE_UNDERLINE),
64 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_CONSTANT),
65 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_CONSTANT_BOLD),
66 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_CONSTANT_ITALIC),
67 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_CONSTANT_UNDERLINE),
68 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_FUNCTIONNAME),
69 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_FUNCTIONNAME_BOLD),
70 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_FUNCTIONNAME_ITALIC),
71 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_FUNCTIONNAME_UNDERLINE),
72 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_STRING),
73 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_STRING_BOLD),
74 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_STRING_ITALIC),
75 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_STRING_UNDERLINE),
76 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_DEFAULT),
77 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_DEFAULT_BOLD),
78 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_DEFAULT_ITALIC),
79 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IPreferenceConstants.PHP_DEFAULT_UNDERLINE),
80 new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_USERDEF_XMLFILE),
81 // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, IPreferenceConstants.PHP_EDITOR_BACKGROUND)
84 private final String[][] SyntaxColorListModel =
87 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.multiLineComment"),
88 IPreferenceConstants.PHP_MULTILINE_COMMENT },
90 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.singleLineComment"),
91 IPreferenceConstants.PHP_SINGLELINE_COMMENT },
93 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.keywords"), IPreferenceConstants.PHP_KEYWORD }, {
94 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.variables"), IPreferenceConstants.PHP_VARIABLE }, {
95 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.types"), IPreferenceConstants.PHP_TYPE }, {
96 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.functions"), IPreferenceConstants.PHP_FUNCTIONNAME }, {
97 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.constants"), IPreferenceConstants.PHP_CONSTANT }, {
98 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.strings"), IPreferenceConstants.PHP_STRING }, {
99 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.others"), IPreferenceConstants.PHP_DEFAULT }
102 private OverlayPreferenceStore OverlayStore;
104 private Map ColorButtons = new HashMap();
105 private SelectionListener ColorButtonListener = new SelectionListener() {
106 public void widgetDefaultSelected(SelectionEvent e) {
108 public void widgetSelected(SelectionEvent e) {
109 ColorEditor editor = (ColorEditor) e.widget.getData();
110 PreferenceConverter.setValue(OverlayStore, (String) ColorButtons.get(editor), editor.getColorValue());
114 private Map CheckBoxes = new HashMap();
115 private SelectionListener CheckBoxListener = new SelectionListener() {
116 public void widgetDefaultSelected(SelectionEvent e) {
118 public void widgetSelected(SelectionEvent e) {
119 Button button = (Button) e.widget;
120 OverlayStore.setValue((String) CheckBoxes.get(button), button.getSelection());
124 private List SyntaxColorList;
125 /** The ColorEditor that choose the foreground color. */
126 private ColorEditor SyntaxForegroundColorEditor;
127 private Button BoldCheckBox;
128 private Button ItalicCheckBox;
129 private Button UnderlineCheckBox;
130 private FileFieldEditor userdefPHPSyntaxFileFFE;
131 // private BooleanFieldEditor showLineNumber;
132 // private IntegerFieldEditor formatterTabSize;
133 // private BooleanFieldEditor spacesForTabs;
135 public PHPSyntaxEditorPreferencePage() {
136 setDescription(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.description")); //$NON-NLS-1$
137 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
138 OverlayStore = new OverlayPreferenceStore(getPreferenceStore(), Keys);
141 public void init(IWorkbench workbench) {
144 public void createControl(Composite parent) {
145 super.createControl(parent);
148 private void handleSyntaxColorListSelection() {
149 int i = SyntaxColorList.getSelectionIndex();
150 String key = SyntaxColorListModel[i][1];
151 RGB rgb = PreferenceConverter.getColor(OverlayStore, key);
152 SyntaxForegroundColorEditor.setColorValue(rgb);
153 BoldCheckBox.setSelection(OverlayStore.getBoolean(key + "_bold"));
154 ItalicCheckBox.setSelection(OverlayStore.getBoolean(key + "_italic"));
155 UnderlineCheckBox.setSelection(OverlayStore.getBoolean(key + "_underline"));
159 * Create the group of options for other parameters (background color for example).
160 * @param parent the parent component
162 private void backgroundOptionPage(Composite parent) {
163 Label label = new Label(parent, SWT.LEFT);
164 label.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.color")); //$NON-NLS-1$
165 GridData gd = new GridData();
166 gd.horizontalAlignment = GridData.BEGINNING;
167 label.setLayoutData(gd);
168 // final ColorEditor syntaxBackgroundColorEditor = new ColorEditor(parent);
169 // RGB rgb = PreferenceConverter.getColor(OverlayStore, IPreferenceConstants.PHP_EDITOR_BACKGROUND);
170 // syntaxBackgroundColorEditor.setColorValue(rgb);
171 // Button backgroundColorButton = syntaxBackgroundColorEditor.getButton();
172 // gd = new GridData(GridData.FILL_HORIZONTAL);
173 // gd.horizontalAlignment = GridData.BEGINNING;
174 // backgroundColorButton.setLayoutData(gd);
175 // backgroundColorButton.addSelectionListener(new SelectionListener() {
176 // public void widgetDefaultSelected(SelectionEvent e) {
179 // public void widgetSelected(SelectionEvent e) {
180 // PreferenceConverter.setValue(OverlayStore, IPreferenceConstants.PHP_EDITOR_BACKGROUND, syntaxBackgroundColorEditor.getColorValue());
186 * Create the group of options for the syntax parameters.
187 * @param parent the parent component
190 private Control createSyntaxPage(Composite parent) {
192 Composite colorComposite = new Composite(parent, SWT.NULL);
193 colorComposite.setLayout(new GridLayout());
195 Label label = new Label(colorComposite, SWT.LEFT);
196 label.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.syntax")); //$NON-NLS-1$
197 label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
199 Composite editorComposite = new Composite(colorComposite, SWT.NONE);
200 GridLayout layout = new GridLayout();
201 layout.numColumns = 2;
202 layout.marginHeight = 0;
203 layout.marginWidth = 0;
204 editorComposite.setLayout(layout);
205 GridData gd = new GridData(GridData.FILL_BOTH);
206 editorComposite.setLayoutData(gd);
208 SyntaxColorList = new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
209 gd = new GridData(GridData.FILL_BOTH);
210 gd.heightHint = convertHeightInCharsToPixels(5);
211 SyntaxColorList.setLayoutData(gd);
213 Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
214 layout = new GridLayout();
215 layout.marginHeight = 0;
216 layout.marginWidth = 0;
217 layout.numColumns = 2;
218 stylesComposite.setLayout(layout);
219 stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
221 label = new Label(stylesComposite, SWT.LEFT);
222 label.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.color")); //$NON-NLS-1$
224 gd.horizontalAlignment = GridData.BEGINNING;
225 label.setLayoutData(gd);
227 SyntaxForegroundColorEditor = new ColorEditor(stylesComposite);
228 Button foregroundColorButton = SyntaxForegroundColorEditor.getButton();
229 gd = new GridData(GridData.FILL_HORIZONTAL);
230 gd.horizontalAlignment = GridData.BEGINNING;
231 foregroundColorButton.setLayoutData(gd);
233 BoldCheckBox = new Button(stylesComposite, SWT.CHECK);
234 BoldCheckBox.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.bold")); //$NON-NLS-1$
235 gd = new GridData(GridData.FILL_HORIZONTAL);
236 gd.horizontalAlignment = GridData.BEGINNING;
237 gd.horizontalSpan = 2;
238 BoldCheckBox.setLayoutData(gd);
240 ItalicCheckBox = new Button(stylesComposite, SWT.CHECK);
241 ItalicCheckBox.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.italic")); //$NON-NLS-1$
242 ItalicCheckBox.setEnabled(false);
243 gd = new GridData(GridData.FILL_HORIZONTAL);
244 gd.horizontalAlignment = GridData.BEGINNING;
245 gd.horizontalSpan = 2;
246 ItalicCheckBox.setLayoutData(gd);
248 UnderlineCheckBox = new Button(stylesComposite, SWT.CHECK);
249 UnderlineCheckBox.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.underline")); //$NON-NLS-1$
250 UnderlineCheckBox.setEnabled(false);
251 gd = new GridData(GridData.FILL_HORIZONTAL);
252 gd.horizontalAlignment = GridData.BEGINNING;
253 gd.horizontalSpan = 2;
254 UnderlineCheckBox.setLayoutData(gd);
256 Composite customSyntaxComposite = new Composite(colorComposite, SWT.NONE);
257 layout = new GridLayout();
258 layout.marginHeight = 0;
259 layout.marginWidth = 0;
260 layout.numColumns = 3;
261 stylesComposite.setLayout(layout);
262 stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
264 userdefPHPSyntaxFileFFE =
266 IPreferenceConstants.PHP_USERDEF_XMLFILE,
267 PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.syntaxdialog"),
269 userdefPHPSyntaxFileFFE.setPreferencePage(this);
270 userdefPHPSyntaxFileFFE.setPreferenceStore(getPreferenceStore());
271 userdefPHPSyntaxFileFFE.load();
273 SyntaxColorList.addSelectionListener(new SelectionListener() {
274 public void widgetDefaultSelected(SelectionEvent e) {
277 public void widgetSelected(SelectionEvent e) {
278 handleSyntaxColorListSelection();
282 foregroundColorButton.addSelectionListener(new SelectionListener() {
283 public void widgetDefaultSelected(SelectionEvent e) {
286 public void widgetSelected(SelectionEvent e) {
287 int i = SyntaxColorList.getSelectionIndex();
288 String key = SyntaxColorListModel[i][1];
290 PreferenceConverter.setValue(OverlayStore, key, SyntaxForegroundColorEditor.getColorValue());
293 BoldCheckBox.addSelectionListener(new SelectionListener() {
294 public void widgetDefaultSelected(SelectionEvent e) {
297 public void widgetSelected(SelectionEvent e) {
298 int i = SyntaxColorList.getSelectionIndex();
299 String key = SyntaxColorListModel[i][1];
300 OverlayStore.setValue(key + "_bold", BoldCheckBox.getSelection());
304 ItalicCheckBox.addSelectionListener(new SelectionListener() {
305 public void widgetDefaultSelected(SelectionEvent e) {
308 public void widgetSelected(SelectionEvent e) {
309 int i = SyntaxColorList.getSelectionIndex();
310 String key = SyntaxColorListModel[i][1];
311 OverlayStore.setValue(key + "_italic", ItalicCheckBox.getSelection());
315 UnderlineCheckBox.addSelectionListener(new SelectionListener() {
316 public void widgetDefaultSelected(SelectionEvent e) {
319 public void widgetSelected(SelectionEvent e) {
320 int i = SyntaxColorList.getSelectionIndex();
321 String key = SyntaxColorListModel[i][1];
322 OverlayStore.setValue(key + "_underline", UnderlineCheckBox.getSelection());
325 return colorComposite;
328 private void initializeViewerColors(ISourceViewer viewer) {
330 IPreferenceStore store = OverlayStore;
333 StyledText styledText = viewer.getTextWidget();
337 private Color createColor(IPreferenceStore store, String key, Display display) {
339 if (store.contains(key)) {
340 if (store.isDefault(key))
341 rgb = PreferenceConverter.getDefaultColor(store, key);
343 rgb = PreferenceConverter.getColor(store, key);
345 return new Color(display, rgb);
350 private static void setEnabled(Control control, boolean enable) {
351 control.setEnabled(enable);
352 if (control instanceof Composite) {
353 Composite composite = (Composite) control;
354 Control[] children = composite.getChildren();
355 for (int i = 0; i < children.length; i++)
356 setEnabled(children[i], enable);
360 private static void indent(Control control) {
361 GridData gridData = new GridData();
362 gridData.horizontalIndent = 20;
363 control.setLayoutData(gridData);
366 private static void createDependency(final Button master, final Control slave) {
368 master.addSelectionListener(new SelectionListener() {
369 public void widgetSelected(SelectionEvent e) {
370 slave.setEnabled(master.getSelection());
373 public void widgetDefaultSelected(SelectionEvent e) {
378 protected Control createContents(Composite parent) {
380 OverlayStore.start();
381 //Create overall composite
382 Composite composite = new Composite(parent, SWT.NONE);
383 GridLayout layout = new GridLayout();
384 layout.marginHeight = 0;
385 layout.marginWidth = 0;
386 composite.setLayout(layout);
387 Composite syntaxComposite = new Composite(composite, SWT.NULL);
388 syntaxComposite.setLayout(new GridLayout());
389 layout = new GridLayout();
390 layout.numColumns = 3;
391 Group syntaxGroup = new Group(syntaxComposite, SWT.NONE);
392 syntaxGroup.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.foreground"));
393 syntaxGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
394 syntaxGroup.setLayout(layout);
395 createSyntaxPage(syntaxGroup);
397 Composite backgroundOptions = new Composite(composite,SWT.NULL);
398 backgroundOptions.setLayout(new GridLayout());
399 layout = new GridLayout();
400 layout.numColumns = 3;
401 Group backgroundOptionsGroup = new Group(backgroundOptions,SWT.NONE);
402 backgroundOptionsGroup.setText(PHPPreferencesMessages.getString("PHPEditorSyntaxPreferencePage.background"));
403 backgroundOptionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
404 backgroundOptionsGroup.setLayout(layout);
405 backgroundOptionPage(backgroundOptionsGroup);
410 // showLineNumber = new BooleanFieldEditor(PHPeclipsePlugin.LINE_NUMBER_RULER,
411 // "Show line numbers", composite);
412 // showLineNumber.setPreferencePage(this);
413 // showLineNumber.setPreferenceStore(getPreferenceStore());
414 // showLineNumber.load();
416 // formatterTabSize = new IntegerFieldEditor(PHPeclipsePlugin.FORMATTER_TAB_SIZE,
417 // "Displayed tab width", composite, 3);
418 // formatterTabSize.setPreferencePage(this);
419 // formatterTabSize.setPreferenceStore(getPreferenceStore());
420 // formatterTabSize.load();
422 // spacesForTabs = new BooleanFieldEditor(PHPeclipsePlugin.SPACES_FOR_TABS,
423 // "Spaces for Tabs", composite);
424 // spacesForTabs.setPreferencePage(this);
425 // spacesForTabs.setPreferenceStore(getPreferenceStore());
426 // spacesForTabs.load();
430 private void initialize() {
432 for (int i = 0; i < SyntaxColorListModel.length; i++)
433 SyntaxColorList.add(SyntaxColorListModel[i][0]);
434 SyntaxColorList.getDisplay().asyncExec(new Runnable() {
436 if (SyntaxColorList != null && !SyntaxColorList.isDisposed()) {
437 SyntaxColorList.select(0);
438 handleSyntaxColorListSelection();
444 private void initializeFields() {
446 Iterator e = ColorButtons.keySet().iterator();
447 while (e.hasNext()) {
448 ColorEditor c = (ColorEditor) e.next();
449 String key = (String) ColorButtons.get(c);
450 RGB rgb = PreferenceConverter.getColor(OverlayStore, key);
451 c.setColorValue(rgb);
454 e = CheckBoxes.keySet().iterator();
455 while (e.hasNext()) {
456 Button b = (Button) e.next();
457 String key = (String) CheckBoxes.get(b);
458 b.setSelection(OverlayStore.getBoolean(key));
462 public boolean performOk() {
463 OverlayStore.propagate();
464 IPreferenceStore store = getPreferenceStore();
465 PHPeclipsePlugin.getDefault().savePluginPreferences();
466 userdefPHPSyntaxFileFFE.store();
467 // showLineNumber.store();
468 // spacesForTabs.store();
469 // formatterTabSize.store();
473 protected void performDefaults() {
474 OverlayStore.loadDefaults();
476 handleSyntaxColorListSelection();
477 userdefPHPSyntaxFileFFE.loadDefault();
478 // showLineNumber.loadDefault();
479 // spacesForTabs.loadDefault();
480 // showLineNumber.loadDefault();
481 // formatterTabSize.loadDefault();
482 super.performDefaults();
485 public void dispose() {
486 if (OverlayStore != null) {
493 private Control addColorButton(Composite composite, String label, String key, int indentation) {
494 Label labelControl = new Label(composite, SWT.NONE);
495 labelControl.setText(label);
496 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
497 gd.horizontalIndent = indentation;
498 labelControl.setLayoutData(gd);
499 ColorEditor editor = new ColorEditor(composite);
500 Button button = editor.getButton();
501 button.setData(editor);
502 gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
503 button.setLayoutData(gd);
504 button.addSelectionListener(ColorButtonListener);
505 ColorButtons.put(editor, key);
509 private Button addCheckBox(Composite parent, String label, String key, int indentation) {
510 Button checkBox = new Button(parent, SWT.CHECK);
511 checkBox.setText(label);
512 GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
513 gd.horizontalIndent = indentation;
514 gd.horizontalSpan = 2;
515 checkBox.setLayoutData(gd);
516 checkBox.addSelectionListener(CheckBoxListener);
517 CheckBoxes.put(checkBox, key);
521 private void updateStatus(IStatus status) {
525 * @deprecated Inline to avoid reference to preference page
527 public static boolean indicateQuixFixableProblems() {
528 // return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_CORRECTION_INDICATION);
533 * @deprecated Inline to avoid reference to preference page
535 static public boolean synchronizeOutlineOnCursorMove() {
536 // return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE);