diff options
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming')
2 files changed, 28 insertions, 0 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java new file mode 100644 index 00000000..ebb7e7b4 --- /dev/null +++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java | |||
@@ -0,0 +1,13 @@ | |||
1 | package org.eclipse.viatra.solver.language.naming; | ||
2 | |||
3 | import org.eclipse.xtext.naming.IQualifiedNameConverter; | ||
4 | |||
5 | import com.google.inject.Singleton; | ||
6 | |||
7 | @Singleton | ||
8 | public class ProblemQualifiedNameConverter extends IQualifiedNameConverter.DefaultImpl { | ||
9 | @Override | ||
10 | public String getDelimiter() { | ||
11 | return "::"; | ||
12 | } | ||
13 | } | ||
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java new file mode 100644 index 00000000..81365724 --- /dev/null +++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameProvider.java | |||
@@ -0,0 +1,15 @@ | |||
1 | package org.eclipse.viatra.solver.language.naming; | ||
2 | |||
3 | import org.eclipse.viatra.solver.language.model.problem.Node; | ||
4 | import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; | ||
5 | import org.eclipse.xtext.naming.QualifiedName; | ||
6 | |||
7 | public class ProblemQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider { | ||
8 | public QualifiedName qualifiedName(Node node) { | ||
9 | String name = node.getName(); | ||
10 | if (name == null || name.isEmpty()) { | ||
11 | return null; | ||
12 | } | ||
13 | return getConverter().toQualifiedName(name); | ||
14 | } | ||
15 | } | ||