Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo SBH2016-05-20 14:09:19 +0000
committerEd Willink2016-10-22 14:15:18 +0000
commit46c4c58f3626ec8d3097d7a5cbba541799ffa20e (patch)
tree59524c51603b2b8291dcdaf54e20fa1ac539ab40 /plugins
parente87313b34dae6f1a12e0e2c8eae1b0239f4686e8 (diff)
downloadorg.eclipse.qvtd-46c4c58f3626ec8d3097d7a5cbba541799ffa20e.tar.gz
org.eclipse.qvtd-46c4c58f3626ec8d3097d7a5cbba541799ffa20e.tar.xz
org.eclipse.qvtd-46c4c58f3626ec8d3097d7a5cbba541799ffa20e.zip
[cs2as] - MiniOCL projects: Initial content
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.build/src/org/eclipse/qvtd/cs2as/build/mwe/CSTracePropertyInjector.java169
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/.classpath1
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/.project6
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.resources.prefs1
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java18
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.xtend63
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/.gitignore3
-rw-r--r--plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java133
10 files changed, 328 insertions, 72 deletions
diff --git a/plugins/org.eclipse.qvtd.cs2as.build/src/org/eclipse/qvtd/cs2as/build/mwe/CSTracePropertyInjector.java b/plugins/org.eclipse.qvtd.cs2as.build/src/org/eclipse/qvtd/cs2as/build/mwe/CSTracePropertyInjector.java
index 77493b525..000700b9d 100644
--- a/plugins/org.eclipse.qvtd.cs2as.build/src/org/eclipse/qvtd/cs2as/build/mwe/CSTracePropertyInjector.java
+++ b/plugins/org.eclipse.qvtd.cs2as.build/src/org/eclipse/qvtd/cs2as/build/mwe/CSTracePropertyInjector.java
@@ -1,6 +1,8 @@
package org.eclipse.qvtd.cs2as.build.mwe;
import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.List;
import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
@@ -19,68 +21,106 @@ import org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2;
import org.eclipse.emf.mwe.core.monitor.ProgressMonitor;
import org.eclipse.emf.mwe2.runtime.Mandatory;
-// TODO ideally we could be interesting in setting the TYPE of the trace property, so we point to something more
-// specific than than an EObject
public class CSTracePropertyInjector extends AbstractWorkflowComponent2 {
- private String baseGenModelURI;
- private String targetGenModelURI;
+ public static class ASTraceInfo {
+ private String genModelURI;
+ private String traceClassName;
+
+ @Mandatory
+ public void setTargetGenModel(String genModelURI) {
+ this.genModelURI = genModelURI;
+ }
+
+ @Mandatory
+ public void setTargetTypeName(String className) {
+ this.traceClassName = className;
+ }
+ }
+
+ public static class CSTraceInfo {
+ private String baseGenModelURI;
+ private String targetGenModelURI;
+ private String traceClassName = "CSTrace";
+ private String tracePropName = "ast";
+
+ @Mandatory
+ public void setTargetGenModel(String genModelURI) {
+ this.targetGenModelURI = genModelURI;
+ }
+
+ public void setBaseGenModel(String genModelURI) {
+ this.baseGenModelURI = genModelURI;
+ }
+
+ public void setTracePropertyName(String tracePropName) {
+ this.tracePropName = tracePropName;
+ }
+
+ public void setTraceClassName(String traceClassName) {
+ this.traceClassName = traceClassName;
+ }
+ }
+
private ResourceSet rSet;
- private String tracePropName = "ast";
+
+ private CSTraceInfo csTraceInfo;
+ private ASTraceInfo asTraceType;
@Override
public void preInvoke() {
super.preInvoke();
- if (baseGenModelURI == null) {
- baseGenModelURI = targetGenModelURI;
+ if (csTraceInfo.baseGenModelURI == null) {
+ csTraceInfo.baseGenModelURI = csTraceInfo.targetGenModelURI;
}
}
@Override
protected void invokeInternal(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) {
-
- Resource targetResource = rSet.getResource(URI.createURI(targetGenModelURI), true);
- GenModel targetGenModel = (GenModel) targetResource.getContents().get(0);
- GenPackage targetGenPackage = targetGenModel.getGenPackages().get(0); // FIXME what if we have many ?
- EPackage targetEPackage = targetGenPackage.getEcorePackage();
-
- Resource baseResource = rSet.getResource(URI.createURI(baseGenModelURI), true);
- GenModel baseGenModel = (GenModel) baseResource.getContents().get(0);
- GenPackage baseGenPackage = baseGenModel.getGenPackages().get(0); // FIXME what if we have many ?
- EPackage baseEPackage = baseGenPackage.getEcorePackage();
-
- EClass traceClass = getTraceClass(baseEPackage);
- for (EClassifier eClassifier : targetEPackage.getEClassifiers()) {
- if (eClassifier instanceof EClass) {
- EClass eClass = (EClass) eClassifier;
- if (eClass.getESuperTypes().size() == 0
- && eClass != traceClass) {
- eClass.getESuperTypes().add(traceClass);
+
+ try {
+ EClass traceClass = getCSTraceClass(csTraceInfo.baseGenModelURI);
+ Resource targetResource = rSet.getResource(URI.createURI(csTraceInfo.targetGenModelURI), true);
+ GenModel targetGenModel = (GenModel) targetResource.getContents().get(0);
+ GenPackage targetGenPackage = targetGenModel.getGenPackages().get(0); // FIXME what if we have many ?
+ EPackage targetEPackage = targetGenPackage.getEcorePackage();
+
+ boolean targetChanged = false;
+ for (EClassifier eClassifier : targetEPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass) eClassifier;
+ if (eClass.getESuperTypes().size() == 0
+ && eClass != traceClass) {
+ eClass.getESuperTypes().add(traceClass);
+ targetChanged = true;
+ }
}
}
- }
-
- baseGenPackage.reconcile();
- targetGenPackage.reconcile();
-
- try {
- targetResource.save(null);
- baseResource.save(null);
- targetEPackage.eResource().save(null);
- baseEPackage.eResource().save(null);
+
+ if (targetChanged) {
+ targetEPackage.eResource().save(null);
+ targetGenModel.reconcile();
+ targetResource.save(null);
+ }
} catch(IOException e) {
issues.addError(e.getMessage());
}
-
}
- private EClass getTraceClass(EPackage ePackage) {
-
+ private EClass getCSTraceClass(String genModelURI) throws IOException {
+
+ Resource resource = rSet.getResource(URI.createURI(genModelURI), true);
+ GenModel genModel = (GenModel) resource.getContents().get(0);
+ GenPackage baseGenPackage = genModel.getGenPackages().get(0); // FIXME what if we have many ?
+ EPackage ePackage = baseGenPackage.getEcorePackage();
+
+ String traceClassName = csTraceInfo.traceClassName;
+ String tracePropName = csTraceInfo.tracePropName;
for (EClassifier eClassifier : ePackage.getEClassifiers()) {
if (eClassifier instanceof EClass) {
EClass eClass = (EClass) eClassifier;
- if ("CSTrace".equals(eClass.getName())) {
+ if (traceClassName.equals(eClass.getName())) {
for (EReference eRef : eClass.getEReferences()) {
if (tracePropName.equals(eRef.getName())) {
return eClass;
@@ -91,39 +131,62 @@ public class CSTracePropertyInjector extends AbstractWorkflowComponent2 {
}
// If not found we create it
- // FIXME solve the situation of having an already CSTrace class with no ast property
-
+ // FIXME solve the situation of having an already "traceClassName" class with no ast property
EClass traceClass = EcoreFactory.eINSTANCE.createEClass();
- traceClass.setName("CSTrace");
+ traceClass.setName(traceClassName);
traceClass.setAbstract(true);
EReference traceProp = EcoreFactory.eINSTANCE.createEReference();
traceProp.setName(tracePropName);
traceProp.setTransient(true);
- traceProp.setEType(EcorePackage.Literals.EOBJECT);
+ if (asTraceType == null) {
+ traceProp.setEType(EcorePackage.Literals.EOBJECT);
+ } else {
+ Resource asResource = rSet.getResource(URI.createURI(asTraceType.genModelURI), true);
+ GenModel asGenModel = (GenModel) asResource.getContents().get(0);
+ GenPackage asGenPackage = asGenModel.getGenPackages().get(0); // FIXME what if we have many ?
+ EPackage asEPackage = asGenPackage.getEcorePackage();
+ traceProp.setEType(getASTraceClass(asEPackage));
+ List<GenPackage> usedGenPackages = genModel.getUsedGenPackages();
+ if (!usedGenPackages.contains(asGenPackage)) {
+ usedGenPackages.add(asGenPackage);
+ }
+ }
+
traceClass.getEStructuralFeatures().add(traceProp);
ePackage.getEClassifiers().add(traceClass);
- return traceClass;
-
+
+ ePackage.eResource().save(null);
+ genModel.reconcile();
+ resource.save(null);
+ return traceClass;
+ }
+
+ private EClass getASTraceClass(EPackage ePackage) {
+ for (EClassifier eClassifier : ePackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass) eClassifier;
+ if (asTraceType.traceClassName.equals(eClass.getName())) {
+ return eClass;
+ }
+ }
+ }
+ throw new IllegalStateException(MessageFormat.format("AS class with name {0} not found in the EPackage of {1}", asTraceType.traceClassName,asTraceType.genModelURI));
}
@Mandatory
public void setResourceSet(ResourceSet rSet) {
this.rSet = rSet;
}
-
- public void setBaseGenModel(String genModelURI) {
- this.baseGenModelURI = genModelURI;
- }
@Mandatory
- public void setTargetGenModel(String genModelURI) {
- this.targetGenModelURI = genModelURI;
+ public void setCSTraceInfo(CSTraceInfo csTraceInfo) {
+ this.csTraceInfo = csTraceInfo;
}
- public void setTracePropertyName(String tracePropName) {
- this.tracePropName = tracePropName;
+ public void setASTraceType(ASTraceInfo asTraceInfo) {
+ this.asTraceType = asTraceInfo;
}
}
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.classpath b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.classpath
index 2018a8d10..1a20f94ba 100644
--- a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.classpath
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="annotationpath" value="/org.eclipse.qvtd.pivot.qvtbase/annotations"/>
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.project b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.project
index 93a14aaa6..f48f383b3 100644
--- a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.project
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.project
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -24,5 +29,6 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.resources.prefs
index 9fca336fb..4f2474d64 100644
--- a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.resources.prefs
@@ -1,2 +1,3 @@
eclipse.preferences.version=1
encoding//src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.xpt=ISO-8859-1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 000000000..5a0ad22d2
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/META-INF/MANIFEST.MF b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/META-INF/MANIFEST.MF
index 9e921f8c6..03ad0b146 100644
--- a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/META-INF/MANIFEST.MF
@@ -3,6 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: CS2AS Xtext Generator
Bundle-SymbolicName: org.eclipse.qvtd.cs2as.xtext.generator
Bundle-Version: 0.14.0.qualifier
-Require-Bundle: org.eclipse.xtext.generator;bundle-version="[2.8.1,3.0.0)"
+Require-Bundle: org.eclipse.xtext.generator;bundle-version="[2.8.1,3.0.0)",
+ com.google.inject;bundle-version="3.0.0";resolution:=optional,
+ org.eclipse.xtext;bundle-version="2.10.0"
Export-Package: org.eclipse.qvtd.cs2as.xtext.generator
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java
deleted file mode 100644
index 7bdcbca35..000000000
--- a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 Willink Transformations and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * E.D.Willink - initial API and implementation
- *******************************************************************************/
-package org.eclipse.qvtd.cs2as.xtext.generator;
-
-import org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment;
-
-public class CS2ASOutlineTreeProviderFragment extends OutlineTreeProviderFragment {
-
-
-}
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.xtend b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.xtend
new file mode 100644
index 000000000..7e97c8744
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/src/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.xtend
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.qvtd.cs2as.xtext.generator;
+
+import org.eclipse.xtext.xtext.generator.ui.outline.OutlineTreeProviderFragment2;
+import com.google.inject.Inject
+import org.eclipse.xtext.xtext.generator.model.FileAccessFactory
+import org.eclipse.xtext.Grammar
+import org.eclipse.xtext.xtext.generator.model.TypeReference
+import org.eclipse.xtext.GrammarUtil
+
+import static extension org.eclipse.xtext.xtext.generator.model.TypeReference.typeRef
+import org.eclipse.xtext.xtext.generator.XtextGeneratorNaming
+
+public class CS2ASOutlineTreeProviderFragment extends OutlineTreeProviderFragment2 {
+
+ @Inject FileAccessFactory fileAccessFactory;
+ @Inject Grammar grammar;
+
+
+ override TypeReference getOutlineTreeProviderClass(Grammar grammar) {
+ new TypeReference(GrammarUtil.getNamespace(grammar)
+ + ".ui.outline." + GrammarUtil.getSimpleName(grammar) + "CS2ASOutlineTreeProvider"
+ )
+ }
+ override generateJavaOutlineTreeProvider() {
+
+ fileAccessFactory.createJavaFile(grammar.outlineTreeProviderClass, '''
+ /**
+ * Customization of the default outline structure.
+ *
+ * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline
+ */
+ public class «grammar.outlineTreeProviderClass.simpleName» extends
+ «GrammarUtil.getNamespace(grammar)+ ".ui.outline.CS2ASOutlineTreeProvider" » {
+
+ }
+ ''').writeTo(projectConfig.eclipsePlugin.src)
+ }
+
+
+ override generateXtendOutlineTreeProvider() {
+ fileAccessFactory.createXtendFile(grammar.outlineTreeProviderClass, '''
+ /**
+ * Customization of the default outline structure.
+ *
+ * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline
+ */
+ public class «grammar.outlineTreeProviderClass.simpleName» extends
+ «GrammarUtil.getNamespace(grammar)+ ".ui.outline.CS2ASOutlineTreeProvider" » {
+
+ }
+ ''').writeTo(projectConfig.eclipsePlugin.src)
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/.gitignore b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/.gitignore
new file mode 100644
index 000000000..55bddad2d
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/.gitignore
@@ -0,0 +1,3 @@
+/.CS2ASOutlineTreeProviderFragment.java._trace
+/.CS2ASOutlineTreeProviderFragment.xtendbin
+/CS2ASOutlineTreeProviderFragment.java
diff --git a/plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java
new file mode 100644
index 000000000..ef8df88d9
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.cs2as.xtext.generator/xtend-gen/org/eclipse/qvtd/cs2as/xtext/generator/CS2ASOutlineTreeProviderFragment.java
@@ -0,0 +1,133 @@
+/**
+ * Copyright (c) 2015 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - initial API and implementation
+ */
+package org.eclipse.qvtd.cs2as.xtext.generator;
+
+import com.google.inject.Inject;
+import org.eclipse.xtend2.lib.StringConcatenationClient;
+import org.eclipse.xtext.Grammar;
+import org.eclipse.xtext.GrammarUtil;
+import org.eclipse.xtext.xtext.generator.model.FileAccessFactory;
+import org.eclipse.xtext.xtext.generator.model.IXtextGeneratorFileSystemAccess;
+import org.eclipse.xtext.xtext.generator.model.JavaFileAccess;
+import org.eclipse.xtext.xtext.generator.model.TypeReference;
+import org.eclipse.xtext.xtext.generator.model.XtendFileAccess;
+import org.eclipse.xtext.xtext.generator.model.project.IBundleProjectConfig;
+import org.eclipse.xtext.xtext.generator.model.project.IXtextProjectConfig;
+import org.eclipse.xtext.xtext.generator.ui.outline.OutlineTreeProviderFragment2;
+
+@SuppressWarnings("all")
+public class CS2ASOutlineTreeProviderFragment extends OutlineTreeProviderFragment2 {
+ @Inject
+ private FileAccessFactory fileAccessFactory;
+
+ @Inject
+ private Grammar grammar;
+
+ @Override
+ public TypeReference getOutlineTreeProviderClass(final Grammar grammar) {
+ String _namespace = GrammarUtil.getNamespace(grammar);
+ String _plus = (_namespace + ".ui.outline.");
+ String _simpleName = GrammarUtil.getSimpleName(grammar);
+ String _plus_1 = (_plus + _simpleName);
+ String _plus_2 = (_plus_1 + "CS2ASOutlineTreeProvider");
+ return new TypeReference(_plus_2);
+ }
+
+ @Override
+ public void generateJavaOutlineTreeProvider() {
+ TypeReference _outlineTreeProviderClass = this.getOutlineTreeProviderClass(this.grammar);
+ StringConcatenationClient _client = new StringConcatenationClient() {
+ @Override
+ protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* Customization of the default outline structure.");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.append("public class ");
+ TypeReference _outlineTreeProviderClass = CS2ASOutlineTreeProviderFragment.this.getOutlineTreeProviderClass(CS2ASOutlineTreeProviderFragment.this.grammar);
+ String _simpleName = _outlineTreeProviderClass.getSimpleName();
+ _builder.append(_simpleName, "");
+ _builder.append(" extends ");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ String _namespace = GrammarUtil.getNamespace(CS2ASOutlineTreeProviderFragment.this.grammar);
+ String _plus = (_namespace + ".ui.outline.CS2ASOutlineTreeProvider");
+ _builder.append(_plus, "\t");
+ _builder.append(" {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ }
+ };
+ JavaFileAccess _createJavaFile = this.fileAccessFactory.createJavaFile(_outlineTreeProviderClass, _client);
+ IXtextProjectConfig _projectConfig = this.getProjectConfig();
+ IBundleProjectConfig _eclipsePlugin = _projectConfig.getEclipsePlugin();
+ IXtextGeneratorFileSystemAccess _src = _eclipsePlugin.getSrc();
+ _createJavaFile.writeTo(_src);
+ }
+
+ @Override
+ public void generateXtendOutlineTreeProvider() {
+ TypeReference _outlineTreeProviderClass = this.getOutlineTreeProviderClass(this.grammar);
+ StringConcatenationClient _client = new StringConcatenationClient() {
+ @Override
+ protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
+ _builder.append("/**");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* Customization of the default outline structure.");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("*/");
+ _builder.newLine();
+ _builder.append("public class ");
+ TypeReference _outlineTreeProviderClass = CS2ASOutlineTreeProviderFragment.this.getOutlineTreeProviderClass(CS2ASOutlineTreeProviderFragment.this.grammar);
+ String _simpleName = _outlineTreeProviderClass.getSimpleName();
+ _builder.append(_simpleName, "");
+ _builder.append(" extends ");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ String _namespace = GrammarUtil.getNamespace(CS2ASOutlineTreeProviderFragment.this.grammar);
+ String _plus = (_namespace + ".ui.outline.CS2ASOutlineTreeProvider");
+ _builder.append(_plus, "\t");
+ _builder.append(" {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ }
+ };
+ XtendFileAccess _createXtendFile = this.fileAccessFactory.createXtendFile(_outlineTreeProviderClass, _client);
+ IXtextProjectConfig _projectConfig = this.getProjectConfig();
+ IBundleProjectConfig _eclipsePlugin = _projectConfig.getEclipsePlugin();
+ IXtextGeneratorFileSystemAccess _src = _eclipsePlugin.getSrc();
+ _createXtendFile.writeTo(_src);
+ }
+}

Back to the top