From b840de95d056a213cc233ee45eff162fc0668d23 Mon Sep 17 00:00:00 2001
From: Florian Hoelzl <hoelzl@fortiss.org>
Date: Tue, 15 Feb 2011 10:32:16 +0000
Subject: [PATCH] moved some classes to new kernel.ecore

---
 .../trunk/model/base.ecore                    |  8 ---
 .../trunk/model/base.genmodel                 |  9 +--
 .../trunk/META-INF/MANIFEST.MF                |  9 ++-
 .../trunk/buckminster.cspex                   | 25 +++++++
 .../trunk/model/generate-ecore.xml            | 38 ++++++++++
 .../trunk/model/kernel.ecore                  | 20 ++++++
 .../trunk/model/kernel.genmodel               | 23 ++++++
 .../trunk/plugin.properties                   |  4 ++
 org.fortiss.tooling.kernel/trunk/plugin.xml   | 17 +++++
 .../internal/navigator/NavigatorViewPart.java | 70 +++++++++++++++++++
 10 files changed, 206 insertions(+), 17 deletions(-)
 create mode 100644 org.fortiss.tooling.kernel/trunk/buckminster.cspex
 create mode 100644 org.fortiss.tooling.kernel/trunk/model/generate-ecore.xml
 create mode 100644 org.fortiss.tooling.kernel/trunk/model/kernel.ecore
 create mode 100644 org.fortiss.tooling.kernel/trunk/model/kernel.genmodel
 create mode 100644 org.fortiss.tooling.kernel/trunk/plugin.properties
 create mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java

diff --git a/org.fortiss.tooling.base/trunk/model/base.ecore b/org.fortiss.tooling.base/trunk/model/base.ecore
index e5d3fbf79..f0d1a75ae 100644
--- a/org.fortiss.tooling.base/trunk/model/base.ecore
+++ b/org.fortiss.tooling.base/trunk/model/base.ecore
@@ -3,14 +3,6 @@
     xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
     nsURI="http://www.fortiss.org/tooling/base" nsPrefix="org-fortiss-tooling-base">
-  <eClassifiers xsi:type="ecore:EClass" name="INamedElement" abstract="true" interface="true"
-      eSuperTypes="platform:/resource/org.unicase.metamodel/model/metamodel.ecore#//ModelElementId">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="INamedCommentedElement" abstract="true"
-      interface="true" eSuperTypes="#//INamedElement">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="comment" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="IHierarchicElement" abstract="true"
       interface="true" eSuperTypes="#//IHierarchicElementContainer">
     <eStructuralFeatures xsi:type="ecore:EReference" name="connections" upperBound="-1"
diff --git a/org.fortiss.tooling.base/trunk/model/base.genmodel b/org.fortiss.tooling.base/trunk/model/base.genmodel
index 5bb37512d..038c13bce 100644
--- a/org.fortiss.tooling.base/trunk/model/base.genmodel
+++ b/org.fortiss.tooling.base/trunk/model/base.genmodel
@@ -3,17 +3,10 @@
     xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
     xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.fortiss.tooling.base/generated-src"
     modelPluginID="org.fortiss.tooling.base" modelName="Base" importerID="org.eclipse.emf.importer.ecore"
-    containmentProxies="true" arrayAccessors="true" complianceLevel="6.0" copyrightFields="false"
-    usedGenPackages="platform:/plugin/org.unicase.metamodel/model/metamodel.genmodel#//metamodel">
+    containmentProxies="true" arrayAccessors="true" complianceLevel="6.0" copyrightFields="false">
   <foreignModel>base.ecore</foreignModel>
   <genPackages prefix="Base" basePackage="org.fortiss.tooling.base" disposableProviderFactory="true"
       ecorePackage="base.ecore#/">
-    <genClasses image="false" ecoreClass="base.ecore#//INamedElement">
-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute base.ecore#//INamedElement/name"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="base.ecore#//INamedCommentedElement">
-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute base.ecore#//INamedCommentedElement/comment"/>
-    </genClasses>
     <genClasses image="false" ecoreClass="base.ecore#//IHierarchicElement">
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference base.ecore#//IHierarchicElement/connections"/>
       <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference base.ecore#//IHierarchicElement/connectors"/>
diff --git a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF
index f17f91d52..882bdac3c 100644
--- a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF
+++ b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF
@@ -9,6 +9,13 @@ Require-Bundle: org.eclipse.ui;visibility:=reexport,
  org.eclipse.core.runtime;visibility:=reexport,
  org.eclipse.emf.ecore;bundle-version="2.6.1";visibility:=reexport,
  org.unicase.metamodel;bundle-version="0.0.1";visibility:=reexport,
- org.unicase.ecp.model;bundle-version="0.0.1";visibility:=reexport
+ org.unicase.ecp.model;bundle-version="0.0.1";visibility:=reexport,
+ org.conqat.ide.commons;bundle-version="2.7.0";visibility:=reexport,
+ org.conqat.ide.commons.ui;bundle-version="2.7.0";visibility:=reexport
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
+Export-Package: org.fortiss.tooling.kernel,
+ org.fortiss.tooling.kernel.interfaces,
+ org.fortiss.tooling.kernel.model,
+ org.fortiss.tooling.kernel.model.impl,
+ org.fortiss.tooling.kernel.model.util
diff --git a/org.fortiss.tooling.kernel/trunk/buckminster.cspex b/org.fortiss.tooling.kernel/trunk/buckminster.cspex
new file mode 100644
index 000000000..6e45c5ba2
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/buckminster.cspex
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cspecExtension
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0"
+	xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
+	<actions>
+		<!-- Place your Actions here -->
+		<public name="generate-ecore" actor="jdt.ant">
+            <actorProperties>
+                <property key="buildFile" value="model/generate-ecore.xml" />
+                <property key="targets" value="generate-ecore"/>
+            </actorProperties>
+            <products>
+                <path path="generated-src" />
+            </products>
+        </public>
+	</actions>
+	<alterActions>
+		<public name="eclipse.build">
+			<prerequisites>
+				<attribute name="generate-ecore"/>
+			</prerequisites>
+		</public>
+	</alterActions>
+</cspecExtension>
diff --git a/org.fortiss.tooling.kernel/trunk/model/generate-ecore.xml b/org.fortiss.tooling.kernel/trunk/model/generate-ecore.xml
new file mode 100644
index 000000000..3d1d41219
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/model/generate-ecore.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project name="org.fortiss.tooling.kernel" default="generate-ecore">
+
+	<property name="model.name" value="kernel" />
+	<property name="model.project" value="org.fortiss.tooling.kernel" />
+	<property file="bm.properties"/>
+
+    <!-- Classpath Definition -->
+    <buckminster.valuepath id="project.classpath" value="${fs:project.classpath}" />
+    <path id="classpath">
+        <path refid="project.classpath"/>
+       
+        <!-- add src to the classpath as only the bin directory is in the classpath
+             and some resources such as the workflow or properties file might not yet
+             have been copied to the bin directory -->
+        <pathelement location="src"/>
+    </path>
+   
+
+    <!-- Generation Task -->
+    <target name="generate-ecore">
+    	<emf.Ecore2Java
+    		model="model/${model.name}.ecore"
+    		genModel="model/${model.name}.genmodel" 
+    		modelProject="/${model.project}" 
+    		modelProjectFragmentPath="generated-src"
+    		reconcileGenModel="reload">
+    	</emf.Ecore2Java>
+	</target>
+	
+	<target name="clean">
+		<delete includeemptydirs="true">
+			<fileset dir="generated-src" includes="**/*"/>
+		</delete>
+		<eclipse.convertPath filesystempath="${basedir}" property="resource.basedir"/>
+		<eclipse.refreshLocal resource="${resource.basedir}" depth="infinite"/>
+	</target>
+</project> 
\ No newline at end of file
diff --git a/org.fortiss.tooling.kernel/trunk/model/kernel.ecore b/org.fortiss.tooling.kernel/trunk/model/kernel.ecore
new file mode 100644
index 000000000..78d70742f
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/model/kernel.ecore
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
+    nsURI="http://www.fortiss.org/tooling/kernel" nsPrefix="org-fortiss-tooling-kernel">
+  <eClassifiers xsi:type="ecore:EClass" name="INamedElement" abstract="true" interface="true"
+      eSuperTypes="platform:/resource/org.unicase.metamodel/model/metamodel.ecore#//ModelElementId">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="INamedCommentedElement" abstract="true"
+      interface="true" eSuperTypes="#//INamedElement">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="comment" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="IProjectRootElement" abstract="true"
+      interface="true" eSuperTypes="#//INamedCommentedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+      <details key="documentation" value="IProjectRootElement is the super class of all root elements contained in emfStore projects."/>
+    </eAnnotations>
+  </eClassifiers>
+</ecore:EPackage>
diff --git a/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel b/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel
new file mode 100644
index 000000000..4692ae432
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="(c) 2011 ForTISS GmbH"
+    modelDirectory="/org.fortiss.tooling.kernel/generated-src" editDirectory="org.fortiss.tooling.kernel.edit/src"
+    editorDirectory="/org.fortiss.tooling.kernel.editor/src" modelPluginID="org.fortiss.tooling.kernel"
+    modelName="Model" modelPluginClass="" editPluginClass="org.fortiss.tooling.kernel.model.provider.ModelEditPlugin"
+    editorPluginClass="org.fortiss.tooling.kernel.model.presentation.ModelEditorPlugin"
+    testsDirectory="/org.fortiss.tooling.kernel.tests/test-src" importerID="org.eclipse.emf.importer.ecore"
+    containmentProxies="true" arrayAccessors="true" complianceLevel="5.0" copyrightFields="false"
+    usedGenPackages="platform:/plugin/org.unicase.metamodel/model/metamodel.genmodel#//metamodel">
+  <foreignModel>kernel.ecore</foreignModel>
+  <genPackages prefix="FortissToolingKernel" basePackage="org.fortiss.tooling.kernel"
+      disposableProviderFactory="true" ecorePackage="kernel.ecore#/">
+    <genClasses image="false" ecoreClass="kernel.ecore#//INamedElement">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//INamedElement/name"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="kernel.ecore#//INamedCommentedElement">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//INamedCommentedElement/comment"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="kernel.ecore#//IProjectRootElement"/>
+  </genPackages>
+</genmodel:GenModel>
diff --git a/org.fortiss.tooling.kernel/trunk/plugin.properties b/org.fortiss.tooling.kernel/trunk/plugin.properties
new file mode 100644
index 000000000..eccaa80b4
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/plugin.properties
@@ -0,0 +1,4 @@
+# (c) 2011 ForTISS GmbH
+
+pluginName = Model Model
+providerName = www.example.org
diff --git a/org.fortiss.tooling.kernel/trunk/plugin.xml b/org.fortiss.tooling.kernel/trunk/plugin.xml
index 5535690d3..3dc449572 100644
--- a/org.fortiss.tooling.kernel/trunk/plugin.xml
+++ b/org.fortiss.tooling.kernel/trunk/plugin.xml
@@ -1,5 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.4"?>
 <plugin>
+   <extension
+         point="org.eclipse.ui.views">
+      <view
+            class="org.fortiss.tooling.kernel.internal.navigator.NavigatorViewPart"
+            id="org.fortiss.tooling.kernel.model.navigator"
+            name="Model Navigator"
+            restorable="true">
+      </view>
+   </extension>
+   <extension
+         point="org.eclipse.emf.ecore.generated_package">
+      <package
+            class="org.fortiss.tooling.kernel.model.KernelPackage"
+            genModel="model/kernel.genmodel"
+            uri="http://www.fortiss.org/tooling/kernel">
+      </package>
+   </extension>
 
 </plugin>
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java
new file mode 100644
index 000000000..da858a391
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java
@@ -0,0 +1,70 @@
+/*--------------------------------------------------------------------------+
+$Id$
+|                                                                          |
+| Copyright 2011 ForTISS GmbH                     |
+|                                                                          |
+| Licensed under the Apache License, Version 2.0 (the "License");          |
+| you may not use this file except in compliance with the License.         |
+| You may obtain a copy of the License at                                  |
+|                                                                          |
+|    http://www.apache.org/licenses/LICENSE-2.0                            |
+|                                                                          |
+| Unless required by applicable law or agreed to in writing, software      |
+| distributed under the License is distributed on an "AS IS" BASIS,        |
+| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
+| See the License for the specific language governing permissions and      |
+| limitations under the License.                                           |
++--------------------------------------------------------------------------*/
+package org.fortiss.tooling.kernel.internal.navigator;
+
+import org.conqat.ide.commons.ui.logging.LoggingUtils;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+import org.fortiss.tooling.kernel.ToolingKernelActivator;
+import org.unicase.ecp.model.ECPWorkspaceManager;
+import org.unicase.ecp.model.NoWorkspaceException;
+import org.unicase.ecp.model.workSpaceModel.ECPWorkspace;
+
+/**
+ * 
+ * @author hoelzlf
+ * @author $Author$
+ * @version $Rev$
+ * @levd.rating RED Rev:
+ */
+public final class NavigatorViewPart extends ViewPart {
+
+	/** Stores the TreeViewer. */
+	private TreeViewer viewer;
+
+	/** Stores the EmfStore workspace. */
+	private ECPWorkspace workspace;
+
+	/** Constructor. */
+	public NavigatorViewPart() {
+		try {
+			workspace = ECPWorkspaceManager.getInstance().getWorkSpace();
+		} catch (NoWorkspaceException e) {
+			LoggingUtils.log(ToolingKernelActivator.getDefault(),
+					e.getMessage(), IStatus.ERROR, e);
+			return;
+		}
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public void createPartControl(Composite parent) {
+		// TODO Auto-generated method stub
+
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public void setFocus() {
+		// TODO Auto-generated method stub
+
+	}
+
+}
-- 
GitLab