commit 0b7e08834f03d3e7ce2ea6c1f55c908a14d76758
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Tue Nov 19 14:46:23 2019 +0100

    fix #8703 Open term search and specimen (import) search to editor area

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportViewE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportViewE4.java
index 704e1aea5..386a3c5da 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportViewE4.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportViewE4.java
@@ -52,6 +52,7 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
 
 /**
  * View which shows a list of "data" that can be imported into the CDM
@@ -61,7 +62,7 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
  * @param <T> the CDM type that will be handled by this view
  */
 public abstract class DataImportViewE4<T> implements IPartContentHasFactualData,
-IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener{
+IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener, IEditorAreaPart{
 
     protected final Logger logger = Logger.getLogger(DataImportViewE4.class);
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SpecimenSearchWizardE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SpecimenSearchWizardE4.java
index b40263785..6887282b3 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SpecimenSearchWizardE4.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SpecimenSearchWizardE4.java
@@ -19,7 +19,10 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.e4.core.contexts.ContextInjectionFactory;
 import org.eclipse.e4.core.contexts.IEclipseContext;
+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;
 import org.eclipse.jface.wizard.Wizard;
@@ -36,6 +39,8 @@ import eu.etaxonomy.cdm.io.specimen.abcd206.in.UnitAssociationWrapper;
 import eu.etaxonomy.taxeditor.store.AppModelId;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.dataimport.QueryType;
+import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
 
 /**
  * Wizard for querying specimen provider.
@@ -52,6 +57,12 @@ public class SpecimenSearchWizardE4 extends Wizard {
     @Inject
     private EPartService partService;
 
+    @Inject
+    private MApplication application;
+
+    @Inject
+    private EModelService modelService;
+
     private IEclipseContext context;
 
     /**
@@ -86,13 +97,13 @@ public class SpecimenSearchWizardE4 extends Wizard {
         try {
             serviceWrapper = providerSelectionPage.getQueryServiceWrapper();
             InputStream stream = null;
-
+            MPart part = null;
             if (providerSelectionPage.getQueryType().equals(QueryType.BIOCASE)){
                 stream =((BioCaseQueryServiceWrapper) serviceWrapper).query(query, configurator.getSourceUri());
                 SpecimenImportReport report = new SpecimenImportReport();
                 UnitAssociationWrapper unitNodesList = AbcdParseUtility.parseUnitsNodeList(stream, report);
 
-                MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4);
+                part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4);
                 part = partService.showPart(part, PartState.ACTIVATE);
                 SpecimenImportViewE4 specimenImportView = (SpecimenImportViewE4) part.getObject();
                 specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
@@ -101,7 +112,7 @@ public class SpecimenSearchWizardE4 extends Wizard {
                 dataImportView = specimenImportView;
 
             } else{
-                MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4);
+                part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4);
                 part = partService.showPart(part, PartState.ACTIVATE);
                 GbifResponseImportViewE4 gbifImportView = (GbifResponseImportViewE4) part.getObject();
                 gbifImportView.setQuery(query);
@@ -109,6 +120,13 @@ public class SpecimenSearchWizardE4 extends Wizard {
                 dataImportView = gbifImportView;
 
             }
+            if(part.getObject() instanceof IEditorAreaPart){
+                MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
+                if(editorAreaPartStack!=null){
+                    editorAreaPartStack.getChildren().add(part);
+                }
+                part = partService.showPart(part, PartState.VISIBLE);
+            }
         } catch (IOException e) {
             e.printStackTrace();
         }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearch.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearch.java
index ab9ba09fd..8001df723 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearch.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearch.java
@@ -14,13 +14,14 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
 import eu.etaxonomy.taxeditor.view.search.facet.SearchComposite;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
 
 /**
  * @author pplitzner
  * @since Jan 22, 2019
  *
  */
-public class TermSearch {
+public class TermSearch implements IEditorAreaPart{
 
     @SuppressWarnings("unused")
     @PostConstruct
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 3e8ea8861..8a04d3b21 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
@@ -13,7 +13,7 @@ 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;
 
-import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
 
 public class OpenPartHandler {
 
@@ -27,7 +27,7 @@ public class OpenPartHandler {
         String partId = parameterMap.get(AppModelId.COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTNAME).toString();
         MPart part = partService.createPart(partId);
         part = partService.showPart(part, PartState.ACTIVATE);
-        if(part.getObject() instanceof IE4SavablePart){
+        if(part.getObject() instanceof IEditorAreaPart){
             MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
             if(editorAreaPartStack!=null){
                 editorAreaPartStack.getChildren().add(part);
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IE4SavablePart.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IE4SavablePart.java
index 2596bc243..096bfdc9c 100644
--- a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IE4SavablePart.java
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IE4SavablePart.java
@@ -23,7 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
  * @since Jun 28, 2017
  *
  */
-public interface IE4SavablePart {
+public interface IE4SavablePart extends IEditorAreaPart{
     //FIXME E4
 
     /**
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IEditorAreaPart.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IEditorAreaPart.java
new file mode 100644
index 000000000..fe2cda321
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IEditorAreaPart.java
@@ -0,0 +1,20 @@
+// $Id$
+/**
+* Copyright (C) 2019 EDIT
+* 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.
+*/
+package eu.etaxonomy.taxeditor.workbench.part;
+
+/**
+ * Implementing parts will be opened in the editor area.
+ * @author pplitzner
+ * @date 19.11.2019
+ *
+ */
+public interface IEditorAreaPart {
+
+}
