aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormclay2009-02-05 01:39:23 (EST)
committersefftinge2009-02-05 01:39:23 (EST)
commit95552a3322888798d5e101b3e0d8c950b0742914 (patch)
treec561819609ec0a594b7892dbe9183449f419c769
parentd908d9434e846499c349a2bbab4b280ed0b9cc43 (diff)
downloadorg.eclipse.xtext-95552a3322888798d5e101b3e0d8c950b0742914.zip
org.eclipse.xtext-95552a3322888798d5e101b3e0d8c950b0742914.tar.gz
org.eclipse.xtext-95552a3322888798d5e101b3e0d8c950b0742914.tar.bz2
share ecoredsl.ui under org.eclipse.tmf/org.eclipse.xtext/examples
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/.classpath8
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/.project28
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF17
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/build.properties4
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/icons/editor.gifbin0 -> 556 bytes
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/plugin.xml131
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java28
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/EcoreDslUiSetup.java36
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java997
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/editor/EcoreDslEditor.java6
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/internal/EcoreDslActivator.java15
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/Activator.java208
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java46
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUIModule.java31
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/editor/outline/EcoreDslOutlinePage.java112
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreDslHandler.java68
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreHandler.java95
-rw-r--r--examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml34
19 files changed, 1876 insertions, 0 deletions
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/.classpath b/examples/org.eclipse.xtext.example.ecoredsl.ui/.classpath
new file mode 100644
index 0000000..59cf397
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/.project b/examples/org.eclipse.xtext.example.ecoredsl.ui/.project
new file mode 100644
index 0000000..b894553
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.xtext.example.ecoredsl.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.xtext.example.ecoredsl.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..94e27c4
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Tue Feb 03 21:00:48 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF b/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..e505af1
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: EcoreDsl UI Plug-in
+Bundle-SymbolicName: org.eclipse.xtext.example.ecoredsl.ui;singleton:=true
+Bundle-Version: 0.0.1
+Require-Bundle: org.eclipse.xtext.ui.core,
+ org.eclipse.xtext.ui.common,
+ org.eclipse.ui.editors;bundle-version="3.4.0",
+ org.eclipse.ui,
+ org.eclipse.core.expressions;bundle-version="3.4.0",
+ org.eclipse.jdt.core;bundle-version="3.4.0",
+ org.eclipse.emf.ecore.edit;bundle-version="2.4.0",
+ org.eclipse.xtext.example.ecoredsl;bundle-version="0.7.0"
+Bundle-Vendor: mycompany.com
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.xtext.example.Activator
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/build.properties b/examples/org.eclipse.xtext.example.ecoredsl.ui/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/icons/editor.gif b/examples/org.eclipse.xtext.example.ecoredsl.ui/icons/editor.gif
new file mode 100644
index 0000000..2a2b4b6
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/icons/editor.gif
Binary files differ
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/plugin.xml b/examples/org.eclipse.xtext.example.ecoredsl.ui/plugin.xml
new file mode 100644
index 0000000..e90cf55
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/plugin.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<plugin>
+
+<extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.xtext.example.ui.editor.EcoreDslEditor"
+ contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
+ default="true"
+ extensions="ecoredsl"
+ id="org.eclipse.xtext.example.EcoreDsl"
+ name="EcoreDsl Editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.xtext.ui.core.util.ServiceInjectingExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.preferences.LanguageRootPreferencePage/org.eclipse.xtext.example.EcoreDsl"
+ id="org.eclipse.xtext.example.EcoreDsl"
+ name="EcoreDsl">
+ <keywordReference
+ id="org.eclipse.xtext.example.ui.keyword_EcoreDsl">
+ </keywordReference>
+ </page>
+ <page
+ category="org.eclipse.xtext.example.EcoreDsl"
+ class="org.eclipse.xtext.ui.core.util.ServiceInjectingExecutableExtensionFactory:org.eclipse.xtext.ui.core.editor.preferences.EditorPreferencePage/org.eclipse.xtext.example.EcoreDsl"
+ id="org.eclipse.xtext.example.EcoreDsl.editor"
+ name="Editor">
+ <keywordReference
+ id="org.eclipse.xtext.keyword.editor">
+ </keywordReference>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.keywords">
+ <keyword
+ id="org.eclipse.xtext.example.ui.keyword_EcoreDsl"
+ label="EcoreDsl">
+ </keyword>
+ <keyword
+ id="org.eclipse.xtext.example.EcoreDsl.tasktags"
+ label="Task Tags">
+ </keyword>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors.templates">
+ <contextType name="EPackageDecl"
+ class="org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextTemplateContextType"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EPackageDecl">
+ </contextType>
+ <contextType name="EClassDecl"
+ class="org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextTemplateContextType"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EClassDecl">
+ </contextType>
+ <contextType name="EDataTypeDecl"
+ class="org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextTemplateContextType"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EDataTypeDecl">
+ </contextType>
+ <contextType name="EEnumDecl"
+ class="org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextTemplateContextType"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EEnumDecl">
+ </contextType>
+ <contextType name="EAttributeDecl"
+ class="org.eclipse.xtext.ui.common.editor.contentassist.impl.XtextTemplateContextType"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EAttributeDecl">
+ </contextType>
+ <include file="templates/templates.xml" />
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.xtext.ecore.dsl.GenerateEcore"
+ name="Generate Ecore Model"
+ description="Generate Ecore Model">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.xtext.ecore.dsl.GenerateEcoreDsl"
+ name="Generate Ecore Dsl"
+ description="Generate Ecore Dsl">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.xtext.example.handler.GenerateEcoreDslHandler"
+ commandId="org.eclipse.xtext.ecore.dsl.GenerateEcoreDsl">
+ </handler>
+ <handler
+ class="org.eclipse.xtext.example.handler.GenerateEcoreHandler"
+ commandId="org.eclipse.xtext.ecore.dsl.GenerateEcore">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <command commandId="org.eclipse.xtext.ecore.dsl.GenerateEcore">
+ <visibleWhen
+ checkEnabled="false">
+ <iterate>
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test property="org.eclipse.core.resources.name"
+ value="*.ecoredsl">
+ </test>
+ </adapt></iterate>
+ </visibleWhen>
+ </command>
+ <command commandId="org.eclipse.xtext.ecore.dsl.GenerateEcoreDsl">
+ <visibleWhen
+ checkEnabled="false">
+ <iterate>
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test property="org.eclipse.core.resources.name"
+ value="*.ecore">
+ </test>
+ </adapt></iterate>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+
+</plugin>
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java
new file mode 100644
index 0000000..d3b74ed
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/AbstractEcoreDslUiModule.java
@@ -0,0 +1,28 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.example;
+
+import org.eclipse.xtext.ui.common.service.DefaultUIModule;
+
+/**
+ * GENERATED! Manual modification goes to EcoreDslUIModule
+ */
+public abstract class AbstractEcoreDslUiModule extends DefaultUIModule {
+
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ return org.eclipse.xtext.example.GenEcoreDslProposalProvider.class;
+ }
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.ITokenColorer> bindITokenColorer() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.BuiltinAntlrTokenColorer.class;
+ }
+
+ public Class<? extends org.eclipse.jface.text.rules.ITokenScanner> bindITokenScanner() {
+ return org.eclipse.xtext.ui.common.editor.syntaxcoloring.antlr.AntlrTokenScanner.class;
+ }
+
+
+
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/EcoreDslUiSetup.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/EcoreDslUiSetup.java
new file mode 100644
index 0000000..678a335
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/EcoreDslUiSetup.java
@@ -0,0 +1,36 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.example;
+
+import org.eclipse.xtext.service.IServiceScope;
+import org.eclipse.xtext.service.ServiceRegistry;
+
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * GENERATED!
+ */
+public class EcoreDslUiSetup {
+
+ private static boolean initialized = false;
+
+ public synchronized static void doSetup() {
+ if (!initialized) {
+ org.eclipse.xtext.example.EcoreDslStandaloneSetup.doSetup();
+
+ // overwriting runtime configuration
+ Injector injector = Guice.createInjector(new org.eclipse.xtext.example.EcoreDslRuntimeModule(), new org.eclipse.xtext.example.EcoreDslUIModule());
+ ServiceRegistry.registerInjector(org.eclipse.xtext.example.IEcoreDsl.SCOPE, injector);
+
+ initialized = true;
+ }
+ }
+
+ public static IServiceScope getServiceScope() {
+ doSetup();
+ return org.eclipse.xtext.example.IEcoreDsl.SCOPE;
+ }
+
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java
new file mode 100644
index 0000000..2130c1b
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/GenEcoreDslProposalProvider.java
@@ -0,0 +1,997 @@
+/*
+Generated with Xtext
+*/
+package org.eclipse.xtext.example;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.CrossReference;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.common.editor.contentassist.impl.AbstractJavaProposalProvider;
+import org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider;
+import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
+
+/**
+ * Represents a generated, default implementation of interface {@link IProposalProvider}.
+ *
+ * @see org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider
+ */
+public class GenEcoreDslProposalProvider extends AbstractJavaProposalProvider {
+ // constants
+ private static final String UI_PLUGIN_ID = "org.eclipse.xtext.example.ecoredsl.ui";
+
+
+
+ public List<? extends ICompletionProposal> completeEcoreDsl_Imports(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcoreDsl_Imports feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcoreDsl_Package(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcoreDsl_Package feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeImportStatementDecl_Alias(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeImportStatementDecl_Alias feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "ImportStatementDecl_Alias", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeImportStatementDecl_ImportURI(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeImportStatementDecl_ImportURI feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "\"ImportStatementDecl_ImportURI\"", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEPackageDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEPackageDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEPackageDecl_NsURI(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_NsURI feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "\"EPackageDecl_NsURI\"", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEPackageDecl_NsPrefix(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_NsPrefix feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEPackageDecl_ESubpackages(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_ESubpackages feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEPackageDecl_EClassifiers(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEPackageDecl_EClassifiers feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeSubEPackageDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeSubEPackageDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "SubEPackageDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeSubEPackageDecl_ESubpackages(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_ESubpackages feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeSubEPackageDecl_EClassifiers(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeSubEPackageDecl_EClassifiers feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEDataTypeDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEDataTypeDecl_Serializable(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_Serializable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEDataTypeDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EDataTypeDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEDataTypeDecl_InstanceClassName(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEDataTypeDecl_InstanceClassName feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAnnotationDecl_Source(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAnnotationDecl_Source feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "\"EAnnotationDecl_Source\"", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEAnnotationDecl_EModelElement(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAnnotationDecl_EModelElement feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
+ }
+
+ public List<? extends ICompletionProposal> completeEAnnotationDecl_Contents(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAnnotationDecl_Contents feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEClassDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEClassDecl_Abstract(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_Abstract feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEClassDecl_Interface(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_Interface feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEClassDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EClassDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEClassDecl_ETypeParameters(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_ETypeParameters feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEClassDecl_EGenericSuperTypes(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EGenericSuperTypes feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEClassDecl_InstanceClassName(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_InstanceClassName feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEClassDecl_EStructuralFeatures(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EStructuralFeatures feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEClassDecl_EOperations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEClassDecl_EOperations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_ID(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_ID feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Unique(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Ordered(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Changeable(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Changeable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Volatile(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Volatile feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Transient(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Transient feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Unsettable(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Unsettable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Derived(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Derived feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_EGenericType(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_LowerBound(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_LowerBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_UpperBound(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_UpperBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EAttributeDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEAttributeDecl_DefaultValueLiteral(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEAttributeDecl_DefaultValueLiteral feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "\"EAttributeDecl_DefaultValueLiteral\"", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_ResolveProxies(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_ResolveProxies feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Unique(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Ordered(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Changeable(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Changeable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Volatile(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Volatile feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Transient(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Transient feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Unsettable(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Unsettable feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Derived(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Derived feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Containment(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Containment feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_EGenericType(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_LowerBound(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_LowerBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_UpperBound(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_UpperBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_EOpposite(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_EOpposite feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
+ }
+
+ public List<? extends ICompletionProposal> completeEReferenceDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEReferenceDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EReferenceDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EEnumDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumDecl_ELiterals(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumDecl_ELiterals feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumLiteralDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumLiteralDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EEnumLiteralDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumLiteralDecl_Value(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_Value feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "1", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEEnumLiteralDecl_Literal(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEEnumLiteralDecl_Literal feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "\"EEnumLiteralDecl_Literal\"", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeETypeParameterDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeETypeParameterDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "ETypeParameterDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeETypeParameterDecl_EBounds(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeETypeParameterDecl_EBounds feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEGenericTypeReferenceDecl_EClassifier(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeReferenceDecl_EClassifier feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
+ }
+
+ public List<? extends ICompletionProposal> completeEGenericTypeReferenceDecl_ETypeArguments(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeReferenceDecl_ETypeArguments feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEGenericTypeReferenceDecl_ETypeParameter(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeReferenceDecl_ETypeParameter feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
+ }
+
+ public List<? extends ICompletionProposal> completeEGenericTypeDecl_EClassifier(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_EClassifier feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
+ }
+
+ public List<? extends ICompletionProposal> completeEGenericTypeDecl_ETypeArguments(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_ETypeArguments feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEGenericTypeDecl_ETypeParameter(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_ETypeParameter feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return lookupCrossReference(((CrossReference)assignment.getTerminal()), contentAssistContext);
+ }
+
+ public List<? extends ICompletionProposal> completeEGenericTypeDecl_EUpperBound(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_EUpperBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEGenericTypeDecl_ELowerBound(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEGenericTypeDecl_ELowerBound feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_Unique(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_Unique feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_Ordered(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_Ordered feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_EGenericType(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EOperationDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_ETypeParameters(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_ETypeParameters feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_EParameters(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EParameters feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEOperationDecl_EGenericExceptions(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEOperationDecl_EGenericExceptions feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEParameterDecl_EAnnotations(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEParameterDecl_EAnnotations feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEParameterDecl_EGenericType(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEParameterDecl_EGenericType feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEParameterDecl_Name(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEParameterDecl_Name feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "EParameterDecl_Name", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeMapEntry_DetailKey(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeMapEntry_DetailKey feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "MapEntry_DetailKey", contentAssistContext));
+ }
+
+ public List<? extends ICompletionProposal> completeMapEntry_DetailValue(Assignment assignment, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeMapEntry_DetailValue feature '" + assignment.getFeature() + "' terminal '"
+ + assignment.getTerminal() + "' cardinality '" + assignment.getCardinality() + "' and prefix '"
+ + contentAssistContext.getMatchString().trim() + "'");
+ }
+ return Collections.singletonList(createCompletionProposal(assignment, "\"MapEntry_DetailValue\"", contentAssistContext));
+ }
+
+
+ public List<? extends ICompletionProposal> complete(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("complete '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEcore_EPackage(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EPackage '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEcore_EClassifier(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EClassifier '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EDataType(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EDataType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EAnnotation(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EAnnotation '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EClass(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EClass '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EStructuralFeature(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EStructuralFeature '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EAttribute(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EAttribute '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EReference(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EReference '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EEnum(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EEnum '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EEnumLiteral(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EEnumLiteral '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_ETypeParameter(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_ETypeParameter '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EGenericType(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EGenericType '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEcore_EOperation(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EOperation '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EParameter(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EParameter '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ public List<? extends ICompletionProposal> completeEcore_EObject(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EObject '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+
+ public List<? extends ICompletionProposal> completeEcore_EString(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EString '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+
+ public List<? extends ICompletionProposal> completeEcore_EInt(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("completeEcore_EInt '" + ruleCall.getRule().getName() + "' cardinality '" + ruleCall.getCardinality()
+ + "' for model '" + contentAssistContext.getModel() + "' and prefix '" + contentAssistContext.getMatchString() + "'");
+ }
+ return Collections.emptyList();
+ }
+
+ @Override
+ protected String getDefaultImageFilePath() {
+ return "icons/editor.gif";
+ }
+
+ @Override
+ protected String getPluginId() {
+ return UI_PLUGIN_ID;
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/editor/EcoreDslEditor.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/editor/EcoreDslEditor.java
new file mode 100644
index 0000000..d37dac9
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/editor/EcoreDslEditor.java
@@ -0,0 +1,6 @@
+package org.eclipse.xtext.example.ui.editor;
+
+public class EcoreDslEditor extends org.eclipse.xtext.ui.core.editor.XtextEditor {
+
+}
+ \ No newline at end of file
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/internal/EcoreDslActivator.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/internal/EcoreDslActivator.java
new file mode 100644
index 0000000..abe3451
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src-gen/org/eclipse/xtext/example/ui/internal/EcoreDslActivator.java
@@ -0,0 +1,15 @@
+package org.eclipse.xtext.example.ui.internal;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class EcoreDslActivator extends AbstractUIPlugin {
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ org.eclipse.xtext.example.EcoreDslUiSetup.doSetup();
+ }
+
+}
+ \ No newline at end of file
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/Activator.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/Activator.java
new file mode 100644
index 0000000..ae11f9e
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/Activator.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Michael Clay 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
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.example;
+
+import java.io.IOException;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.xtext.example.ui.internal.EcoreDslActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ *
+ * @author Michael Clay - Initial contribution and API
+ */
+public class Activator extends EcoreDslActivator {
+
+ Logger logger = Logger.getLogger(Activator.class);
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.xtext.ecore.dsl.ui";
+
+ private static final String RESOURCE_NAME = PLUGIN_ID + ".messages";
+
+
+ /** Key to store our templates. */
+ private static final String TEMPLATES_KEY = PLUGIN_ID + ".templates";
+
+ public static final String PREFIX = Activator.PLUGIN_ID + ".templates.contextType.";
+
+ public static final String EPACKAGE = PREFIX + "EPackageDecl";
+ public static final String ECLASS = PREFIX + "EClassDecl";
+ public static final String EDATATYPEDECL = PREFIX + "EDataTypeDecl";
+ public static final String EENUMDECL = PREFIX + "EEnumDecl";
+ public static final String EATTRIBUTEDECL = PREFIX + "EAttributeDecl";
+
+
+ public static final String[] TEMPLATES = new String[] {
+ EPACKAGE,ECLASS,EDATATYPEDECL,EENUMDECL,EATTRIBUTEDECL
+
+ };
+ // The shared instance
+ private static Activator plugin;
+
+ private ResourceBundle resourceBundle;
+ private ContextTypeRegistry contextTypeRegistry;
+ private TemplateStore templateStore;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ try {
+ resourceBundle = ResourceBundle.getBundle(RESOURCE_NAME);
+ } catch (MissingResourceException e) {
+ resourceBundle = null;
+ }
+
+ }
+
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ setDefault(this);
+ logger.debug("Starting ecoredsl.ui activator: " + this.getClass().getName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ setDefault(null);
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ private static void setDefault(Activator activator) {
+ plugin = activator;
+ }
+
+ /**
+ * Returns the template context type registry for the Ecore-Dsl editor.
+ *
+ * @return the template context type registry for the Ecore-Dsl editor
+ */
+ public ContextTypeRegistry getTemplateContextRegistry() {
+ if (contextTypeRegistry == null) {
+ ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
+ for (int i = 0; i < TEMPLATES.length; i++) {
+ registry.addContextType(TEMPLATES[i]);
+ }
+ contextTypeRegistry = registry;
+ }
+ return contextTypeRegistry;
+ }
+
+ /**
+ * Returns the template store for the Ecore-Dsl editor.
+ *
+ * @return the template store for the Ecore-Dsl editor
+ */
+ public TemplateStore getTemplateStore() {
+ if (templateStore == null) {
+ templateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(),
+ TEMPLATES_KEY);
+ try {
+ templateStore.load();
+ }
+ catch (IOException e) {
+ logger.error(e);
+ }
+ }
+ return templateStore;
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ /**
+ * Writes the message to the plug-in's log
+ *
+ * @param message the text to write to the log
+ */
+ public static void log(String message, Throwable exception) {
+ IStatus status = createErrorStatus(message, exception);
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(Throwable exception) {
+ getDefault().getLog().log(createErrorStatus(
+ getResourceString("Plugin.internal_error"), exception));
+ }
+ /**
+ * Returns a new <code>IStatus</code> for this plug-in
+ */
+ public static IStatus createErrorStatus(String message,
+ Throwable exception) {
+ if (message == null) {
+ message= "";
+ }
+ return new Status(Status.ERROR, PLUGIN_ID, 0, message, exception);
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ String bundleString;
+ ResourceBundle bundle = getDefault().getResourceBundle();
+ if (bundle != null) {
+ try {
+ bundleString = bundle.getString(key);
+ } catch (MissingResourceException e) {
+ log(e);
+ bundleString = "!" + key + "!";
+ }
+ } else {
+ bundleString = "!" + key + "!";
+ }
+ return bundleString;
+ }
+
+
+}
+
+
+
+
+
+
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java
new file mode 100644
index 0000000..184f1cb
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslProposalProvider.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Michael Clay 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
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.example;
+
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.xtext.Assignment;
+import org.eclipse.xtext.Keyword;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.ui.common.editor.contentassist.IContentAssistContext;
+
+/**
+ * Adds template completion support and customizes the default behaviour of <code>GenEcoreDslProposalProvider</code>.
+ *
+ * @author Michael Clay - Initial contribution and API
+ */
+public class EcoreDslProposalProvider extends GenEcoreDslProposalProvider {
+
+ @Override
+ public Template[] getTemplates(String contextTypeId) {
+ return Activator.getDefault().getTemplateStore().getTemplates(contextTypeId);
+ }
+
+ @Override
+ public TemplateContextType getTemplateContextType(Keyword keyword, IContentAssistContext contentAssistContext) {
+ return Activator.getDefault().getTemplateContextRegistry()
+ .getContextType(Activator.PREFIX + keyword.getValue());
+ }
+
+ @Override
+ public TemplateContextType getTemplateContextType(RuleCall ruleCall, IContentAssistContext contentAssistContext) {
+ if (ruleCall.eContainer() instanceof Assignment
+ && ((Assignment) ruleCall.eContainer()).getFeature().equals("lowerBound")) {
+ return Activator.getDefault().getTemplateContextRegistry().getContextType(Activator.PREFIX + "lowerBound");
+ }
+ return Activator.getDefault().getTemplateContextRegistry().getContextType(
+ Activator.PREFIX + ruleCall.getRule().getName());
+ }
+
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUIModule.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUIModule.java
new file mode 100644
index 0000000..46ad475
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/EcoreDslUIModule.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Michael Clay 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
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.example;
+
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.xtext.example.editor.outline.EcoreDslOutlinePage;
+
+
+/**
+ * used to manually extend and modify configuration for components used within the IDE.
+ *
+ * @author Michael Clay - Initial contribution and API
+ */
+public class EcoreDslUIModule extends AbstractEcoreDslUiModule {
+
+ public Class<? extends org.eclipse.xtext.ui.common.editor.contentassist.IProposalProvider> bindIProposalProvider() {
+ return org.eclipse.xtext.example.EcoreDslProposalProvider.class;
+ }
+ public Class<? extends IContentOutlinePage> bindIContentOutlinePage() {
+ return EcoreDslOutlinePage.class;
+ }
+ public Class<? extends org.eclipse.xtext.ui.common.editor.outline.ISemanticModelTransformer> bindISemanticModelTransformer() {
+ return EcoreDslOutlinePage.EcoreSemanticModelTransformer.class;
+ }
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/editor/outline/EcoreDslOutlinePage.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/editor/outline/EcoreDslOutlinePage.java
new file mode 100644
index 0000000..472a820
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/editor/outline/EcoreDslOutlinePage.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Michael Clay 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
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.example.editor.outline;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.xtext.ui.common.editor.outline.ContentOutlineNode;
+import org.eclipse.xtext.ui.common.editor.outline.XtextContentOutlinePage;
+import org.eclipse.xtext.ui.common.editor.outline.impl.DefaultSemanticModelTransformer;
+
+/**
+ * Content outline page used to setup and adapt the existing ecore provider implementations for the ecore dsl.
+ *
+ * @author Michael Clay - Initial contribution and API
+ */
+public class EcoreDslOutlinePage extends XtextContentOutlinePage {
+
+
+ protected void xconfigureProviders() {
+ //getTreeViewer().setContentProvider(provider);
+ getTreeViewer().setLabelProvider(new AdapterFactoryLabelProvider(new EcoreItemProviderAdapterFactory() {}) {
+
+ @Override
+ public String getText(Object object) {
+ return super.getText(((ContentOutlineNodeWrapper)object).getEObject());
+ }
+ @Override
+ public Image getImage(Object object) {
+ return super.getImage(((ContentOutlineNodeWrapper)object).getEObject());
+ }
+ });
+ }
+
+ // todo: clean up hack
+ public static class EcoreSemanticModelTransformer extends DefaultSemanticModelTransformer {
+ @Override
+ public ContentOutlineNode transformSemanticModel(EObject semanticModel) {
+ ContentOutlineNode outlineModel = new ContentOutlineNode();
+ outlineModel.setLabel("Invisible Root Node");
+ ContentOutlineNodeWrapper outlineParentNode = new ContentOutlineNodeWrapper(semanticModel,outlineModel);
+ transformSemanticNode(semanticModel, outlineParentNode);
+ return outlineParentNode;
+ }
+
+ @Override
+ protected ContentOutlineNode createOutlineNode(EObject semanticNode, ContentOutlineNode outlineParentNode) {
+ ContentOutlineNode outlineNode = super.createOutlineNode(semanticNode, outlineParentNode);
+ ContentOutlineNodeWrapper contentOutlineNodeWrapper = new ContentOutlineNodeWrapper(semanticNode,outlineNode);
+ // // todo: clean up hack!
+ if (outlineParentNode != null) {
+ outlineParentNode.getChildren().remove(outlineNode);
+ outlineParentNode.getChildren().add(contentOutlineNodeWrapper);
+ }
+ return contentOutlineNodeWrapper;
+ }
+ }
+
+ static class ContentOutlineNodeWrapper extends ContentOutlineNode {
+ private ContentOutlineNode contentOutlineNode;
+ private EObject eObject;
+ /**
+ * @param object
+ * @param contentOutlineNode
+ */
+ public ContentOutlineNodeWrapper(EObject object, ContentOutlineNode contentOutlineNode) {
+ super();
+ eObject = object;
+ this.contentOutlineNode = contentOutlineNode;
+ }
+ /**
+ * @return the contentOutlineNode
+ */
+ public ContentOutlineNode getContentOutlineNode() {
+ return contentOutlineNode;
+ }
+ /**
+ * @return the eObject
+ */
+ public EObject getEObject() {
+ return eObject;
+ }
+
+ @Override
+ public List<ContentOutlineNode> getChildren() {
+ return this.contentOutlineNode.getChildren();
+ }
+
+ @Override
+ public ContentOutlineNode getParent() {
+ return this.contentOutlineNode.getParent();
+ }
+
+ public int getSelectionOffset() {
+ return this.contentOutlineNode.getSelectionOffset();
+ }
+
+ public int getSelectionLength() {
+ return this.contentOutlineNode.getSelectionLength();
+ }
+ }
+
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreDslHandler.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreDslHandler.java
new file mode 100644
index 0000000..05585a7
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreDslHandler.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Michael Clay 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
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.example.handler;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.resource.XtextResourceSet;
+/**
+ * Experimental to test the serialization from .ecore to .dsl
+ *
+ * TODO: pls clean up and doc me
+ * @author Michael Clay - Initial contribution and API
+ *
+ */
+public class GenerateEcoreDslHandler extends AbstractHandler {
+
+ @SuppressWarnings( { "unchecked" })
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ EvaluationContext applicationContext = (EvaluationContext) event.getApplicationContext();
+ List fileList = (List) applicationContext.getDefaultVariable();
+ IFile ecoreFile = (IFile) fileList.get(0);
+ ResourceSet xtextResourceSet = new ResourceSetImpl();
+ Resource ecoreResource = xtextResourceSet.getResource(URI.createFileURI(ecoreFile.getLocation().toFile()
+ .getAbsolutePath()), true);
+ EObject ecorePackage = (EObject) ecoreResource.getContents().get(0);
+
+ XtextResourceSet resourceSet = new XtextResourceSet();
+ String fileNameWithExtension = ecoreFile.getName();
+ URI fileURI = URI.createFileURI(new java.io.File(ecoreFile.getParent().getLocation().toFile(),
+ fileNameWithExtension.substring(0, fileNameWithExtension.indexOf(".")) + "_test.ecoredsl")
+ .getAbsolutePath());
+ XtextResource poResource = (XtextResource) resourceSet.createResource(fileURI);
+ poResource.getContents().add(ecorePackage);
+ try {
+ poResource.save(null);
+ ecoreFile.getParent().refreshLocal(1, new NullProgressMonitor());
+ }
+ catch (IOException e) {
+ e.printStackTrace();
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreHandler.java b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreHandler.java
new file mode 100644
index 0000000..fe1b44d
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/src/org/eclipse/xtext/example/handler/GenerateEcoreHandler.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Michael Clay 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
+ *
+ *******************************************************************************/
+package org.eclipse.xtext.example.handler;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.xtext.resource.XtextResourceSet;
+import org.eclipse.xtext.ui.core.util.JdtClasspathUriResolver;
+
+/**
+ * Execution handler used to generate an ecore model file based on an existing ecore dsl file.
+ *
+ * @author Michael Clay - Initial contribution and API
+ *
+ */
+public class GenerateEcoreHandler extends AbstractHandler {
+ // logger available to subclasses
+ protected final Logger logger = Logger.getLogger(getClass());
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IFile ecoreDslFile = getEcoreDslFileName(event);
+ EPackage ePackage = loadRootEPackage(ecoreDslFile);
+ createAndSaveNewEcoreResource(ecoreDslFile, ePackage);
+ try {
+ ecoreDslFile.getParent().refreshLocal(1, new NullProgressMonitor()); }
+ catch (CoreException e) {
+ throw new ExecutionException("Error while refreshing resource hierarcy of '"+ecoreDslFile+"'",e);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ private IFile getEcoreDslFileName(ExecutionEvent event) {
+ EvaluationContext applicationContext = (EvaluationContext) event.getApplicationContext();
+ List fileList = (List) applicationContext.getDefaultVariable();
+ return (IFile) fileList.get(0);
+ }
+
+ private EPackage loadRootEPackage(IFile ecoreDslFile) {
+ XtextResourceSet xtextResourceSet = new XtextResourceSet();
+ xtextResourceSet.setClasspathUriResolver(new JdtClasspathUriResolver());
+ xtextResourceSet.setClasspathURIContext(JavaCore.create(ecoreDslFile.getProject()));
+ Resource ecoreResource = xtextResourceSet.getResource(URI.createFileURI(ecoreDslFile.getLocation().toFile()
+ .getAbsolutePath()), true);
+ EObject ecoreDsl = (EObject) ecoreResource.getContents().get(0);
+ EList<EReference> references = ecoreDsl.eClass().getEReferences();
+ EPackage ePackage = (EPackage) ecoreDsl.eGet(references.get(1));
+ return ePackage;
+ }
+
+ private void createAndSaveNewEcoreResource(IFile ecoreDslFile, EPackage ePackage) throws ExecutionException {
+ Resource ecoreModelResource = newEcoreResource(ecoreDslFile);
+ ecoreModelResource.getContents().add(ePackage);
+ try {
+ ecoreModelResource.save(null);
+ }
+ catch (IOException e) {
+ throw new ExecutionException("Error while saving resource '"+ecoreModelResource+"'",e);
+ }
+ }
+
+ private Resource newEcoreResource(IFile ecoreDslFile) {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ String fileNameWithExtension = ecoreDslFile.getName();
+ URI fileURI = URI.createFileURI(new java.io.File(ecoreDslFile.getParent().getLocation().toFile(),
+ fileNameWithExtension.substring(0, fileNameWithExtension.indexOf(".")) + ".ecore").getAbsolutePath());
+ Resource ecoreModelResource = resourceSet.createResource(fileURI);
+ return ecoreModelResource;
+ }
+
+}
diff --git a/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml b/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml
new file mode 100644
index 0000000..5252dcb
--- /dev/null
+++ b/examples/org.eclipse.xtext.example.ecoredsl.ui/templates/templates.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates>
+ <template name="empty Package" description="template for an empty EPackage"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.EPackageDecl"
+ context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EPackageDecl"
+ enabled="true">package ${name} nsURI="${nsURI}" nsPrefix=${nsPrefix} {
+ ${cursor}
+}</template>
+ <template name="empty EClass" description="template for an empty EClass"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.EClassDecl"
+ context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EClassDecl"
+ enabled="true">class ${name} {
+ ${cursor}
+ }</template>
+ <template name="empty EDataTypeDecl" description="template for an empty EDataTypeDecl"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.EDataTypeDecl"
+ context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EDataTypeDecl"
+ enabled="true">datatype ${name} {
+ ${cursor}
+ }</template>
+ <template name="empty EEnumDecl" description="template for an empty EEnumDecl"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.EEnumDecl"
+ context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EEnumDecl"
+ enabled="true">enum ${name} {
+ ${NAME1}=${VALUE1};
+ ${NAME2}=${VALUE2};
+ ${NAME3}=${VALUE3};
+ ${cursor}
+ }</template>
+ <template name="empty EAttributeDecl" description="template for an empty EAttributeDecl"
+ id="org.eclipse.xtext.ecore.dsl.ui.templates.EAttributeDecl"
+ context="org.eclipse.xtext.ecore.dsl.ui.templates.contextType.EAttributeDecl"
+ enabled="true">attr ${state:CrossReference('EGenericTypeReferenceDecl.eClassifier')} ${name};</template>
+</templates>