ref #6566 Migrate org.eclipse.ui.main.menu.admin DB items
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 12 Apr 2017 15:28:56 +0000 (17:28 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 12 Apr 2017 15:28:56 +0000 (17:28 +0200)
eu.etaxonomy.taxeditor.application/fragment.e4xmi
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDatabasePreferencesWizardHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDatabaseRepairWizardHandler.java

index 9b638aeafbcc9e0b1902c67bf2bccbd22dc03417..4e151976665997ad4fc1b555335eea525bbb1f52 100644 (file)
         <children xsi:type="menu:MenuSeparator" xmi:id="_zfx_cB7PEeeC-JvycL9ysA" elementId="eu.etaxonomy.taxeditor.application.windowMenu.last"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_35iN8B7PEeeC-JvycL9ysA" elementId="org.eclipse.ui.main.menu.window.preferences" label="%command.label.12" command="_l9kXoB7PEeeC-JvycL9ysA"/>
       </children>
-      <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="_KDFiMB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.admin" label="%menu.label.4">
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_RsV7EB-IEeeIA_2gwq7JKg" elementId="org.eclipse.ui.main.menu.admin.dbpreferences" label="%command.label.23" command="_JXXNIB-IEeeIA_2gwq7JKg">
+          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_ckfJUB-IEeeIA_2gwq7JKg" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
+        </children>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_VgPDcB-IEeeIA_2gwq7JKg" elementId="org.eclipse.ui.main.menu.admin.dbrepair" label="%command.label.24" command="_LuEl0B-IEeeIA_2gwq7JKg">
+          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_06_ZIB-TEeeIA_2gwq7JKg" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
+        </children>
+      </children>
       <children xsi:type="menu:Menu" xmi:id="_MG8QUB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.help" label="%menu.label.2">
         <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"/>
@@ -46,6 +53,8 @@
   <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"/>
+    <elements xsi:type="commands:Handler" xmi:id="_cwy_oB-LEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler" command="_LuEl0B-IEeeIA_2gwq7JKg"/>
+    <elements xsi:type="commands:Handler" xmi:id="_pZ84gB-LEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.handler.OpenDatabasePreferencesWizardHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.OpenDatabasePreferencesWizardHandler" command="_JXXNIB-IEeeIA_2gwq7JKg"/>
   </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"/>
@@ -65,5 +74,7 @@
     <elements xsi:type="commands:Command" xmi:id="_WOTDYB7EEeeRW_RHu3JLqQ" elementId="org.eclipse.ui.edit.delete" commandName="%command.label.11"/>
     <elements xsi:type="commands:Command" xmi:id="_l9kXoB7PEeeC-JvycL9ysA" elementId="org.eclipse.ui.window.preferences" commandName="%command.label.12"/>
     <elements xsi:type="commands:Command" xmi:id="_hooiQB7QEeeC-JvycL9ysA" elementId="org.eclipse.ui.newWizard" commandName="%command.label.21"/>
+    <elements xsi:type="commands:Command" xmi:id="_JXXNIB-IEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.application.DatabaseSettings" commandName="%command.label.23"/>
+    <elements xsi:type="commands:Command" xmi:id="_LuEl0B-IEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.application.DatabaseRepairFunctionality" commandName="%command.label.24"/>
   </fragments>
 </fragment:ModelFragments>
index a291def0c5a6af54a7ab94d2352453ca8d8799dd..e47ecf18ce664d6a8d0cce9ba9aab54be2a30264 100644 (file)
       <menuContribution
             allPopups="false"
             locationURI="menu:org.eclipse.ui.main.menu.admin">
-         <command
-               commandId="eu.etaxonomy.taxeditor.application.DatabaseSettings"
-               label="%command.label.23"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <and>
-                  <reference
-                        definitionId="hasROLE_PROJECT_MANAGER">
-                  </reference>
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </and>
-            </visibleWhen>
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.application.DatabaseRepairFunctionality"
-               label="%command.label.24"
-               style="push">
-                <visibleWhen
-                  checkEnabled="true">
-               <and>
-                  <reference
-                        definitionId="hasROLE_PROJECT_MANAGER">
-                  </reference>
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </and>
-            </visibleWhen>
-         </command>
          <dynamic
                class="eu.etaxonomy.taxeditor.admin.UserGroupContributionItem"
                id="eu.etaxonomy.taxeditor.admin.UserGroupContributionItem">
                commandId="org.eclipse.ui.help.aboutAction"
                label="%command.label.19">
          </command>
-      </menuContribution>
-            <menuContribution
-            locationURI="toolbar:org.eclipse.ui.main.toolbar">
-         <toolbar
-               id="eu.etaxonomy.taxeditor.editor.main">
-            <command
-                  commandId="org.eclipse.ui.newWizard"
-                  label="%command.label.21"
-                  style="push">
-            </command>
-            <command
-                  commandId="org.eclipse.ui.file.save"
-                  label="%command.label.22"
-                  style="push">
-            </command>
-         </toolbar>
       </menuContribution>
    </extension>
    <extension
index a64aca87b3b06c445164934ec026037b666d7c70..94cb1ed3309f428f4a0be2438aba43eec24f3365 100644 (file)
@@ -70,7 +70,8 @@ Require-Bundle: org.eclipse.osgi,
  org.eclipse.core.databinding.beans,
  org.eclipse.core.databinding.observable,
  org.eclipse.core.databinding.property,
- org.eclipse.jface.databinding
+ org.eclipse.jface.databinding,
+ org.eclipse.e4.core.di.annotations;bundle-version="1.5.0"
 Import-Package: eu.etaxonomy.taxeditor.webapp,
  org.eclipse.core.commands,
  org.eclipse.core.commands.operations,
index 95f416857655b0d5366a1927d8f53947d421cd1c..b62e2b46c2ebf685323da7bfcd816512418ee0c9 100755 (executable)
                typeId="eu.etaxonomy.taxeditor.uuidParameterType">
          </commandParameter>
       </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.handler.OpenDatabasePreferencesWizardHandler"
-            id="eu.etaxonomy.taxeditor.application.DatabaseSettings"
-            name="%command.label.23">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler"
-            id="eu.etaxonomy.taxeditor.application.DatabaseRepairFunctionality"
-            name="%command.label.24">
-      </command>
    </extension>
    <extension
          point="org.eclipse.ui.commands">
             </iterate>
          </with>
       </definition>
+      <definition
+            id="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected">
+         <and>
+            <reference
+                  definitionId="hasROLE_PROJECT_MANAGER">
+            </reference>
+            <reference
+                  definitionId="isCdmStoreConnected">
+            </reference>
+         </and>
+      </definition>
 </extension>
 <extension
       point="org.eclipse.ui.activities">
index cdc277891c98c5a5a4e8542919ac01334a3c424b..9eb00c80ae694ac74c987740f5abbda9dc46c98c 100644 (file)
@@ -8,27 +8,23 @@
 */
 package eu.etaxonomy.taxeditor.handler;
 
-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.jface.wizard.WizardDialog;
 
 import eu.etaxonomy.taxeditor.databaseAdmin.wizard.DatabasePreferencesWizard;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 /**
  * @author k.luther
  * @date 18.11.2016
  *
  */
-public class OpenDatabasePreferencesWizardHandler  extends AbstractHandler{
+public class OpenDatabasePreferencesWizardHandler {
 
-    String commandID = "eu.etaxonomy.taxeditor.store.open.OpenDatabasePreferencesWizardHandler";
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
+    @Execute
+    public Object execute(){
         DatabasePreferencesWizard databasePreferencesWizard = new DatabasePreferencesWizard();
-        WizardDialog dialog = new WizardDialog(StoreUtil.getShell(),
+        WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(),
                 databasePreferencesWizard);
 
         dialog.open();
index 697debaf46db5aea0117f2910131af38cef5225f..a1deba1d378c9acb5f270cf8958cc40d2c7fc141 100644 (file)
@@ -8,13 +8,11 @@
 */
 package eu.etaxonomy.taxeditor.handler;
 
-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.jface.wizard.WizardDialog;
 
 import eu.etaxonomy.taxeditor.databaseAdmin.wizard.DatabaseRepairWizard;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 
 
@@ -23,15 +21,15 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @date 06.12.2016
  *
  */
-public class OpenDatabaseRepairWizardHandler extends AbstractHandler {
+public class OpenDatabaseRepairWizardHandler{
 
     /**
      * {@inheritDoc}
      */
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
+    @Execute
+    public Object execute(){
         DatabaseRepairWizard databaseRepairWizard = new DatabaseRepairWizard();
-        WizardDialog dialog = new WizardDialog(StoreUtil.getShell(),
+        WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(),
                 databaseRepairWizard);
 
         dialog.open();