commit 59d8592e143dff890bd32ef618850d79b2565f88
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Mon Nov 6 12:09:52 2017 +0100

    ref #6925 Add partStackId to OpenPartHandler

diff --git a/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi b/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
index f25449ba4..4b49caed1 100644
--- a/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
@@ -106,6 +106,7 @@
     <elements xsi:type="commands:Command" xmi:id="_fdEqUCUKEeeHw5lTgGMs1Q" elementId="eu.etaxonomy.taxeditor.workbench.ImportSettings" commandName="%command.label.25"/>
     <elements xsi:type="commands:Command" xmi:id="_hMjgECZsEeer_rabtodzWA" elementId="eu.etaxonomy.taxeditor.command.openPart" commandName="Open Part">
       <parameters xmi:id="_hMjgESZsEeer_rabtodzWA" elementId="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" name="partName" optional="false"/>
+      <parameters xmi:id="_f5584MLiEee0N85Mii-Chg" elementId="eu.etaxonomy.taxeditor.workbench.commandparameter.partStackId" name="partStackId"/>
     </elements>
     <elements xsi:type="commands:Command" xmi:id="_S00XkL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse" commandName="Collapse"/>
     <elements xsi:type="commands:Command" xmi:id="_Z0st0L4vEeewU62zpvPllA" elementId="eu.etaxonomy.taxeditor.workbench.command.expand" commandName="Expand"/>
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/AppModelId.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/AppModelId.java
index 7edd35894..373da2ec1 100644
--- a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/AppModelId.java
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/AppModelId.java
@@ -2,13 +2,18 @@ package eu.etaxonomy.taxeditor.workbench;
 
 public class AppModelId {
 	public static final String COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTNAME = "eu.etaxonomy.taxeditor.workbench.commandparameter.partName";
+	public static final String COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTSTACKID = "eu.etaxonomy.taxeditor.workbench.commandparameter.partStackId";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_COMMAND_OPENPART = "eu.etaxonomy.taxeditor.command.openPart";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_INSTALL = "eu.etaxonomy.taxeditor.install";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_UPDATE = "eu.etaxonomy.taxeditor.update";
+	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMAND_COLLAPSE = "eu.etaxonomy.taxeditor.workbench.command.collapse";
+	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMAND_EXPAND = "eu.etaxonomy.taxeditor.workbench.command.expand";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_DATABASEREPAIRFUNCTIONALITY = "eu.etaxonomy.taxeditor.workbench.DatabaseRepairFunctionality";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_DATABASESETTINGS = "eu.etaxonomy.taxeditor.workbench.DatabaseSettings";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HELP_ABOUTPLATFORM = "eu.etaxonomy.taxeditor.workbench.help.aboutPlatform";
 	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HELP_PARSER = "eu.etaxonomy.taxeditor.workbench.help.parser";
+	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_IMPORTSETTINGS = "eu.etaxonomy.taxeditor.workbench.ImportSettings";
+	public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_SAVE = "eu.etaxonomy.taxeditor.workbench.save";
 	public static final String COMMAND_ORG_ECLIPSE_UI_EDIT_COPY = "org.eclipse.ui.edit.copy";
 	public static final String COMMAND_ORG_ECLIPSE_UI_EDIT_CUT = "org.eclipse.ui.edit.cut";
 	public static final String COMMAND_ORG_ECLIPSE_UI_EDIT_DELETE = "org.eclipse.ui.edit.delete";
@@ -20,7 +25,6 @@ public class AppModelId {
 	public static final String COMMAND_ORG_ECLIPSE_UI_FILE_EXIT = "org.eclipse.ui.file.exit";
 	public static final String COMMAND_ORG_ECLIPSE_UI_FILE_EXPORT = "org.eclipse.ui.file.export";
 	public static final String COMMAND_ORG_ECLIPSE_UI_FILE_IMPORT = "org.eclipse.ui.file.import";
-	public static final String COMMAND_ORG_ECLIPSE_UI_FILE_SAVE = "org.eclipse.ui.file.save";
 	public static final String COMMAND_ORG_ECLIPSE_UI_FILE_SAVEALL = "org.eclipse.ui.file.saveAll";
 	public static final String COMMAND_ORG_ECLIPSE_UI_HELP_ABOUTACTION = "org.eclipse.ui.help.aboutAction";
 	public static final String COMMAND_ORG_ECLIPSE_UI_HELP_DYNAMICHELP = "org.eclipse.ui.help.dynamicHelp";
@@ -31,12 +35,14 @@ public class AppModelId {
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_CLOSE = "eu.etaxonomy.taxeditor.application.handledmenuitem.close";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_CLOSEALL = "eu.etaxonomy.taxeditor.application.handledmenuitem.closeAll";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_EXIT = "eu.etaxonomy.taxeditor.application.handledmenuitem.exit";
-	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_EXPORT = "eu.etaxonomy.taxeditor.application.handledmenuitem.export";
-	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_IMPORT = "eu.etaxonomy.taxeditor.application.handledmenuitem.import";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_SAVE = "eu.etaxonomy.taxeditor.application.handledmenuitem.save";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_APPLICATION_HANDLEDMENUITEM_SAVEALL = "eu.etaxonomy.taxeditor.application.handledmenuitem.saveAll";
+	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLEDMENUITEM_COMMANDLABEL10 = "eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel10";
+	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLEDMENUITEM_COMMANDLABEL11 = "eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel11";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLEDMENUITEM_COMMANDLABEL17 = "eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel17";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLEDMENUITEM_COMMANDLABEL19 = "eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel19";
+	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLEDMENUITEM_COMMANDLABEL8 = "eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel8";
+	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLEDMENUITEM_COMMANDLABEL9 = "eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel9";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_ADMIN_DBPREFERENCES = "eu.etaxonomy.taxeditor.workbench.menu.admin.dbpreferences";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_ADMIN_DBREPAIR = "eu.etaxonomy.taxeditor.workbench.menu.admin.dbrepair";
 	public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_HELP_ABOUT_EDIT = "eu.etaxonomy.taxeditor.workbench.menu.help.about_edit";
@@ -49,11 +55,15 @@ public class AppModelId {
 	public static final String HANDLEDTOOLITEM_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_TOOLBAR_SAVE = "eu.etaxonomy.taxeditor.workbench.menu.toolbar.save";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_HANDLER_OPENDATABASEPREFERENCESWIZARDHANDLER = "eu.etaxonomy.taxeditor.handler.OpenDatabasePreferencesWizardHandler";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_HANDLER_OPENDATABASEREPAIRWIZARDHANDLER = "eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler";
+	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_HANDLER_OPENIMPORTPREFERENCEHANDLER = "eu.etaxonomy.taxeditor.handler.OpenImportPreferenceHandler";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_OPENEXTERNALABOUTPLATFORMHANDLER = "eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_OPENEXTERNALPARSERHELPHANDLER = "eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_UPDATE_INSTALLNEWSOFTWAREHANDLER = "eu.etaxonomy.taxeditor.update.InstallNewSoftwareHandler";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_UPDATE_UPDATEHANDLER = "eu.etaxonomy.taxeditor.update.UpdateHandler";
+	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLER_COLLAPSEHANDLER = "eu.etaxonomy.taxeditor.workbench.handler.CollapseHandler";
+	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_HANDLER_EXPANDHANDLER = "eu.etaxonomy.taxeditor.workbench.handler.ExpandHandler";
 	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_OPENPARTHANDLER = "eu.etaxonomy.taxeditor.workbench.OpenPartHandler";
+	public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_SAVEHANDLER = "eu.etaxonomy.taxeditor.workbench.SaveHandler";
 	public static final String MENUCONTRIBUTION_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU = "eu.etaxonomy.taxeditor.workbench.menu";
 	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_APPLICATION_FILEMENU_IO = "eu.etaxonomy.taxeditor.application.filemenu.io";
 	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_APPLICATION_MENUSEPARATOR_0 = "eu.etaxonomy.taxeditor.application.menuseparator.0";
@@ -63,12 +73,18 @@ public class AppModelId {
 	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_0 = "eu.etaxonomy.taxeditor.workbench.menuseparator.0";
 	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_1 = "eu.etaxonomy.taxeditor.workbench.menuseparator.1";
 	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_2 = "eu.etaxonomy.taxeditor.workbench.menuseparator.2";
+	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_3 = "eu.etaxonomy.taxeditor.workbench.menuseparator.3";
+	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_AFTERCONCEPT = "eu.etaxonomy.taxeditor.workbench.menuseparator.afterConcept";
+	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_EDITING = "eu.etaxonomy.taxeditor.workbench.menuseparator.editing";
+	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_NAVIGATION = "eu.etaxonomy.taxeditor.workbench.menuseparator.navigation";
+	public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENUSEPARATOR_REFERENCING = "eu.etaxonomy.taxeditor.workbench.menuseparator.referencing";
 	public static final String MENU_EU_ETAXONOMY_NAVIGATION_MENU_NEW = "eu.etaxonomy.navigation.menu.new";
+	public static final String MENU_EU_ETAXONOMY_TAXEDITOR_MENU_SHOWVIEW = "eu.etaxonomy.taxeditor.menu.showView";
 	public static final String MENU_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_ADMIN = "eu.etaxonomy.taxeditor.workbench.menu.admin";
 	public static final String MENU_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_EDIT = "eu.etaxonomy.taxeditor.workbench.menu.edit";
 	public static final String MENU_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_FILE = "eu.etaxonomy.taxeditor.workbench.menu.file";
 	public static final String MENU_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_HELP = "eu.etaxonomy.taxeditor.workbench.menu.help";
 	public static final String MENU_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_WINDOW = "eu.etaxonomy.taxeditor.workbench.menu.window";
 	public static final String TOOLBAR_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_MENU_TOOLBAR_0 = "eu.etaxonomy.taxeditor.workbench.menu.toolbar.0";
-	public static final String TRIMCONTRIBUTION_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_TRIMCONTRIBUTION_0 = "eu.etaxonomy.taxeditor.workbench.trimcontribution.0";
+	public static final String TRIMCONTRIBUTION_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_TRIMCONTRIBUTION_MAINTOOLBAR = "eu.etaxonomy.taxeditor.workbench.trimcontribution.mainToolbar";
 }
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenPartHandler.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenPartHandler.java
index e1c826975..48a13828a 100644
--- a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenPartHandler.java
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenPartHandler.java
@@ -6,14 +6,17 @@ import java.util.Map;
 import org.eclipse.core.commands.ParameterizedCommand;
 import org.eclipse.e4.core.di.annotations.CanExecute;
 import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.MApplication;
 import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
 import org.eclipse.e4.ui.workbench.modeling.EPartService;
 import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
 
 public class OpenPartHandler {
 
     @Execute
-    public void execute(ParameterizedCommand commandParameters, EPartService partService) {
+    public void execute(ParameterizedCommand commandParameters, EPartService partService, MApplication application, EModelService modelService) {
 
         if (null == commandParameters) {
             return;
@@ -21,6 +24,14 @@ public class OpenPartHandler {
         Map parameterMap = commandParameters.getParameterMap();
         String partId = parameterMap.get(AppModelId.COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTNAME).toString();
         MPart part = partService.createPart(partId);
+        //Add to part stack
+        String partStackId = parameterMap.get(AppModelId.COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTSTACKID).toString();
+        if(partStackId!=null){
+            MPartStack partStack = WorkbenchUtility.getPartStack(partStackId, application, modelService);
+            if(partStack!=null){
+                partStack.getChildren().add(part);
+            }
+        }
         part = partService.showPart(part, PartState.ACTIVATE);
     }
 
