diff options
author | 2021-08-03 18:42:39 +0900 | |
---|---|---|
committer | 2021-08-06 19:32:38 +0900 | |
commit | be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 (patch) | |
tree | 1f3f1a96251ac4f655c8a96fc33d5d4ee779cd06 /rba.tool.editor.endpoint/src/rba/tool/editor/endpoint/RBAModelWebSetup.xtend | |
parent | 71ca7c6cab863767ef30c8bd05b2bbfda8731cb5 (diff) |
Initial commit
Bug-AGL: SPEC-4033
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com>
Diffstat (limited to 'rba.tool.editor.endpoint/src/rba/tool/editor/endpoint/RBAModelWebSetup.xtend')
-rw-r--r-- | rba.tool.editor.endpoint/src/rba/tool/editor/endpoint/RBAModelWebSetup.xtend | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/rba.tool.editor.endpoint/src/rba/tool/editor/endpoint/RBAModelWebSetup.xtend b/rba.tool.editor.endpoint/src/rba/tool/editor/endpoint/RBAModelWebSetup.xtend new file mode 100644 index 0000000..f90e262 --- /dev/null +++ b/rba.tool.editor.endpoint/src/rba/tool/editor/endpoint/RBAModelWebSetup.xtend @@ -0,0 +1,48 @@ +/* + * generated by Xtext 2.13.0 + */ +package rba.tool.editor.endpoint + +import com.google.inject.Guice +import com.google.inject.Injector +import org.eclipse.emf.ecore.EPackage +import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor +import org.eclipse.xtext.util.Modules2 +import org.eclipse.xtext.web.server.persistence.IResourceBaseProvider +import rba.core.RBACorePackage +import rba.sound.RBASoundPackage +import rba.tool.editor.RBAModelRuntimeModule +import rba.tool.editor.RBAModelStandaloneSetup +import rba.tool.editor.ide.RBAModelIdeModule +import rba.view.RBAViewPackage + +/** + * Initialization support for running Xtext languages in web applications. + */ +@FinalFieldsConstructor +class RBAModelWebSetup extends RBAModelStandaloneSetup { + + val IResourceBaseProvider resourceBaseProvider + + override Injector createInjector() { + val runtimeModule = new RBAModelRuntimeModule() + val ideModule = new RBAModelIdeModule() + val webModule = new RBAModelWebModule(resourceBaseProvider) + return Guice.createInjector(Modules2.mixin(runtimeModule, ideModule, webModule)) + } + + override register(Injector injector) { + + if (!EPackage.Registry.INSTANCE.containsKey("http://www.denso.com/ict/rba/core")) { + EPackage.Registry.INSTANCE.put("http://www.denso.com/ict/rba/core", RBACorePackage.eINSTANCE); + } + if (!EPackage.Registry.INSTANCE.containsKey("http://www.denso.com/ict/rba/view")) { + EPackage.Registry.INSTANCE.put("http://www.denso.com/ict/rba/view", RBAViewPackage.eINSTANCE); + } + if (!EPackage.Registry.INSTANCE.containsKey("http://www.denso.com/ict/rba/sound")) { + EPackage.Registry.INSTANCE.put("http://www.denso.com/ict/rba/sound", RBASoundPackage.eINSTANCE); + } + super.register(injector) + } + +} |