source: default/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/preferences/ValidationPreferencePage.java

Last change on this file was 5, checked in by zeiss, 14 years ago
  • Property svn:mime-type set to text/plain
File size: 1.7 KB
Line 
1package de.ugoe.cs.swe.bnftools.ui.preferences;
2
3import org.eclipse.jface.preference.BooleanFieldEditor;
4import org.eclipse.jface.preference.FieldEditorPreferencePage;
5import org.eclipse.ui.IWorkbench;
6import org.eclipse.ui.IWorkbenchPreferencePage;
7import de.ugoe.cs.swe.bnftools.ui.EbnfUiModule;
8
9public class ValidationPreferencePage extends FieldEditorPreferencePage
10                implements IWorkbenchPreferencePage {
11
12        @Override
13        protected void createFieldEditors() {
14                addField(new BooleanFieldEditor("RULE_REFERENCED_ONLY_ONCE",
15                                "&Rule referenced only once", getFieldEditorParent()));
16                addField(new BooleanFieldEditor("PASSTHROUGH_RULE",
17                                "&Passthrough rule", getFieldEditorParent()));
18                addField(new BooleanFieldEditor("UNUSED_RULE",
19                                "&Unused rule", getFieldEditorParent()));
20                addField(new BooleanFieldEditor("EQUAL_ALTERNATIVES_RULE",
21                                "&Rule with equal alternatives", getFieldEditorParent()));
22                addField(new BooleanFieldEditor("CHECK_DUPLICATE_RULES",
23                                "&Duplicate Rules", getFieldEditorParent()));
24                addField(new BooleanFieldEditor("CHECK_SUBRULE_DUPLICATES",
25                                "&Subrule Duplicates", getFieldEditorParent()));
26                addField(new BooleanFieldEditor("CHECK_UPDATED_GRAMMAR_CONSISTENCY",
27                                "&Updated Grammar Consistency (in delta grammar)", getFieldEditorParent()));
28        }
29
30        public void init(IWorkbench workbench) {
31                setPreferenceStore(de.ugoe.cs.swe.bnftools.ui.internal.EbnfActivator.getInstance().getPreferenceStore());
32                setDescription("Enable or disable validation rules");
33        }
34       
35    public boolean performOk() {
36        boolean result = super.performOk();
37                EbnfUiModule.updateValidatorSettings(); // must be updated for each new validation rule!
38        return result;
39    }
40   
41}
Note: See TracBrowser for help on using the repository browser.