Sfoglia il codice sorgente

#965 provide infrastructure for extension operations and properties

Andreas Muelder 9 anni fa
parent
commit
50e9cda486

+ 7 - 0
plugins/org.yakindu.sct.domain.generic.resource/.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.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 1 - 0
plugins/org.yakindu.sct.domain.generic.resource/.gitignore

@@ -0,0 +1 @@
+/bin/

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

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.domain.generic.resource</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.generic.resource/.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.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7

+ 14 - 0
plugins/org.yakindu.sct.domain.generic.resource/META-INF/MANIFEST.MF

@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Resource
+Bundle-SymbolicName: org.yakindu.sct.domain.generic.resource;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: statecharts.org
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.yakindu.sct.domain,
+ com.google.inject,
+ org.yakindu.sct.model.stext,
+ org.yakindu.sct.model.stext.ui,
+ org.eclipse.xtext.ui
+Export-Package: org.yakindu.sct.domain.generic.resource
+Import-Package: org.eclipse.xtext.ui.shared

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

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

+ 12 - 0
plugins/org.yakindu.sct.domain.generic.resource/plugin.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+<extension
+      point="org.yakindu.sct.domain.modules">
+   <Module
+         domainID="org.yakindu.domain.default"
+         feature="org.yakindu.sct.resource"
+         moduleProvider="org.yakindu.sct.domain.generic.resource.ResourceModuleProvider">
+   </Module>
+</extension>
+</plugin>

+ 15 - 0
plugins/org.yakindu.sct.domain.generic.resource/pom.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.yakindu.sct</groupId>
+		<artifactId>org.yakindu.sct.releng</artifactId>
+		<version>2.7.1-SNAPSHOT</version>
+		<relativePath>../../releng/org.yakindu.sct.releng/pom.xml</relativePath>
+	</parent>
+	<artifactId>org.yakindu.sct.domain.generic.resource</artifactId>
+	<groupId>org.yakindu.sct.plugins</groupId>
+	<packaging>eclipse-plugin</packaging>
+</project>

+ 51 - 0
plugins/org.yakindu.sct.domain.generic.resource/src/org/yakindu/sct/domain/generic/resource/ResourceModuleProvider.java

@@ -0,0 +1,51 @@
+/** 
+ * Copyright (c) 2016 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.generic.resource;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.xtext.ui.shared.SharedStateModule;
+import org.yakindu.sct.domain.extension.IModuleProvider;
+import org.yakindu.sct.model.stext.STextRuntimeModule;
+import org.yakindu.sct.model.stext.resource.StextResource;
+import org.yakindu.sct.model.stext.ui.STextUiModule;
+import org.yakindu.sct.model.stext.ui.internal.STextActivator;
+
+import com.google.inject.Binder;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class ResourceModuleProvider implements IModuleProvider {
+
+	@Override
+	public Module getModule(String... options) {
+
+		Module module = Modules.override(getLanguageRuntimeModule())
+				.with(new STextUiModule(STextActivator.getInstance()));
+		module = Modules.override(module).with(new Module() {
+			@Override
+			public void configure(Binder binder) {
+				binder.bind(Resource.class).to(StextResource.class);
+			}
+		});
+
+		return Modules.override(module).with(new SharedStateModule());
+	}
+
+	protected Module getLanguageRuntimeModule() {
+		return new STextRuntimeModule();
+	}
+
+}