Procházet zdrojové kódy

Share project "org.yakindu.sct.domain.default_" into "https://svn.codespot.com/a/eclipselabs.org/yakindu"

Andreas Mülder před 10 roky
rodič
revize
984ac88d09

+ 7 - 0
plugins/org.yakindu.sct.domain.default_/.classpath

@@ -0,0 +1,7 @@
+<?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/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 28 - 0
plugins/org.yakindu.sct.domain.default_/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.domain.default_</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>

+ 7 - 0
plugins/org.yakindu.sct.domain.default_/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

+ 16 - 0
plugins/org.yakindu.sct.domain.default_/META-INF/MANIFEST.MF

@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+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-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"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Export-Package: org.yakindu.sct.domain.default_,
+ org.yakindu.sct.domain.default_.extension

+ 5 - 0
plugins/org.yakindu.sct.domain.default_/build.properties

@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

binární
plugins/org.yakindu.sct.domain.default_/icons/logo_small.png


+ 14 - 0
plugins/org.yakindu.sct.domain.default_/plugin.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+<extension
+         point="org.yakindu.sct.domain">
+      <Domain
+            description="The default domain for Yakindu Statechart Tools."
+            domainID="org.yakindu.domain.default"
+            domainModuleProvider="org.yakindu.sct.domain.default_.extension.DefaultDomainModuleProvider"
+            image="icons/logo_small.png"
+            name="Default">
+      </Domain>
+   </extension>
+</plugin>

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

@@ -0,0 +1,30 @@
+package org.yakindu.sct.domain.default_;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	private static BundleContext context;
+
+	static BundleContext getContext() {
+		return context;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext bundleContext) throws Exception {
+		Activator.context = bundleContext;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext bundleContext) throws Exception {
+		Activator.context = null;
+	}
+
+}

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

@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2015 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_.extension;
+
+import org.yakindu.sct.domain.default_.modules.DefaultTypeSystemModule;
+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.simulation.core.sexec.SimulationModule;
+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;
+
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class DefaultDomainModuleProvider implements IDomainModuleProvider {
+
+	protected Module getTypeSystemModule() {
+		return new DefaultTypeSystemModule();
+	}
+
+	@Override
+	public Module getResourceModule() {
+		return Modules.combine(new STextRuntimeModule(), getTypeSystemModule());
+	}
+
+	@Override
+	public Module getEmbeddedEditorModule(String semanticTarget) {
+		if (Statechart.class.getName().equals(semanticTarget)) {
+			return getEmbeddedStatechartEditorModule();
+		}
+		if (State.class.getName().equals(semanticTarget)) {
+			return getEmbeddedStateEditorModule();
+		}
+		if (Transition.class.getName().equals(semanticTarget)) {
+			return getEmbeddedTransitionEditorModule();
+		}
+		throw new IllegalArgumentException("Illegal semantic target " + semanticTarget);
+	}
+
+	protected Module getEmbeddedTransitionEditorModule() {
+		TransitionExpressionProvider provider = new TransitionExpressionProvider();
+		Module module = provider.getModule();
+		return Modules.combine(module, getTypeSystemModule());
+	}
+
+	protected Module getEmbeddedStateEditorModule() {
+		StateExpressionProvider provider = new StateExpressionProvider();
+		Module module = provider.getModule();
+		return Modules.combine(module, getTypeSystemModule());
+	}
+
+	protected Module getEmbeddedStatechartEditorModule() {
+		StatechartExpressionProvider provider = new StatechartExpressionProvider();
+		Module module = provider.getModule();
+		return Modules.combine(module, getTypeSystemModule());
+	}
+
+	@Override
+	public Module getSimulationModule() {
+		return new SimulationModule();
+	}
+
+}

+ 32 - 0
plugins/org.yakindu.sct.domain.default_/src/org/yakindu/sct/domain/default_/modules/DefaultTypeSystemModule.java

@@ -0,0 +1,32 @@
+/**
+ * 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
+ * 
+ */
+package org.yakindu.sct.domain.default_.modules;
+
+import 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;
+
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class DefaultTypeSystemModule extends AbstractGenericModule {
+
+	public Class<? extends ITypeSystem> bindITypeSystem() {
+		return DefaultTypeSystem.class;
+	}
+
+	public Class<? extends ITypeSystemInferrer> bindITypeSystemInferrer() {
+		return STextTypeInferrer.class;
+	}
+
+}