diff options
author | 2018-02-01 14:29:16 +0100 | |
---|---|---|
committer | 2018-02-01 14:29:16 +0100 | |
commit | 94107f140402b3d63f17b3c4727b3cc8c3752082 (patch) | |
tree | 71f73dace064335609466f57566314cab433f295 /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | |
parent | Type coloring (diff) | |
download | VIATRA-Generator-94107f140402b3d63f17b3c4727b3cc8c3752082.tar.gz VIATRA-Generator-94107f140402b3d63f17b3c4727b3cc8c3752082.tar.zst VIATRA-Generator-94107f140402b3d63f17b3c4727b3cc8c3752082.zip |
Eclass trace notation changed from "[X]" to "<X>".
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend index ea0e8d1e..8973e7cf 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/scoping/ApplicationConfigurationScopeProvider.xtend | |||
@@ -3,25 +3,27 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.application.scoping | 4 | package hu.bme.mit.inf.dslreasoner.application.scoping |
5 | 5 | ||
6 | import org.eclipse.emf.ecore.EObject | 6 | import com.google.common.base.Function |
7 | import org.eclipse.emf.ecore.EReference | 7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPackageEntry |
8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement | 8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPatternEntry |
9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage | 9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ApplicationConfigurationPackage |
10 | import org.eclipse.xtext.EcoreUtil2 | 10 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ClassReference |
11 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | 11 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript |
12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport | 12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport |
13 | import org.eclipse.xtext.scoping.Scopes | 13 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelElement |
14 | import org.eclipse.emf.ecore.EClass | ||
15 | import org.eclipse.emf.ecore.EEnum | ||
16 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelSpecification | 14 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.MetamodelSpecification |
17 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPackageEntry | ||
18 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternElement | 15 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternElement |
19 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.AllPatternEntry | ||
20 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternSpecification | 16 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.PatternSpecification |
21 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport | 17 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ViatraImport |
22 | import com.google.common.base.Function | 18 | import org.eclipse.emf.ecore.EClass |
19 | import org.eclipse.emf.ecore.EEnum | ||
20 | import org.eclipse.emf.ecore.EObject | ||
21 | import org.eclipse.emf.ecore.EReference | ||
23 | import org.eclipse.viatra.query.patternlanguage.patternLanguage.PatternModel | 22 | import org.eclipse.viatra.query.patternlanguage.patternLanguage.PatternModel |
23 | import org.eclipse.xtext.EcoreUtil2 | ||
24 | import org.eclipse.xtext.naming.QualifiedName | 24 | import org.eclipse.xtext.naming.QualifiedName |
25 | import org.eclipse.xtext.scoping.IScope | ||
26 | import org.eclipse.xtext.scoping.Scopes | ||
25 | 27 | ||
26 | /** | 28 | /** |
27 | * This class contains custom scoping description. | 29 | * This class contains custom scoping description. |
@@ -55,7 +57,9 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
55 | return context.scopeForPatternSpecification(reference,document) | 57 | return context.scopeForPatternSpecification(reference,document) |
56 | } else if(context instanceof AllPatternEntry) { | 58 | } else if(context instanceof AllPatternEntry) { |
57 | return context.scopeForAllPatternEntry(reference,document) | 59 | return context.scopeForAllPatternEntry(reference,document) |
58 | } else { | 60 | } else if(context instanceof ClassReference) { |
61 | return context.scopeForClassReference(reference,document) | ||
62 | }else { | ||
59 | return super.getScope(context,reference) | 63 | return super.getScope(context,reference) |
60 | } | 64 | } |
61 | } | 65 | } |
@@ -122,7 +126,17 @@ class ApplicationConfigurationScopeProvider extends AbstractApplicationConfigura | |||
122 | } | 126 | } |
123 | } | 127 | } |
124 | 128 | ||
125 | // Todo [] scope | 129 | ////////// |
130 | |||
131 | def IScope scopeForClassReference(ClassReference classReference, EReference eReference, ConfigurationScript document) { | ||
132 | if(eReference === language.metamodelEntry_Package) { | ||
133 | return Scopes.scopeFor(document.allEPackages) | ||
134 | } else if(eReference === language.metamodelElement_Classifier) { | ||
135 | Scopes.scopeFor(document.allEClassifiers) | ||
136 | } else { | ||
137 | return super.getScope(classReference,eReference) | ||
138 | } | ||
139 | } | ||
126 | 140 | ||
127 | ////////// | 141 | ////////// |
128 | 142 | ||