example generating additional models
diff --git a/javascript/tools/org.eclipse.dltk.javascript.dev-tools/META-INF/MANIFEST.MF b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/META-INF/MANIFEST.MF
index a6bdb6c..509a197 100644
--- a/javascript/tools/org.eclipse.dltk.javascript.dev-tools/META-INF/MANIFEST.MF
+++ b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DeveloperTools
-Bundle-SymbolicName: org.eclipse.dltk.javascript.dev_tools
+Bundle-SymbolicName: org.eclipse.dltk.javascript.dev_tools;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.dltk.javascript.core,
diff --git a/javascript/tools/org.eclipse.dltk.javascript.dev-tools/build.properties b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/build.properties
index 34d2e4d..e9863e2 100644
--- a/javascript/tools/org.eclipse.dltk.javascript.dev-tools/build.properties
+++ b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/build.properties
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml
diff --git a/javascript/tools/org.eclipse.dltk.javascript.dev-tools/plugin.xml b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/plugin.xml
new file mode 100644
index 0000000..3c9469b
--- /dev/null
+++ b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/plugin.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension id="ExampleModelSaver" point="org.eclipse.core.runtime.applications">
+ <application>
+ <run class="org.eclipse.dltk.javascript.developertools.ExampleModelSaver"/>
+ </application>
+ </extension>
+</plugin>
diff --git a/javascript/tools/org.eclipse.dltk.javascript.dev-tools/src/org/eclipse/dltk/javascript/developertools/ExampleModelSaver.java b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/src/org/eclipse/dltk/javascript/developertools/ExampleModelSaver.java
new file mode 100644
index 0000000..58b4fab
--- /dev/null
+++ b/javascript/tools/org.eclipse.dltk.javascript.dev-tools/src/org/eclipse/dltk/javascript/developertools/ExampleModelSaver.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010 xored software, Inc.
+ *
+ * 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:
+ * xored software, Inc. - initial API and Implementation (Alex Panchenko)
+ *******************************************************************************/
+package org.eclipse.dltk.javascript.developertools;
+
+import org.eclipse.dltk.javascript.typeinfo.model.Property;
+import org.eclipse.dltk.javascript.typeinfo.model.Type;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelFactory;
+import org.eclipse.dltk.javascript.typeinfo.model.TypeInfoModelLoader;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+
+public class ExampleModelSaver implements IApplication {
+
+ final TypeInfoModelFactory typeInfoFactory = TypeInfoModelFactory.eINSTANCE;
+
+ public Object start(IApplicationContext context) throws Exception {
+ Type stringType = TypeInfoModelLoader.getInstance().getType("String");
+ Type numberType = TypeInfoModelLoader.getInstance().getType("Number");
+ //
+ final XMIResource resource = new XMIResourceImpl();
+ final Type exampleType = typeInfoFactory.createType();
+ exampleType.setName("Example");
+ //
+ final Property id = typeInfoFactory.createProperty();
+ id.setName("id");
+ id.setType(numberType);
+ exampleType.getMembers().add(id);
+ //
+ final Property name = typeInfoFactory.createProperty();
+ name.setName("name");
+ name.setType(stringType);
+ exampleType.getMembers().add(name);
+ //
+ resource.getContents().add((EObject) exampleType);
+ resource.setEncoding("UTF-8");
+ resource.save(System.out, null);
+ return EXIT_OK;
+ }
+
+ public void stop() {
+ }
+}