source: default/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/EbnfUiModule.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: 3.2 KB
Line 
1/*
2 * generated by Xtext
3 */
4package de.ugoe.cs.swe.bnftools.ui;
5
6import org.eclipse.jface.preference.IPreferenceStore;
7import org.eclipse.jface.text.IAutoEditStrategy;
8import org.eclipse.ui.plugin.AbstractUIPlugin;
9import org.eclipse.xtext.conversion.IValueConverterService;
10import org.eclipse.xtext.ui.editor.outline.transformer.ISemanticModelTransformer;
11import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfiguration;
12import org.eclipse.xtext.ui.editor.syntaxcoloring.ISemanticHighlightingCalculator;
13import org.eclipse.xtext.ui.editor.syntaxcoloring.antlr.DefaultAntlrTokenToAttributeIdMapper;
14import com.google.inject.Binder;
15
16import de.ugoe.cs.swe.bnftools.ui.autoedit.EbnfAutoEditStrategy;
17import de.ugoe.cs.swe.bnftools.ui.outline.EbnfTransformer;
18import de.ugoe.cs.swe.bnftools.ui.syntaxcoloring.EtsiBnfAntlrTokenToAttributeMapper;
19import de.ugoe.cs.swe.bnftools.ui.syntaxcoloring.EtsiBnfHighlightingConfiguration;
20import de.ugoe.cs.swe.bnftools.ui.syntaxcoloring.EtsiBnfSemanticHighlightingCalculator;
21import de.ugoe.cs.swe.bnftools.validation.EbnfJavaValidator;
22import de.ugoe.cs.swe.bnftools.valueconverter.EbnfTerminalConverters;
23
24/**
25 * Use this class to register components to be used within the IDE.
26 */
27public class EbnfUiModule extends de.ugoe.cs.swe.bnftools.ui.AbstractEbnfUiModule {
28        public EbnfUiModule(AbstractUIPlugin plugin) {
29                super(plugin);
30                EbnfUiModule.updateValidatorSettings();
31        }
32       
33    public static void updateValidatorSettings() {
34        IPreferenceStore preferenceStore = de.ugoe.cs.swe.bnftools.ui.internal.EbnfActivator.getInstance().getPreferenceStore();
35        EbnfJavaValidator.checkReferencedOnlyOnce = preferenceStore.getBoolean("RULE_REFERENCED_ONLY_ONCE");
36        EbnfJavaValidator.checkPassthroughRule = preferenceStore.getBoolean("PASSTHROUGH_RULE");
37        EbnfJavaValidator.checkUnusedRule = preferenceStore.getBoolean("UNUSED_RULE");
38        EbnfJavaValidator.checkEqualAlternative = preferenceStore.getBoolean("EQUAL_ALTERNATIVES_RULE");
39        EbnfJavaValidator.checkDuplicateRules = preferenceStore.getBoolean("CHECK_DUPLICATE_RULES");
40        EbnfJavaValidator.checkSubruleDuplicates = preferenceStore.getBoolean("CHECK_SUBRULE_DUPLICATES");
41        EbnfJavaValidator.checkUpdatedGrammarConsistency = preferenceStore.getBoolean("CHECK_UPDATED_GRAMMAR_CONSISTENCY");
42    }
43       
44        @Override
45        public void configure(Binder binder) {
46                super.configure(binder);
47//              configureIResourceDescriptionsBuilderScope(binder);
48//              configureIResourceDescriptions(binder);
49        }
50       
51        public Class<? extends IHighlightingConfiguration> bindIHighlightingConfiguration() {
52                return EtsiBnfHighlightingConfiguration.class;
53        }
54
55        public Class<? extends DefaultAntlrTokenToAttributeIdMapper> bindTokenToAttributeIdMapper() {
56                return EtsiBnfAntlrTokenToAttributeMapper.class;
57        }
58
59        public Class<? extends ISemanticHighlightingCalculator> bindISemanticHighlightingCalculator() {
60                return EtsiBnfSemanticHighlightingCalculator.class;
61        }
62
63        public Class<? extends ISemanticModelTransformer> bindISemanticModelTransformer() {
64                return EbnfTransformer.class;
65        }
66       
67        public Class<? extends IAutoEditStrategy> bindIAutoEditStrategy() {
68                return EbnfAutoEditStrategy.class;
69        }
70       
71        public Class<? extends IValueConverterService> bindIValueConverterService() {
72          return EbnfTerminalConverters.class;
73        }
74
75}
Note: See TracBrowser for help on using the repository browser.