1 | /* |
---|
2 | * generated by Xtext |
---|
3 | */ |
---|
4 | package de.ugoe.cs.swe.bnftools.ui; |
---|
5 | |
---|
6 | import org.eclipse.jface.preference.IPreferenceStore; |
---|
7 | import org.eclipse.jface.text.IAutoEditStrategy; |
---|
8 | import org.eclipse.ui.plugin.AbstractUIPlugin; |
---|
9 | import org.eclipse.xtext.conversion.IValueConverterService; |
---|
10 | import org.eclipse.xtext.ui.editor.outline.transformer.ISemanticModelTransformer; |
---|
11 | import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfiguration; |
---|
12 | import org.eclipse.xtext.ui.editor.syntaxcoloring.ISemanticHighlightingCalculator; |
---|
13 | import org.eclipse.xtext.ui.editor.syntaxcoloring.antlr.DefaultAntlrTokenToAttributeIdMapper; |
---|
14 | import com.google.inject.Binder; |
---|
15 | |
---|
16 | import de.ugoe.cs.swe.bnftools.ui.autoedit.EbnfAutoEditStrategy; |
---|
17 | import de.ugoe.cs.swe.bnftools.ui.outline.EbnfTransformer; |
---|
18 | import de.ugoe.cs.swe.bnftools.ui.syntaxcoloring.EtsiBnfAntlrTokenToAttributeMapper; |
---|
19 | import de.ugoe.cs.swe.bnftools.ui.syntaxcoloring.EtsiBnfHighlightingConfiguration; |
---|
20 | import de.ugoe.cs.swe.bnftools.ui.syntaxcoloring.EtsiBnfSemanticHighlightingCalculator; |
---|
21 | import de.ugoe.cs.swe.bnftools.validation.EbnfJavaValidator; |
---|
22 | import de.ugoe.cs.swe.bnftools.valueconverter.EbnfTerminalConverters; |
---|
23 | |
---|
24 | /** |
---|
25 | * Use this class to register components to be used within the IDE. |
---|
26 | */ |
---|
27 | public 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 | } |
---|