ref #6566 Migrate org.eclipse.ui.main.menu.file menu
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 11 Apr 2017 13:39:54 +0000 (15:39 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 11 Apr 2017 13:40:53 +0000 (15:40 +0200)
 - Also migrate two help handlers

eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.application/build.properties
eu.etaxonomy.taxeditor.application/fragment.e4xmi [new file with mode: 0644]
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalAboutPlatformHandler.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalParserHelpHandler.java

index 41083e5a45259e420a10c523c2386d92d2c8edb0..16fe5b051de2f867a691099acb30cd32edaca110 100644 (file)
@@ -7,15 +7,6 @@ Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
 Bundle-Vendor: EDIT
 Bundle-Localization: OSGI-INF/l10n/plugin
 Export-Package: eu.etaxonomy.taxeditor
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: eu.etaxonomy.cdm.database,
- org.apache.log4j,
- org.eclipse.equinox.app,
- org.eclipse.equinox.p2.repository.metadata,
- org.osgi.framework,
- org.osgi.service.packageadmin,
- org.springframework.remoting
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  eu.etaxonomy.taxeditor.store,
@@ -36,4 +27,17 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.equinox.p2.metadata,
  org.eclipse.equinox.p2.engine,
  org.eclipse.equinox.p2.metadata.repository,
- org.eclipse.equinox.p2.repository
+ org.eclipse.equinox.p2.repository,
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.core.di.annotations;bundle-version="1.5.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Import-Package: eu.etaxonomy.cdm.database,
+ javax.annotation;version="1.0.0";resolution:=optional,
+ javax.inject;version="1.0.0",
+ org.apache.log4j,
+ org.eclipse.equinox.app,
+ org.eclipse.equinox.p2.repository.metadata,
+ org.osgi.framework,
+ org.osgi.service.packageadmin,
+ org.springframework.remoting
index 46fe7efb559c628f2be65c0e15f72c6fa97e2949..62fdc725341fa5ec1e2b7b05c5b7edbd7dbdff72 100644 (file)
@@ -1,5 +1,3 @@
-source.. = src/main/java/,\
-           src/test/java/
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
@@ -7,4 +5,7 @@ bin.includes = META-INF/,\
                icons/,\
                OSGI-INF/l10n/plugin.properties,\
                OSGI-INF/l10n/plugin_de.properties,\
-               splash.bmp,\              
+               splash.bmp,\
+               fragment.e4xmi
+source.. = src/main/java/,\
+           src/test/java/
diff --git a/eu.etaxonomy.taxeditor.application/fragment.e4xmi b/eu.etaxonomy.taxeditor.application/fragment.e4xmi
new file mode 100644 (file)
index 0000000..8c83fcb
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_pdAMoB4DEeehWtOSgLepjA">
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_0q2vsB4EEeehWtOSgLepjA" featurename="descriptors" parentElementId="org.eclipse.e4.legacy.ide.application"/>
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_bM7nAB4IEeehWtOSgLepjA" featurename="menuContributions" parentElementId="org.eclipse.e4.legacy.ide.application">
+    <elements xsi:type="menu:MenuContribution" xmi:id="_hxW2sB6fEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.menucontribution.help" parentId="org.eclipse.ui.main.menu.help">
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_6vgg4B6gEeePLJ5to5QrXQ" elementId="id.commandlabel16" label="%command.label.16" command="_ye6jsB6gEeePLJ5to5QrXQ"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_i-R80B6fEeePLJ5to5QrXQ" elementId="id.commandlabel20" label="%command.label.20" command="_V9LTcB6eEeePLJ5to5QrXQ"/>
+    </elements>
+    <elements xsi:type="menu:MenuContribution" xmi:id="_q5WDAB6sEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.menucontribution.menu" parentId="org.eclipse.ui.main.menu">
+      <children xsi:type="menu:Menu" xmi:id="_0MhekB6sEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.file" label="%menu.label">
+        <children xsi:type="menu:Menu" xmi:id="_zznkcB6uEeePLJ5to5QrXQ" elementId="eu.etaxonomy.navigation.menu.new" label="%menu.label.3"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_5ETa8B6uEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.menuseparator.0"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_ubXMsB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.close" label="%command.label" command="_LVTo8B62EeePLJ5to5QrXQ"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_yGpysB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.closeAll" label="%command.label.0" command="_MrLPsB62EeePLJ5to5QrXQ"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_BmuOUB63EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.menuseparator.3"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_jE5VoB60EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.import" label="%command.label.3" command="_dlo3oB60EeePLJ5to5QrXQ">
+          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_0UicAB61EeePLJ5to5QrXQ" coreExpressionId="isCdmStoreConnected"/>
+        </children>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_xT7KsB61EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.export" label="%command.label.4" command="_CYHrgB62EeePLJ5to5QrXQ">
+          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_21J-oB61EeePLJ5to5QrXQ" coreExpressionId="isCdmStoreConnected"/>
+        </children>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_XE1yMB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.menuseparator.1"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_YM8CsB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.save" label="%command.label.1" command="_PkWcQB62EeePLJ5to5QrXQ"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_czNDMB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.saveAll" label="%command.label.2" command="_RWLmQB62EeePLJ5to5QrXQ"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_gBC4MB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.filemenu.io"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_jC1OMB62EeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.handledmenuitem.exit" label="%command.label.5" command="_TvLd8B62EeePLJ5to5QrXQ"/>
+      </children>
+      <children xsi:type="menu:Menu" xmi:id="__9a5wB6sEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.edit" label="%menu.label.0"/>
+      <children xsi:type="menu:Menu" xmi:id="_BFCCEB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.window" label="%menu.label.1"/>
+      <children xsi:type="menu:Menu" xmi:id="_KDFiMB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.admin" label="%menu.label.4"/>
+      <children xsi:type="menu:Menu" xmi:id="_MG8QUB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.help" label="%menu.label.2"/>
+    </elements>
+  </fragments>
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_vvQmIB4JEeehWtOSgLepjA" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
+    <elements xsi:type="commands:Handler" xmi:id="_haDmcB6eEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.application/eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler" command="_V9LTcB6eEeePLJ5to5QrXQ"/>
+    <elements xsi:type="commands:Handler" xmi:id="_3wxe4B6gEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.application/eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler" command="_ye6jsB6gEeePLJ5to5QrXQ"/>
+  </fragments>
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_1jM6sB4JEeehWtOSgLepjA" featurename="commands" parentElementId="org.eclipse.e4.legacy.ide.application">
+    <elements xsi:type="commands:Command" xmi:id="_V9LTcB6eEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.help.aboutPlatform" commandName="%command.name.0"/>
+    <elements xsi:type="commands:Command" xmi:id="_ye6jsB6gEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.application.help.parser" commandName="%command.name"/>
+    <elements xsi:type="commands:Command" xmi:id="_dlo3oB60EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.import" commandName="%command.label.3"/>
+    <elements xsi:type="commands:Command" xmi:id="_CYHrgB62EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.export" commandName="%command.label.4"/>
+    <elements xsi:type="commands:Command" xmi:id="_LVTo8B62EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.close" commandName="%command.label"/>
+    <elements xsi:type="commands:Command" xmi:id="_MrLPsB62EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.closeAll" commandName="%command.label.0"/>
+    <elements xsi:type="commands:Command" xmi:id="_PkWcQB62EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.save" commandName="%command.label.1"/>
+    <elements xsi:type="commands:Command" xmi:id="_RWLmQB62EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.saveAll" commandName="%command.label.2"/>
+    <elements xsi:type="commands:Command" xmi:id="_TvLd8B62EeePLJ5to5QrXQ" elementId="org.eclipse.ui.file.exit" commandName="%command.label.5"/>
+  </fragments>
+</fragment:ModelFragments>
index fdad8b284077acf80629a32ccaf896fece22e5a9..6b08e4b657fc89b91736ce6676834544cb48315b 100644 (file)
    </extension-->
    <extension
          point="org.eclipse.ui.menus">
-      <menuContribution
-            locationURI="menu:org.eclipse.ui.main.menu">
-         <menu
-               id="org.eclipse.ui.main.menu.file"
-               label="%menu.label">
-         </menu>
-         <menu
-               id="org.eclipse.ui.main.menu.edit"
-               label="%menu.label.0">
-         </menu>
-         <menu
-               id="org.eclipse.ui.main.menu.window"
-               label="%menu.label.1">
-         </menu>
-          <menu
-               id="org.eclipse.ui.main.menu.admin"
-               label="%menu.label.4">
-         </menu>
-         <menu
-               id="org.eclipse.ui.main.menu.help"
-               label="%menu.label.2">
-         </menu>
-        
-      </menuContribution>
-      <menuContribution
-            locationURI="menu:org.eclipse.ui.main.menu.file">
-         <menu
-               id="eu.etaxonomy.navigation.menu.new"
-               label="%menu.label.3">
-         </menu>
-         <separator
-               name="eu.etaxonomy.taxeditor.application.filemenu.new"
-               visible="true">
-         </separator>
-         <command
-               commandId="org.eclipse.ui.file.close"
-               label="%command.label"
-               style="push">
-         </command>
-         <command
-               commandId="org.eclipse.ui.file.closeAll"
-               label="%command.label.0"
-               style="push">
-         </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.application.filemenu.close"
-               visible="true">
-         </separator>
-         <command
-               commandId="org.eclipse.ui.file.save"
-               label="%command.label.1"
-               style="push">
-         </command>
-         <command
-               commandId="org.eclipse.ui.file.saveAll"
-               label="%command.label.2"
-               style="push">
-         </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.application.filemenu.save"
-               visible="true">
-         </separator>
-         <command
-               commandId="org.eclipse.ui.file.import"
-               label="%command.label.3"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
-         </command>
-         <command
-               commandId="org.eclipse.ui.file.export"
-               label="%command.label.4"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
-         </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.application.filemenu.io"
-               visible="true">
-         </separator>
-         <command
-               commandId="org.eclipse.ui.file.exit"
-               id="eu.etaxonomy.taxeditor.application.menu.exit"
-               label="%command.label.5"
-               style="push">
-         </command>
-      </menuContribution>
       <menuContribution
             locationURI="menu:org.eclipse.ui.main.menu.edit">
          <command
                label="%command.label.15"
                style="push">
          </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.application.help.parser"
-               label="%command.label.16"
-               style="push">
-         </command>
          <separator
                name="eu.etaxonomy.taxeditor.ui.help.separator1"
                visible="true">
                commandId="org.eclipse.ui.help.aboutAction"
                label="%command.label.19">
          </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.application.help.aboutPlatform"
-               label="%command.label.20"
-               style="push">
-         </command>
       </menuContribution>
             <menuContribution
             locationURI="toolbar:org.eclipse.ui.main.toolbar">
    </extension>
    <extension
          point="org.eclipse.ui.commands">
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler"
-            id="eu.etaxonomy.taxeditor.application.help.parser"
-            name="%command.name">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler"
-            id="eu.etaxonomy.taxeditor.application.help.aboutPlatform"
-            name="%command.name.0">
-      </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.update.UpdateHandler"
             id="eu.etaxonomy.taxeditor.update"
        </property>
     </product>
  </extension>
+ <extension
+       id="org.eclipse.e4.legacy.ide.application"
+       point="org.eclipse.e4.workbench.model">
+    <fragment
+          apply="always"
+          uri="fragment.e4xmi">
+    </fragment>
+ </extension>
 
 </plugin>
index 430e4724b741d8c8a5604ace918a561c944ae22d..5dd7903bd71a16b50867a1b00aed6d7f9672048e 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,28 +13,22 @@ import java.net.MalformedURLException;
 import java.net.URL;
 
 import org.apache.log4j.Logger;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.e4.core.di.annotations.Execute;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
 
 /**
- * <p>OpenExternalAboutPlatformHandler class.</p>
- *
  * @author p.ciardelli
  * @created 04.09.2009
  * @version 1.0
  */
-public class OpenExternalAboutPlatformHandler extends AbstractHandler {
+public class OpenExternalAboutPlatformHandler {
        private static final Logger logger = Logger.getLogger(OpenExternalAboutPlatformHandler.class);
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
-       /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+       @Execute
+       public Object execute() {
                String url = "http://wp5.e-taxonomy.eu/";
 
                try {
index 4af8183b05f3507694174b4ac78d20aeab7671ee..40bf44244acce876b04334fef1da487fb1acbe25 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,9 +13,7 @@ import java.net.MalformedURLException;
 import java.net.URL;
 
 import org.apache.log4j.Logger;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.e4.core.di.annotations.Execute;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
@@ -27,14 +25,12 @@ import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
  * @created 04.09.2009
  * @version 1.0
  */
-public class OpenExternalParserHelpHandler extends AbstractHandler {
+public class OpenExternalParserHelpHandler {
        private static final Logger logger = Logger.getLogger(OpenExternalParserHelpHandler.class);
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
+       @Execute
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       public Object execute() {
                String url = "http://dev.e-taxonomy.eu/trac/wiki/NameParserDocumentation";
 
                try {