From 7cac3a6ec6c37ba153b948d7c9697fe770993081 Mon Sep 17 00:00:00 2001
From: Kai Brassel <mail@khbrassel.de>
Date: Fri, 11 Dec 2020 18:41:02 +0100
Subject: [PATCH] Add projects for application and feature

---
 .../.classpath                                |   7 ++
 org.example.democatalog.application/.project  |  28 +++++
 .../Application.e4xmi                         |  51 +++++++++
 .../META-INF/MANIFEST.MF                      |  25 +++++
 .../build.properties                          |   8 ++
 .../css/default.css                           |   0
 .../icons/home.png                            | Bin 0 -> 287 bytes
 .../icons/open_in_app.png                     | Bin 0 -> 315 bytes
 .../icons/save_edit.png                       | Bin 0 -> 367 bytes
 ...rg.example.democatalog.application.product |  52 +++++++++
 .../plugin.xml                                |  18 +++
 .../application/handlers/AboutHandler.java    |  12 ++
 .../application/handlers/HandlerUtils.java    |  50 +++++++++
 .../application/handlers/NewHandler.java      |  53 +++++++++
 .../application/handlers/OpenHandler.java     |  13 +++
 .../application/handlers/QuitHandler.java     |  17 +++
 .../application/handlers/SaveHandler.java     |  21 ++++
 .../application/parts/CatalogPart.java        |  51 +++++++++
 org.example.democatalog.feature/.project      |  17 +++
 .../build.properties                          |   1 +
 org.example.democatalog.feature/feature.xml   | 105 ++++++++++++++++++
 org.example.democatalog/META-INF/MANIFEST.MF  |   2 +-
 22 files changed, 530 insertions(+), 1 deletion(-)
 create mode 100644 org.example.democatalog.application/.classpath
 create mode 100644 org.example.democatalog.application/.project
 create mode 100644 org.example.democatalog.application/Application.e4xmi
 create mode 100644 org.example.democatalog.application/META-INF/MANIFEST.MF
 create mode 100644 org.example.democatalog.application/build.properties
 create mode 100644 org.example.democatalog.application/css/default.css
 create mode 100644 org.example.democatalog.application/icons/home.png
 create mode 100644 org.example.democatalog.application/icons/open_in_app.png
 create mode 100644 org.example.democatalog.application/icons/save_edit.png
 create mode 100644 org.example.democatalog.application/org.example.democatalog.application.product
 create mode 100644 org.example.democatalog.application/plugin.xml
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/handlers/AboutHandler.java
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/handlers/HandlerUtils.java
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/handlers/NewHandler.java
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/handlers/OpenHandler.java
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/handlers/QuitHandler.java
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/handlers/SaveHandler.java
 create mode 100644 org.example.democatalog.application/src/org/example/democatalog/application/parts/CatalogPart.java
 create mode 100644 org.example.democatalog.feature/.project
 create mode 100644 org.example.democatalog.feature/build.properties
 create mode 100644 org.example.democatalog.feature/feature.xml

diff --git a/org.example.democatalog.application/.classpath b/org.example.democatalog.application/.classpath
new file mode 100644
index 0000000..f5399bf
--- /dev/null
+++ b/org.example.democatalog.application/.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-14"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.example.democatalog.application/.project b/org.example.democatalog.application/.project
new file mode 100644
index 0000000..24de419
--- /dev/null
+++ b/org.example.democatalog.application/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.example.democatalog.application</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>
diff --git a/org.example.democatalog.application/Application.e4xmi b/org.example.democatalog.application/Application.e4xmi
new file mode 100644
index 0000000..3052a28
--- /dev/null
+++ b/org.example.democatalog.application/Application.e4xmi
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_6wlLcMgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.application" bindingContexts="_6wlLecgZEeSyMNYR5xypkQ">
+  <children xsi:type="basic:TrimmedWindow" xmi:id="_6wlLccgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.window.main" label="Demo Catalog" width="500" height="400">
+    <mainMenu xmi:id="_6wlLicgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.main.menu">
+      <children xsi:type="menu:Menu" xmi:id="_6wlLisgZEeSyMNYR5xypkQ" elementId="file" label="File">
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_1aSskCQeEeuaK-RhvCx2-Q" elementId="org.example.democatalog.application.handleditem.file.new" label="New" command="_a7OMwCQeEeuaK-RhvCx2-Q"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLi8gZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handleditem.file.open" label="Open" iconURI="platform:/plugin/org.example.democatalog.application/icons/open_in_app.png" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLjMgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handleditem.save" label="Save" iconURI="platform:/plugin/org.example.democatalog.application/icons/save_edit.png" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLjcgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handleditem.quit" label="Quit" command="_6wlLfMgZEeSyMNYR5xypkQ"/>
+      </children>
+      <children xsi:type="menu:Menu" xmi:id="_6wlLjsgZEeSyMNYR5xypkQ" elementId="help" label="Help">
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_6wlLj8gZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handleditem.about" label="About" command="_6wlLhsgZEeSyMNYR5xypkQ"/>
+      </children>
+    </mainMenu>
+    <trimBars xmi:id="_6wlLlcgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.trimbar.top">
+      <children xsi:type="menu:ToolBar" xmi:id="_6wlLlsgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.main.toolbar">
+        <children xsi:type="menu:HandledToolItem" xmi:id="_-6l-ICQeEeuaK-RhvCx2-Q" elementId="org.example.democatalog.application.handleditem.trimbar.top.new" label="New" command="_a7OMwCQeEeuaK-RhvCx2-Q"/>
+        <children xsi:type="menu:HandledToolItem" xmi:id="_6wlLl8gZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handleditem.trimbar.top.open" iconURI="platform:/plugin/org.example.democatalog.application/icons/open_in_app.png" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
+        <children xsi:type="menu:HandledToolItem" xmi:id="_6wlLmMgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handleditem.trimbar.top.save" iconURI="platform:/plugin/org.example.democatalog.application/icons/save_edit.png" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
+      </children>
+    </trimBars>
+  </children>
+  <handlers xmi:id="_Yu9JgCQeEeuaK-RhvCx2-Q" elementId="org.example.democatalog.application.handler.0" contributionURI="bundleclass://org.example.democatalog.application/org.example.democatalog.application.handlers.NewHandler" command="_a7OMwCQeEeuaK-RhvCx2-Q"/>
+  <handlers xmi:id="_6wlLgcgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handler.openCommand" contributionURI="bundleclass://org.example.democatalog.application/org.example.democatalog.application.handlers.OpenHandler" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
+  <handlers xmi:id="_6wlLhMgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handler.saveCommand" contributionURI="bundleclass://org.example.democatalog.application/org.example.democatalog.application.handlers.SaveHandler" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
+  <handlers xmi:id="_6wlLh8gZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handler.aboutCommand" contributionURI="bundleclass://org.example.democatalog.application/org.example.democatalog.application.handlers.AboutHandler" command="_6wlLhsgZEeSyMNYR5xypkQ"/>
+  <handlers xmi:id="_6wlLfcgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.handler.quitCommand" contributionURI="bundleclass://org.example.democatalog.application/org.example.democatalog.application.handlers.QuitHandler" command="_6wlLfMgZEeSyMNYR5xypkQ"/>
+  <bindingTables xmi:id="_6wlLfsgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.bindingtable" bindingContext="_6wlLecgZEeSyMNYR5xypkQ">
+    <bindings xmi:id="_6wlLf8gZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.keybinding.m1q" keySequence="M1+Q" command="_6wlLfMgZEeSyMNYR5xypkQ"/>
+    <bindings xmi:id="_6wlLgsgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.keybinding.m1o" keySequence="M1+O" command="_6wlLgMgZEeSyMNYR5xypkQ"/>
+    <bindings xmi:id="_6wlLhcgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.keybinding.m1s" keySequence="M1+S" command="_6wlLg8gZEeSyMNYR5xypkQ"/>
+    <bindings xmi:id="_6wlLiMgZEeSyMNYR5xypkQ" elementId="org.example.democatalog.application.keybinding.m1a" keySequence="M1+A" command="_6wlLhsgZEeSyMNYR5xypkQ"/>
+  </bindingTables>
+  <rootContext xmi:id="_6wlLecgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
+    <children xmi:id="_6wlLesgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
+    <children xmi:id="_6wlLe8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
+  </rootContext>
+  <descriptors xmi:id="_R3oEICQEEeuaK-RhvCx2-Q" elementId="org.example.democatalog.application.partdescriptor.catalog" contributionURI="bundleclass://org.example.democatalog.application/org.example.democatalog.application.parts.CatalogPart"/>
+  <commands xmi:id="_a7OMwCQeEeuaK-RhvCx2-Q" elementId="org.eclipse.ui.file.new" commandName="newCommand"/>
+  <commands xmi:id="_6wlLgMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.open" commandName="openCommand"/>
+  <commands xmi:id="_6wlLg8gZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.save" commandName="saveCommand"/>
+  <commands xmi:id="_6wlLhsgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/>
+  <commands xmi:id="_6wlLfMgZEeSyMNYR5xypkQ" elementId="org.eclipse.ui.file.exit" commandName="quitCommand"/>
+  <addons xmi:id="_6wlLcsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
+  <addons xmi:id="_6wlLc8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
+  <addons xmi:id="_6wlLdMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
+  <addons xmi:id="_6wlLdcgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
+  <addons xmi:id="_6wlLdsgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.handler.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
+  <addons xmi:id="_6wlLd8gZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
+  <addons xmi:id="_6wlLeMgZEeSyMNYR5xypkQ" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
+</application:Application>
diff --git a/org.example.democatalog.application/META-INF/MANIFEST.MF b/org.example.democatalog.application/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f01aab8
--- /dev/null
+++ b/org.example.democatalog.application/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Demo Catalog
+Bundle-SymbolicName: org.example.democatalog.application;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Require-Bundle: javax.inject;bundle-version="0.0.0",
+ org.eclipse.core.runtime;bundle-version="0.0.0",
+ org.eclipse.swt;bundle-version="0.0.0",
+ org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0",
+ org.eclipse.jface;bundle-version="0.0.0",
+ org.eclipse.e4.ui.services;bundle-version="0.0.0",
+ org.eclipse.e4.ui.workbench;bundle-version="0.0.0",
+ org.eclipse.e4.core.di;bundle-version="0.0.0",
+ org.eclipse.e4.ui.di;bundle-version="0.0.0",
+ org.eclipse.e4.core.contexts;bundle-version="0.0.0",
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecp.ui.view,
+ org.eclipse.emf.ecp.ui.view.swt,
+ org.eclipse.emf.edit,
+ org.example.democatalog;bundle-version="1.0.0",
+ org.example.democatalog.edit;bundle-version="1.0.0",
+ org.example.democatalog.viewmodel;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-14
+Import-Package: javax.annotation;version="0.0.0"
+Automatic-Module-Name: org.example.democatalog.application
diff --git a/org.example.democatalog.application/build.properties b/org.example.democatalog.application/build.properties
new file mode 100644
index 0000000..04ab1e9
--- /dev/null
+++ b/org.example.democatalog.application/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               icons/,\
+               css/default.css,\
+               Application.e4xmi
diff --git a/org.example.democatalog.application/css/default.css b/org.example.democatalog.application/css/default.css
new file mode 100644
index 0000000..e69de29
diff --git a/org.example.democatalog.application/icons/home.png b/org.example.democatalog.application/icons/home.png
new file mode 100644
index 0000000000000000000000000000000000000000..e9ace41c655fcbe6450482aa21e4de88f6905b04
GIT binary patch
literal 287
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf<Z~8yL>2?7
z8z9Vhe8JAOKtah8*NBqf{Irtt#G+J&^73-M%)IR4<ivthz5Jr|+3#$mfQsgLx;Tbd
z^d7xr%XP>>pzYytd7IX2W@6jE#VLk=@Y^=+HRl(Wk4)d1)IGEpo%M1OdgR8m&)^N;
z8}rYG)+L*dy*WKQER3V#VVkU)<{?$S3b#Vjbteq6gwJg}zSuRQpL^R^CPl{xeyuXI
zi>~s0Q<`@!KA?2ZpR=-ACyKk%QsVoTyAS@euDTtna6HoT$~qb5n#b+)#WSVO?@9mu
bu!4Eh6VIQP`W^v5cQSao`njxgN@xNA+l6XM

literal 0
HcmV?d00001

diff --git a/org.example.democatalog.application/icons/open_in_app.png b/org.example.democatalog.application/icons/open_in_app.png
new file mode 100644
index 0000000000000000000000000000000000000000..9df4eeb7c3b8e6d1ff41f77b6032062a0edb4695
GIT binary patch
literal 315
zcmeAS@N?(olHy`uVBq!ia0vp^!ayv*!3HG19C1kkQY^(zo*^7SP{WbZ0pxQQctjQh
z)vX6%#^h&xhk=5UC9V-A!TD(=<%vb94CUqJdYO6I#mR{Use1WE>9gP2NC6e?@N{tu
zvFLq!c_Zf`2a#hR|94N4j5!#h_dtj-IC6$*&L^$u0lP(-9tcGq(CS-Y%+i-WQA1Ox
zPvYRQ^?&>B?`^JLw5nQxRjow5e^JI{mCn~M?{nG+9N49EIwo|volnTsn)X>SE>Et6
z&X~!4c*BQ#*SvDl3gaU~uj)!P{4~n<FB6@3H{jrzZ3mbZ^xoa9W6ggw#I!c?e$6xa
z-=^2%ma_-cB<M6sUip6}Q2!TCM6bjd)&m<Ej~`)dSMO;yV2V__vIXb|22WQ%mvv4F
FO#o*oc`^V1

literal 0
HcmV?d00001

diff --git a/org.example.democatalog.application/icons/save_edit.png b/org.example.democatalog.application/icons/save_edit.png
new file mode 100644
index 0000000000000000000000000000000000000000..b17caf5a984540e8b1448057feeecc5183c58eaa
GIT binary patch
literal 367
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf<Z~8yL>2?p
zD}XSgpwrRCKtah8*NBqf{Irtt#G+J&^73-M%)IR4<ivthz5Jr|+3#$mfQsIDx;Tbd
z^e&ye){i+*pml%du1%avUa2i%V&oG_iH&CnnZKY-K62-?9(QxoJr43rp7D$mBvLj?
zux*}gQc%A8f@fadvpdE6&WI+zv+M4te$bHjHAv*>5}niK43oDoay_VY{~%!TkJHeT
zagA#4?Mv_MdONO8`@-c@C42nbRn8AP_!%B-iNCC}_SPK1!YP-t4+zZom)=sle}nLc
z$hr2+`x<6XxumevgyEgm+wiZ&N*@$5cV5+3iDlUACp_b(m9qWQJ&_JBb5fstKF9DN
z>{9C89lu2j<{Do+ePv5${#Dzoiu+$0EI(XKkl5OKHs>F&{AoMO<{t+vf&OOjboFyt
I=akR{0M|T{IRF3v

literal 0
HcmV?d00001

diff --git a/org.example.democatalog.application/org.example.democatalog.application.product b/org.example.democatalog.application/org.example.democatalog.application.product
new file mode 100644
index 0000000..80672dd
--- /dev/null
+++ b/org.example.democatalog.application/org.example.democatalog.application.product
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="Demo Catalog" uid="org.example.democatalog.application.product" id="org.example.democatalog.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="true">
+
+   <configIni use="default">
+   </configIni>
+
+   <launcherArgs>
+      <programArgs>-clearPersistedState
+      </programArgs>
+      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+      </vmArgsMac>
+   </launcherArgs>
+
+   <windowImages/>
+
+   <launcher>
+      <win useIco="false">
+         <bmp/>
+      </win>
+   </launcher>
+
+   <vm>
+   </vm>
+
+   <plugins>
+   </plugins>
+
+   <features>
+      <feature id="org.example.democatalog.feature"/>
+      <feature id="org.eclipse.e4.rcp"/>
+      <feature id="org.eclipse.emf.ecp.emfforms.runtime.feature"/>
+      <feature id="org.eclipse.emf.common"/>
+      <feature id="org.eclipse.emf.common.ui"/>
+      <feature id="org.eclipse.emf.databinding"/>
+      <feature id="org.eclipse.emf.databinding.edit"/>
+      <feature id="org.eclipse.emf.ecore"/>
+      <feature id="org.eclipse.emf.ecore.edit"/>
+      <feature id="org.eclipse.emf.edit"/>
+      <feature id="org.eclipse.emf.edit.ui"/>
+   </features>
+
+
+   <preferencesInfo>
+      <targetfile overwrite="false"/>
+   </preferencesInfo>
+
+   <cssInfo>
+   </cssInfo>
+
+</product>
diff --git a/org.example.democatalog.application/plugin.xml b/org.example.democatalog.application/plugin.xml
new file mode 100644
index 0000000..05c79e5
--- /dev/null
+++ b/org.example.democatalog.application/plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         id="product"
+         point="org.eclipse.core.runtime.products">
+      <product
+            application="org.eclipse.e4.ui.workbench.swt.E4Application"
+            name="Demo Catalog">
+         <property
+               name="appName"
+               value="Demo Catalog">
+         </property>
+      </product>
+   </extension>
+
+</plugin>
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/handlers/AboutHandler.java b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/AboutHandler.java
new file mode 100644
index 0000000..2a64919
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/AboutHandler.java
@@ -0,0 +1,12 @@
+package org.example.democatalog.application.handlers;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+
+public class AboutHandler {
+	@Execute
+	public void execute(Shell shell) {
+		MessageDialog.openInformation(shell, "About", "Demo Catalog");
+	}
+}
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/handlers/HandlerUtils.java b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/HandlerUtils.java
new file mode 100644
index 0000000..83764e3
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/HandlerUtils.java
@@ -0,0 +1,50 @@
+package org.example.democatalog.application.handlers;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+
+class HandlerUtils {
+	static final String CATALOG_PARTDESCRIPTOR_ID = "org.example.democatalog.application.partdescriptor.catalog";
+	
+	public static String openFileDialog(Shell shell) {
+		return invokeFileDialog(new FileDialog(shell, SWT.OPEN));
+	}
+
+	public static String newFileDialog(Shell shell) {
+		return invokeFileDialog(new FileDialog(shell, SWT.SAVE));
+	}
+
+	private static String invokeFileDialog(FileDialog dialog) {
+		dialog.setFilterPath(System.getProperty("user.home"));
+		dialog.setFilterNames(new String [] {"Demo Catalog", "All Files (*)"});
+		dialog.setFilterExtensions(new String [] {"*.democat", "*"});
+		return dialog.open();
+	}
+	
+	static void createNewPartWithCatalog(IEclipseContext context, EPartService partService, Resource resource) {		
+		context.set(Resource.class, resource);
+		MPart catalogPart = partService.createPart(CATALOG_PARTDESCRIPTOR_ID);
+		catalogPart.setDirty(true); // must listen to adapter!
+		catalogPart.setLabel(resource.getURI().lastSegment());
+		partService.showPart(catalogPart, PartState.ACTIVATE);
+	}
+	
+	static AdapterFactoryEditingDomain createEditingDomain() {
+		final AdapterFactory composedAdapterFactory = new ComposedAdapterFactory(
+				ComposedAdapterFactory.Descriptor.Registry.INSTANCE); // no dispose required?
+		final AdapterFactoryEditingDomain domain = new AdapterFactoryEditingDomain(composedAdapterFactory,
+				new BasicCommandStack());
+		return domain;
+	}
+
+}
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/handlers/NewHandler.java b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/NewHandler.java
new file mode 100644
index 0000000..b952101
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/NewHandler.java
@@ -0,0 +1,53 @@
+package org.example.democatalog.application.handlers;
+
+import java.io.IOException;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.swt.widgets.Shell;
+
+import org.example.democatalog.DemocatalogPackage;
+
+public class NewHandler {
+	static final String CATALOG_PARTDESCRIPTOR_ID = "org.example.democatalog.application.partdescriptor.catalog";
+
+	@Execute
+	public void execute(MApplication application, @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
+			EPartService partService) {
+
+		final String pathToNewCatalog = HandlerUtils.newFileDialog(shell);
+
+		if (pathToNewCatalog != null) {
+			// create new catalog with resource at above path
+			final AdapterFactoryEditingDomain domain = HandlerUtils.createEditingDomain();
+			final Resource catalogResource = domain.createResource("file://" + pathToNewCatalog);
+
+			// assume default XMI factory was used to create an XML resource
+			if (catalogResource instanceof XMLResource) {
+				((XMLResource)catalogResource).setEncoding("UTF-8");
+			}
+
+			final EObject catalog = EcoreUtil.create(DemocatalogPackage.eINSTANCE.getEnergyComponentCatalog());
+			catalogResource.getContents().add(catalog);
+
+			// store new (empty) resource at selected path
+			try {
+				catalogResource.save(null);
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+
+			HandlerUtils.createNewPartWithCatalog(application.getContext(), partService, catalogResource);
+		}
+	}
+}
\ No newline at end of file
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/handlers/OpenHandler.java b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/OpenHandler.java
new file mode 100644
index 0000000..5b71c83
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/OpenHandler.java
@@ -0,0 +1,13 @@
+package org.example.democatalog.application.handlers;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+public class OpenHandler {
+
+	@Execute
+	public void execute(Shell shell){
+		FileDialog dialog = new FileDialog(shell);
+		dialog.open();
+	}
+}
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/handlers/QuitHandler.java b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/QuitHandler.java
new file mode 100644
index 0000000..c7fe587
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/QuitHandler.java
@@ -0,0 +1,17 @@
+package org.example.democatalog.application.handlers;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.workbench.IWorkbench;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class QuitHandler {
+	@Execute
+	public void execute(IWorkbench workbench, Shell shell){
+		if (MessageDialog.openConfirm(shell, "Confirmation",
+				"Do you want to exit?")) {
+			workbench.close();
+		}
+	}
+}
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/handlers/SaveHandler.java b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/SaveHandler.java
new file mode 100644
index 0000000..8776afb
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/handlers/SaveHandler.java
@@ -0,0 +1,21 @@
+package org.example.democatalog.application.handlers;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+
+public class SaveHandler {
+
+	@CanExecute
+	public boolean canExecute(EPartService partService) {
+		if (partService != null) {
+			return !partService.getDirtyParts().isEmpty();
+		}
+		return false;
+	}
+
+	@Execute
+	public void execute(EPartService partService) {
+		partService.saveAll(false);
+	}
+}
\ No newline at end of file
diff --git a/org.example.democatalog.application/src/org/example/democatalog/application/parts/CatalogPart.java b/org.example.democatalog.application/src/org/example/democatalog/application/parts/CatalogPart.java
new file mode 100644
index 0000000..6dbfc36
--- /dev/null
+++ b/org.example.democatalog.application/src/org/example/democatalog/application/parts/CatalogPart.java
@@ -0,0 +1,51 @@
+package org.example.democatalog.application.parts;
+
+import java.io.IOException;
+
+import javax.annotation.PostConstruct;
+
+import org.eclipse.e4.ui.di.Persist;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecp.ui.view.ECPRendererException;
+import org.eclipse.emf.ecp.ui.view.swt.ECPSWTViewRenderer;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Part for displaying a Forms Editor for a DemoCatalog.
+ * See https://www.vogella.com/tutorials/Eclipse4Services/article.html#implementing-editor-like-behavior.
+ */
+public class CatalogPart {
+	private Resource demoCatalogResource;
+	
+	@PostConstruct
+	public void createComposite(MApplication application, Composite parent) {
+		demoCatalogResource = application.getContext().get(Resource.class);
+		EObject energyCatalog = demoCatalogResource.getContents().get(0);
+		try {
+			final Composite content = new Composite(parent, SWT.NONE);
+			content.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+			content.setLayout(GridLayoutFactory.fillDefaults().margins(10, 10).create());
+			ECPSWTViewRenderer.INSTANCE.render(content, energyCatalog);
+			content.layout();
+		} catch (final ECPRendererException e) {
+			e.printStackTrace();
+		}
+		parent.layout();
+	}
+	
+	@Persist
+	public void save() {
+		System.out.println("Saved " + demoCatalogResource);
+		try {
+			demoCatalogResource.save(null);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+}
\ No newline at end of file
diff --git a/org.example.democatalog.feature/.project b/org.example.democatalog.feature/.project
new file mode 100644
index 0000000..a5a763b
--- /dev/null
+++ b/org.example.democatalog.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.example.democatalog.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>
diff --git a/org.example.democatalog.feature/build.properties b/org.example.democatalog.feature/build.properties
new file mode 100644
index 0000000..64f93a9
--- /dev/null
+++ b/org.example.democatalog.feature/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/org.example.democatalog.feature/feature.xml b/org.example.democatalog.feature/feature.xml
new file mode 100644
index 0000000..1b857ad
--- /dev/null
+++ b/org.example.democatalog.feature/feature.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.example.democatalog.feature"
+      label="Demo Catalog"
+      version="1.0.0.qualifier"
+      provider-name="EXAMPLE">
+
+   <description url="http://www.example.com/description">
+      [Enter Feature Description here.]
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      [Enter Copyright Description here.]
+   </copyright>
+
+   <license url="http://www.example.com/license">
+      [Enter License Description here.]
+   </license>
+
+   <plugin
+         id="org.example.democatalog"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.example.democatalog.application"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.example.democatalog.edit"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.example.democatalog.viewmodel"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"/>
+
+  <plugin
+         id="org.eclipse.ui"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.ui.views"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.ui.workbench"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.help"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.core.resources"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.core.filesystem"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.jface.text"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.eclipse.text"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+
+
+</feature>
diff --git a/org.example.democatalog/META-INF/MANIFEST.MF b/org.example.democatalog/META-INF/MANIFEST.MF
index fe3c3bf..a212804 100644
--- a/org.example.democatalog/META-INF/MANIFEST.MF
+++ b/org.example.democatalog/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.example.democatalog;singleton:=true
 Automatic-Module-Name: org.example.democatalog
-Bundle-Version: 0.1.0.qualifier
+Bundle-Version: 1.0.0.qualifier
 Bundle-ClassPath: .
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-- 
GitLab