diff options
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming')
2 files changed, 0 insertions, 57 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/CftLanguageQualifiedNameProvider.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/CftLanguageQualifiedNameProvider.xtend deleted file mode 100644 index db89ebf9..00000000 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/CftLanguageQualifiedNameProvider.xtend +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.naming | ||
2 | |||
3 | import com.google.inject.Inject | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.TransformationDefinition | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.ComponentDefinition | ||
6 | import org.eclipse.emf.ecore.EObject | ||
7 | import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider | ||
8 | |||
9 | class CftLanguageQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider { | ||
10 | @Inject PackageNameProvider packageNameProvider | ||
11 | |||
12 | def qualifiedName(ComponentDefinition componentDefinition) { | ||
13 | computePackageQualifiedName(componentDefinition, componentDefinition.name) | ||
14 | } | ||
15 | |||
16 | def qualifiedName(TransformationDefinition transformationDefinition) { | ||
17 | computePackageQualifiedName(transformationDefinition, transformationDefinition.name) | ||
18 | } | ||
19 | |||
20 | private def computePackageQualifiedName(EObject eObj, String name) { | ||
21 | if (name === null) { | ||
22 | return null | ||
23 | } | ||
24 | val packageQualifier = packageNameProvider.getPackageName(eObj) | ||
25 | packageQualifier.append(name) | ||
26 | } | ||
27 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.xtend deleted file mode 100644 index a05c8138..00000000 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src/hu/bme/mit/inf/dslreasoner/faulttree/components/naming/PackageNameProvider.xtend +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.naming | ||
2 | |||
3 | import com.google.inject.Inject | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftModel | ||
5 | import org.eclipse.emf.ecore.EObject | ||
6 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor | ||
7 | import org.eclipse.xtext.EcoreUtil2 | ||
8 | import org.eclipse.xtext.naming.IQualifiedNameConverter | ||
9 | import org.eclipse.xtext.naming.QualifiedName | ||
10 | |||
11 | class PackageNameProvider { | ||
12 | val IQualifiedNameConverter qualifiedNameConverter | ||
13 | |||
14 | @FinalFieldsConstructor | ||
15 | @Inject | ||
16 | new() { | ||
17 | } | ||
18 | |||
19 | def getPackageName(EObject eObj) { | ||
20 | if (eObj === null) { | ||
21 | return QualifiedName.EMPTY | ||
22 | } | ||
23 | val pacakgeName = EcoreUtil2.getContainerOfType(eObj, CftModel)?.packageName | ||
24 | if (pacakgeName.isNullOrEmpty) { | ||
25 | QualifiedName.EMPTY | ||
26 | } else { | ||
27 | qualifiedNameConverter.toQualifiedName(pacakgeName) | ||
28 | } | ||
29 | } | ||
30 | } | ||