Преглед на файлове

Splitted stext integration plugin

Andreas Mülder преди 10 години
родител
ревизия
303d8a5525
променени са 20 файла, в които са добавени 411 реда и са изтрити 72 реда
  1. 5 3
      plugins/org.yakindu.sct.domain.default_/META-INF/MANIFEST.MF
  2. 3 3
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/Activator.java
  3. 3 3
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/extension/DefaultDomainModuleProvider.java
  4. 34 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/AbstractExpressionsProvider.java
  5. 30 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/AbstractSTextExpressionProvider.java
  6. 8 7
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/DefaultTypeSystemModule.java
  7. 43 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/EntryRuleRuntimeModule.java
  8. 46 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/EntryRuleUIModule.java
  9. 18 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/ExpressionExpressionProvider.java
  10. 29 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/IExpressionLanguageProvider.java
  11. 17 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/StateExpressionProvider.java
  12. 17 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/StatechartExpressionProvider.java
  13. 17 0
      plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/TransitionExpressionProvider.java
  14. 50 0
      plugins/org.yakindu.sct.model.stext.ui/src/org/yakindu/sct/model/stext/ui/contentassist/EntryRuleContentAssistParser.java
  15. 39 47
      plugins/org.yakindu.sct.model.stext.ui/src/org/yakindu/sct/model/stext/ui/contentassist/STextProposalProvider.java
  16. 1 0
      plugins/org.yakindu.sct.model.stext/META-INF/MANIFEST.MF
  17. 32 0
      plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/parser/EntryRuleAntlrSTextParser.java
  18. 19 0
      plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/parser/IParserConstants.java
  19. 0 1
      plugins/org.yakindu.sct.simulation.core.sexec/META-INF/MANIFEST.MF
  20. 0 8
      releng/org.yakindu.sct.releng/pom.xml

+ 5 - 3
plugins/org.yakindu.sct.domain.default_/META-INF/MANIFEST.MF

@@ -3,15 +3,17 @@ Bundle-ManifestVersion: 2
 Bundle-Name: Default Domain
 Bundle-SymbolicName: org.yakindu.sct.domain.default_;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.yakindu.sct.domain.default_.Activator
+Bundle-Activator: org.yakindu.sct.domain.default_.DefaultDomainActivator
 Bundle-Vendor: statecharts.org
 Require-Bundle: org.eclipse.core.runtime,
  org.yakindu.sct.model.stext;bundle-version="2.4.1",
  org.yakindu.sct.domain;bundle-version="2.4.1",
- org.yakindu.sct.ui.integration.stext;bundle-version="2.4.1",
  org.yakindu.sct.simulation.core.sexec;bundle-version="2.4.1",
  org.yakindu.sct.model.sexec;bundle-version="2.4.1",
- org.yakindu.sct.simulation.core
+ org.yakindu.sct.simulation.core,
+ org.eclipse.xtext.ui,
+ org.yakindu.sct.model.stext.ui,
+ org.eclipse.xtext.ui.shared;bundle-version="2.7.2"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.yakindu.sct.domain.default_,

+ 3 - 3
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/Activator.java

@@ -3,7 +3,7 @@ package org.yakindu.sct.domain.default_;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
-public class Activator implements BundleActivator {
+public class DefaultDomainActivator implements BundleActivator {
 
 	private static BundleContext context;
 
@@ -16,7 +16,7 @@ public class Activator implements BundleActivator {
 	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
 	 */
 	public void start(BundleContext bundleContext) throws Exception {
-		Activator.context = bundleContext;
+		DefaultDomainActivator.context = bundleContext;
 	}
 
 	/*
@@ -24,7 +24,7 @@ public class Activator implements BundleActivator {
 	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
 	 */
 	public void stop(BundleContext bundleContext) throws Exception {
-		Activator.context = null;
+		DefaultDomainActivator.context = null;
 	}
 
 }

+ 3 - 3
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/extension/DefaultDomainModuleProvider.java

@@ -13,14 +13,14 @@ package org.yakindu.sct.domain.default_.extension;
 import org.yakindu.sct.domain.default_.modules.DefaultSequencerModule;
 import org.yakindu.sct.domain.default_.modules.DefaultSimulationModule;
 import org.yakindu.sct.domain.default_.modules.DefaultTypeSystemModule;
+import org.yakindu.sct.domain.default_.modules.StateExpressionProvider;
+import org.yakindu.sct.domain.default_.modules.StatechartExpressionProvider;
+import org.yakindu.sct.domain.default_.modules.TransitionExpressionProvider;
 import org.yakindu.sct.domain.extension.IDomainModuleProvider;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.stext.STextRuntimeModule;
-import org.yakindu.sct.ui.integration.stext.StateExpressionProvider;
-import org.yakindu.sct.ui.integration.stext.StatechartExpressionProvider;
-import org.yakindu.sct.ui.integration.stext.TransitionExpressionProvider;
 
 import com.google.inject.Module;
 import com.google.inject.util.Modules;

+ 34 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/AbstractExpressionsProvider.java

@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.xtext.ui.shared.SharedStateModule;
+
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+/**
+ * Base class for all {@link IExpressionLanguageProvider}s, provides caching of
+ * the Injector.
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public abstract class AbstractExpressionsProvider implements IExpressionLanguageProvider {
+
+	protected abstract Module getRuntimeModule();
+
+	protected abstract Module getUIModule();
+
+	public Module getModule() {
+		return Modules.override(Modules.override(getRuntimeModule()).with(getUIModule())).with(new SharedStateModule());
+	}
+}

+ 30 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/AbstractSTextExpressionProvider.java

@@ -0,0 +1,30 @@
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.model.stext.STextRuntimeModule;
+import org.yakindu.sct.model.stext.ui.STextUiModule;
+import org.yakindu.sct.model.stext.ui.internal.STextActivator;
+
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public abstract class AbstractSTextExpressionProvider extends AbstractExpressionsProvider implements
+		IExpressionLanguageProvider {
+
+	@Override
+	protected Module getRuntimeModule() {
+		return Modules.override(new STextRuntimeModule()).with(new EntryRuleRuntimeModule(getRule()));
+	}
+
+	protected abstract Class<? extends EObject> getRule();
+
+	@Override
+	protected Module getUIModule() {
+		return Modules.override(new STextUiModule(STextActivator.getInstance())).with(new EntryRuleUIModule(getRule()));
+	}
+}

+ 8 - 7
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/DefaultTypeSystemModule.java

@@ -1,11 +1,12 @@
 /**
- * Copyright (c) 2015 committers of YAKimport org.eclipse.xtext.service.AbstractGenericModule;
-import org.yakindu.base.types.inferrer.ITypeSystemInferrer;
-import org.yakindu.base.types.typesystem.DefaultTypeSystem;
-import org.yakindu.base.types.typesystem.ITypeSystem;
-import org.yakindu.sct.model.stext.inferrer.STextTypeInferrer;
-rs of YAKINDU - initial API and implementation
- * 
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
  */
 package org.yakindu.sct.domain.default_.modules;
 

+ 43 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/EntryRuleRuntimeModule.java

@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.parser.IParser;
+import org.eclipse.xtext.service.AbstractGenericModule;
+import org.yakindu.sct.model.stext.parser.EntryRuleAntlrSTextParser;
+
+import com.google.inject.Binder;
+import com.google.inject.name.Names;
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class EntryRuleRuntimeModule extends AbstractGenericModule {
+
+	private Class<? extends EObject> parserRule;
+
+	public EntryRuleRuntimeModule(Class<? extends EObject> parserRule) {
+		this.parserRule = parserRule;
+	}
+
+	@Override
+	public void configure(Binder binder) {
+		super.configure(binder);
+		binder.bind(String.class).annotatedWith(Names.named(EntryRuleAntlrSTextParser.ENTRY_RULE))
+				.toInstance(parserRule.getSimpleName());
+	}
+
+	public Class<? extends IParser> bindIParser() {
+		return EntryRuleAntlrSTextParser.class;
+	}
+}

+ 46 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/EntryRuleUIModule.java

@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.service.AbstractGenericModule;
+import org.eclipse.xtext.ui.editor.contentassist.antlr.IContentAssistParser;
+import org.yakindu.sct.model.stext.parser.EntryRuleAntlrSTextParser;
+import org.yakindu.sct.model.stext.ui.contentassist.EntryRuleContentAssistParser;
+
+import com.google.inject.Binder;
+import com.google.inject.name.Names;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class EntryRuleUIModule extends AbstractGenericModule {
+
+	private Class<? extends EObject> parserRule;
+
+	public EntryRuleUIModule(Class<? extends EObject> parserRule) {
+		this.parserRule = parserRule;
+	}
+
+	@Override
+	public void configure(Binder binder) {
+		super.configure(binder);
+		binder.bind(String.class).annotatedWith(Names.named(EntryRuleAntlrSTextParser.ENTRY_RULE))
+				.toInstance(parserRule.getSimpleName());
+	}
+
+	public Class<? extends IContentAssistParser> bindIContentAssistParser() {
+		return EntryRuleContentAssistParser.class;
+	}
+
+}

+ 18 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/ExpressionExpressionProvider.java

@@ -0,0 +1,18 @@
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.model.stext.stext.Guard;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class ExpressionExpressionProvider extends AbstractSTextExpressionProvider {
+
+	@Override
+	protected Class<? extends EObject> getRule() {
+		return Guard.class;
+	}
+
+}

+ 29 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/IExpressionLanguageProvider.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.domain.default_.modules;
+
+import com.google.inject.Module;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface IExpressionLanguageProvider {
+
+	public Module getModule();
+
+	public static class NullLanguageProvider implements IExpressionLanguageProvider {
+		public Module getModule() {
+			return null;
+		}
+	}
+}

+ 17 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/StateExpressionProvider.java

@@ -0,0 +1,17 @@
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.model.stext.stext.StateSpecification;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class StateExpressionProvider extends AbstractSTextExpressionProvider {
+
+	@Override
+	protected Class<? extends EObject> getRule() {
+		return StateSpecification.class;
+	}
+}

+ 17 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/StatechartExpressionProvider.java

@@ -0,0 +1,17 @@
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.model.stext.stext.StatechartSpecification;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class StatechartExpressionProvider extends AbstractSTextExpressionProvider {
+
+	@Override
+	protected Class<? extends EObject> getRule() {
+		return StatechartSpecification.class;
+	}
+}

+ 17 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/TransitionExpressionProvider.java

@@ -0,0 +1,17 @@
+package org.yakindu.sct.domain.default_.modules;
+
+import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.model.stext.stext.TransitionSpecification;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class TransitionExpressionProvider extends AbstractSTextExpressionProvider {
+
+	@Override
+	protected Class<? extends EObject> getRule() {
+		return TransitionSpecification.class;
+	}
+}

+ 50 - 0
plugins/org.yakindu.sct.model.stext.ui/src/org/yakindu/sct/model/stext/ui/contentassist/EntryRuleContentAssistParser.java

@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.model.stext.ui.contentassist;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+
+import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement;
+import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
+import org.yakindu.sct.model.stext.parser.IParserConstants;
+import org.yakindu.sct.model.stext.ui.contentassist.antlr.STextParser;
+import org.yakindu.sct.model.stext.ui.contentassist.antlr.internal.InternalSTextParser;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+
+/**
+ * 
+ * @author muelder
+ * 
+ */
+public class EntryRuleContentAssistParser extends STextParser implements IParserConstants {
+
+	@Inject(optional = true)
+	@Named(ENTRY_RULE)
+	private String entryRule;
+
+	@Override
+	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
+		if (entryRule == null)
+			return super.getFollowElements(parser);
+		try {
+			InternalSTextParser typedParser = (InternalSTextParser) parser;
+			Method method = typedParser.getClass().getMethod(ENTRY_RULE + entryRule);
+			method.invoke(typedParser);
+			return typedParser.getFollowElements();
+		} catch (Exception ex) {
+			throw new RuntimeException(ex);
+		}
+	}
+
+}

+ 39 - 47
plugins/org.yakindu.sct.model.stext.ui/src/org/yakindu/sct/model/stext/ui/contentassist/STextProposalProvider.java

@@ -15,27 +15,18 @@ import java.util.ArrayList;
 import java.util.List;
 
 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.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.xtext.EnumLiteralDeclaration;
 import org.eclipse.xtext.Keyword;
 import org.eclipse.xtext.RuleCall;
 import org.eclipse.xtext.XtextFactory;
-import org.eclipse.xtext.resource.IContainer;
-import org.eclipse.xtext.resource.IEObjectDescription;
-import org.eclipse.xtext.resource.IResourceDescription;
-import org.eclipse.xtext.resource.IResourceDescriptions;
-import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider;
 import org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal;
 import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;
 import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor;
 import org.yakindu.base.expressions.expressions.ElementReferenceExpression;
 import org.yakindu.base.expressions.expressions.FeatureCall;
 import org.yakindu.base.types.Operation;
-import org.yakindu.base.types.TypesPackage;
 import org.yakindu.sct.model.stext.services.STextGrammarAccess;
 import org.yakindu.sct.model.stext.stext.InterfaceScope;
 import org.yakindu.sct.model.stext.stext.InternalScope;
@@ -44,11 +35,8 @@ import org.yakindu.sct.model.stext.stext.StatechartSpecification;
 import org.yakindu.sct.model.stext.stext.TransitionSpecification;
 import org.yakindu.sct.model.stext.stext.VariableDefinition;
 
-import com.google.common.collect.Iterables;
 import com.google.inject.Inject;
 
-import de.itemis.xtext.utils.jface.viewers.ContextElementAdapter;
-
 /**
  * Several filters to make proposals more useful.
  * 
@@ -58,10 +46,6 @@ public class STextProposalProvider extends AbstractSTextProposalProvider {
 
 	@Inject
 	private STextGrammarAccess grammarAccess;
-	@Inject
-	private IContainer.Manager containerManager;
-	@Inject
-	private ResourceDescriptionsProvider resourceDescriptionsProvider;
 
 	/**
 	 * Validates if a keyword should be viewed by the proposal view.
@@ -93,10 +77,12 @@ public class STextProposalProvider extends AbstractSTextProposalProvider {
 		else if (contentAssistContext.getRootModel() instanceof StatechartSpecification) {
 			suppressKeywords.addAll(getKeywords(grammarAccess.getExitEventAccess().getGroup().eContents()));
 			suppressKeywords.addAll(getKeywords(grammarAccess.getEntryEventAccess().getGroup().eContents()));
-			
-//			if (!atLeastOnePackageExistsInIndex(getSctResource(contentAssistContext.getRootModel()))) {
-//				suppressKeywords.addAll(getKeywords(grammarAccess.getImportScopeAccess().getGroup().eContents()));
-//			}
+
+			// if
+			// (!atLeastOnePackageExistsInIndex(getSctResource(contentAssistContext.getRootModel())))
+			// {
+			// suppressKeywords.addAll(getKeywords(grammarAccess.getImportScopeAccess().getGroup().eContents()));
+			// }
 		}
 
 		EObject currentModel = contentAssistContext.getCurrentModel();
@@ -260,32 +246,38 @@ public class STextProposalProvider extends AbstractSTextProposalProvider {
 			return delegate.canAcceptMoreProposals();
 		}
 	}
-	
-//	private boolean atLeastOnePackageExistsInIndex(Resource res) {
-//		IResourceDescriptions resourceDescriptions = resourceDescriptionsProvider.getResourceDescriptions(res);
-//		URI uri = res.getURI();
-//		IResourceDescription resourceDescription = resourceDescriptions.getResourceDescription(uri);
-//		for (IContainer container : containerManager.getVisibleContainers(resourceDescription, resourceDescriptions)) {
-//			final Iterable<IResourceDescription> currentDescriptions = container.getResourceDescriptions();
-//			for (IResourceDescription resDesc : currentDescriptions) {
-//				Iterable<IEObjectDescription> visisblePackages = resDesc
-//						.getExportedObjectsByType(TypesPackage.Literals.PACKAGE);
-//				if (!Iterables.isEmpty(visisblePackages)) {
-//					return true;
-//				}
-//			}
-//		}
-//		return false;
-//	}
-	
-	private Resource getSctResource(EObject context) {
-		final ContextElementAdapter provider = (ContextElementAdapter) EcoreUtil.getExistingAdapter(
-				context.eResource(), ContextElementAdapter.class);
-		if (provider == null) {
-			return context.eResource();
-		} else {
-			return provider.getElement().eResource();
-		}
-	}
+
+	// private boolean atLeastOnePackageExistsInIndex(Resource res) {
+	// IResourceDescriptions resourceDescriptions =
+	// resourceDescriptionsProvider.getResourceDescriptions(res);
+	// URI uri = res.getURI();
+	// IResourceDescription resourceDescription =
+	// resourceDescriptions.getResourceDescription(uri);
+	// for (IContainer container :
+	// containerManager.getVisibleContainers(resourceDescription,
+	// resourceDescriptions)) {
+	// final Iterable<IResourceDescription> currentDescriptions =
+	// container.getResourceDescriptions();
+	// for (IResourceDescription resDesc : currentDescriptions) {
+	// Iterable<IEObjectDescription> visisblePackages = resDesc
+	// .getExportedObjectsByType(TypesPackage.Literals.PACKAGE);
+	// if (!Iterables.isEmpty(visisblePackages)) {
+	// return true;
+	// }
+	// }
+	// }
+	// return false;
+	// }
+
+	// private Resource getSctResource(EObject context) {
+	// final ContextElementAdapter provider = (ContextElementAdapter)
+	// EcoreUtil.getExistingAdapter(
+	// context.eResource(), ContextElementAdapter.class);
+	// if (provider == null) {
+	// return context.eResource();
+	// } else {
+	// return provider.getElement().eResource();
+	// }
+	// }
 
 }

+ 1 - 0
plugins/org.yakindu.sct.model.stext/META-INF/MANIFEST.MF

@@ -34,6 +34,7 @@ Export-Package: org.yakindu.sct.model.stext,
  org.yakindu.sct.model.stext.inferrer,
  org.yakindu.sct.model.stext.naming,
  org.yakindu.sct.model.stext.parseTreeConstruction,
+ org.yakindu.sct.model.stext.parser,
  org.yakindu.sct.model.stext.parser.antlr,
  org.yakindu.sct.model.stext.parser.antlr.internal,
  org.yakindu.sct.model.stext.resource,

+ 32 - 0
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/parser/EntryRuleAntlrSTextParser.java

@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.model.stext.parser;
+
+import org.yakindu.sct.model.stext.parser.antlr.STextParser;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class EntryRuleAntlrSTextParser extends STextParser implements IParserConstants {
+
+	@Inject(optional = true)
+	@Named(ENTRY_RULE)
+	private String entryRule;
+
+	@Override
+	protected String getDefaultRuleName() {
+		return entryRule != null ? entryRule : super.getDefaultRuleName();
+	}
+
+}

+ 19 - 0
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/parser/IParserConstants.java

@@ -0,0 +1,19 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.model.stext.parser;
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface IParserConstants {
+
+	public static final String ENTRY_RULE = "entryRule";
+}

+ 0 - 1
plugins/org.yakindu.sct.simulation.core.sexec/META-INF/MANIFEST.MF

@@ -15,7 +15,6 @@ Require-Bundle: org.yakindu.sct.simulation.core;bundle-version="2.1.2",
  org.eclipse.xtext.xbase.lib,
  org.yakindu.sct.commons;bundle-version="2.1.2",
  org.eclipse.emf.workspace;bundle-version="1.5.1",
- org.yakindu.sct.ui.integration.stext;bundle-version="2.1.2",
  de.itemis.xtext.utils.jface;bundle-version="2.1.2",
  org.yakindu.sct.domain;bundle-version="2.4.1"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6

+ 0 - 8
releng/org.yakindu.sct.releng/pom.xml

@@ -508,34 +508,26 @@
 		<module>../org.yakindu.sct.ui</module>
 		<module>../org.yakindu.sct.ui.editor</module>
 		<module>../org.yakindu.sct.ui.examples</module>
-		<module>../org.yakindu.sct.ui.integration.stext</module>
 		<module>../org.yakindu.sct.ui.intro</module>
 		<module>../org.yakindu.sct.ui.navigator</module>
 		<module>../org.yakindu.sct-feature</module>
 		<module>../org.yakindu.sct.test.models</module>
-
 		<module>../org.yakindu.sct.generator.c</module>
 		<module>../org.yakindu.sct.generator.c.test</module>
 		<module>../org.yakindu.sct.generator.c-feature</module>
-
 		<module>../org.yakindu.sct.generator.cpp</module>
 		<module>../org.yakindu.sct.generator.cpp.test</module>
 		<module>../org.yakindu.sct.generator.cpp-feature</module>
-
 		<module>../org.yakindu.sct.generator.java</module>
 		<module>../org.yakindu.sct.generator.java.test</module>
 		<module>../org.yakindu.sct.generator.java-feature</module>
-
 		<module>../org.yakindu.sct.refactoring</module>
 		<module>../org.yakindu.sct.refactoring.tests</module>
-
 		<module>../org.yakindu.sct.generator-feature</module>
 		<module>../org.yakindu.sct.sdk-feature</module>
 		<module>../org.yakindu.sct.test-feature</module>
-
 		<module>../org.yakindu.sct.repository</module>
 		<module>../org.yakindu.sct.repository.full</module>
-
 		<module>../org.yakindu.sct.compare</module>
 	</modules>