commit eaff13387b8ea194ba8e94df58fbaab85abc9b15
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Thu Aug 31 12:05:08 2017 +0200

    ref #6595 refactor selection handling to migrated name editor

diff --git a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
index 4cfa0860b..bf8ceaaff 100644
--- a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
+++ b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
@@ -7,6 +7,7 @@ Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: OSGI-INF/l10n/plugin
 Export-Package: eu.etaxonomy.taxeditor.editor,
+ eu.etaxonomy.taxeditor.editor.e4,
  eu.etaxonomy.taxeditor.editor.handler,
  eu.etaxonomy.taxeditor.editor.handler.defaultHandler,
  eu.etaxonomy.taxeditor.editor.internal,
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptContentProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptContentProvider.java
index cc32fdea7..1e8fb067c 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptContentProvider.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptContentProvider.java
@@ -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.
 */
@@ -18,7 +18,7 @@ import org.eclipse.jface.viewers.Viewer;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
 
 /**
  * @author n.hoffmann
@@ -29,7 +29,7 @@ public class ConceptContentProvider implements IStructuredContentProvider {
 
 	@Override
 	public void dispose() {
-		
+
 	}
 
 	@Override
@@ -39,15 +39,15 @@ public class ConceptContentProvider implements IStructuredContentProvider {
 	@Override
 	public Object[] getElements(Object inputElement) {
 		Taxon taxon = null;
-		if(inputElement instanceof TaxonEditorInput){
-			taxon = ((TaxonEditorInput) inputElement).getTaxon();
+		if(inputElement instanceof TaxonEditorInputE4){
+			taxon = ((TaxonEditorInputE4) inputElement).getTaxon();
 		}
 		else if(inputElement instanceof Taxon){
 			taxon = (Taxon) inputElement;
 		}
 		if(taxon!=null){
 			Map<TaxonRelationship, Taxon> taxonToTaxonRelationsMap = new HashMap<>();
-			
+
 			for (TaxonRelationship relationship : taxon.getTaxonRelations()) {
 				if (! relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR()) ||
 						 relationship.getType().equals(TaxonRelationshipType.TAXONOMICALLY_INCLUDED_IN())) {
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
index 646a66b35..b329bd10d 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
@@ -28,7 +28,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.ViewerSorter;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
 
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
@@ -90,7 +89,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 			showEmptyPage();
 		}
 		else if(partObject instanceof TaxonNameEditorE4){
-		    IEditorInput input = ((IEditorPart) partObject).getEditorInput();
+		    IEditorInput input = ((TaxonNameEditorE4) partObject).getEditorInput();
 		    showViewer(new StructuredSelection(input), activePart, viewer);
 		}
 		else {
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/CreateConceptRelationHandlerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/CreateConceptRelationHandlerE4.java
index 62a138a70..c6edcb44a 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/CreateConceptRelationHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/CreateConceptRelationHandlerE4.java
@@ -27,9 +27,7 @@ import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.Page;
-import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -55,45 +53,45 @@ public class CreateConceptRelationHandlerE4 {
         String commandId = menuItem.getCommand().getElementId();
         UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".taxonRelationshipType.uuid");
         TaxonRelationshipType taxonRelationshipType = HibernateProxyHelper.deproxy(CdmStore.getService(ITermService.class).load(uuid), TaxonRelationshipType.class);
-        TaxonNameEditor editor = null;
 
+        TaxonNameEditorE4 editor = null;
 
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
-            editor = (TaxonNameEditor) ((MultiPageTaxonEditor) e4WrappedPart).getPage(Page.NAME);
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
+            editor = (TaxonNameEditorE4) e4WrappedPart;
+
+            IUndoContext undoContext = null;
+            ConversationHolder conversationHolder = null;
+            Taxon taxon = null;
+            taxon = editor.getTaxon();
+            conversationHolder = editor.getConversationHolder();
+            undoContext = editor.getUndoContext();
+
+            //FIXME should this also be enabled for bulk editor
+            //		else if(activeEditor instanceof BulkEditor){
+            //		    BulkEditor bulkEditor = (BulkEditor)activeEditor;
+            //            ISelection selection = bulkEditor.getSelectionProvider().getSelection();
+            //		    taxon = (Taxon) ((IStructuredSelection)selection).getFirstElement();
+            //		    conversationHolder = bulkEditor.getConversationHolder();
+            //		    undoContext = bulkEditor.getUndoContext();
+            //		}
+
+            Taxon relatedConcept = TaxonBaseSelectionDialog.selectTaxon(shell, conversationHolder, taxon);
+
+
+            if(relatedConcept == null){
+                return;
+            }
+            boolean isInverse = taxonRelationshipType.getInverseLabel().isEmpty()?false:true;
+            TaxonRelationshipTypeInverseContainer typeInverseContainer =new TaxonRelationshipTypeInverseContainer(taxonRelationshipType, isInverse) ;
+
+
+            AbstractPostOperation operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(),
+                    undoContext, taxon, relatedConcept, typeInverseContainer, conceptView);
+            AbstractUtility.executeOperation(operation);
         }
-
-        IUndoContext undoContext = null;
-        ConversationHolder conversationHolder = null;
-        Taxon taxon = null;
-        taxon = editor.getTaxon();
-        conversationHolder = editor.getConversationHolder();
-        undoContext = editor.getUndoContext();
-
-        //FIXME should this also be enabled for bulk editor
-        //		else if(activeEditor instanceof BulkEditor){
-        //		    BulkEditor bulkEditor = (BulkEditor)activeEditor;
-        //            ISelection selection = bulkEditor.getSelectionProvider().getSelection();
-        //		    taxon = (Taxon) ((IStructuredSelection)selection).getFirstElement();
-        //		    conversationHolder = bulkEditor.getConversationHolder();
-        //		    undoContext = bulkEditor.getUndoContext();
-        //		}
-
-        Taxon relatedConcept = TaxonBaseSelectionDialog.selectTaxon(shell, conversationHolder, taxon);
-
-
-        if(relatedConcept == null){
-            return;
-        }
-        boolean isInverse = taxonRelationshipType.getInverseLabel().isEmpty()?false:true;
-        TaxonRelationshipTypeInverseContainer typeInverseContainer =new TaxonRelationshipTypeInverseContainer(taxonRelationshipType, isInverse) ;
-
-
-        AbstractPostOperation operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(),
-                undoContext, taxon, relatedConcept, typeInverseContainer, conceptView);
-        AbstractUtility.executeOperation(operation);
     }
 
     @CanExecute
@@ -103,7 +101,7 @@ public class CreateConceptRelationHandlerE4 {
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        canExecute = e4WrappedPart instanceof MultiPageTaxonEditor;
+        canExecute = e4WrappedPart instanceof TaxonNameEditorE4;
         menuItem.setVisible(canExecute);
         return canExecute;
     }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/DeleteConceptRelationHandlerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/DeleteConceptRelationHandlerE4.java
index 71da526a7..b35fbd874 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/DeleteConceptRelationHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/DeleteConceptRelationHandlerE4.java
@@ -24,9 +24,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.ISelection;
 
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.Page;
-import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.DeleteConceptRelationOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -45,29 +43,29 @@ public class DeleteConceptRelationHandlerE4 {
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
             @Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, MMenuItem menuItem) {
 
-        TaxonNameEditor editor = null;
+        TaxonNameEditorE4 editor = null;
 
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
-            editor = (TaxonNameEditor) ((MultiPageTaxonEditor) e4WrappedPart).getPage(Page.NAME);
-        }
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
+            editor = (TaxonNameEditorE4) e4WrappedPart;
 
-        Set<TaxonRelationship> relations = new HashSet<TaxonRelationship>();
+            Set<TaxonRelationship> relations = new HashSet<TaxonRelationship>();
 
 
-        // FIXME E4 multiple selection
-        //			while (iterator.hasNext()){
-        if(selection instanceof TaxonRelationship){
-            relations.add((TaxonRelationship) selection);
-        }
-        //			}
+            // FIXME E4 multiple selection
+            //			while (iterator.hasNext()){
+            if(selection instanceof TaxonRelationship){
+                relations.add((TaxonRelationship) selection);
+            }
+            //			}
 
-        //editor should not be null because this is already checked in canExecute
-        AbstractPostOperation operation = new DeleteConceptRelationOperation(menuItem.getLocalizedLabel(),
-                editor.getUndoContext(), editor.getTaxon(), relations, conceptView);
-        AbstractUtility.executeOperation(operation);
+            //editor should not be null because this is already checked in canExecute
+            AbstractPostOperation operation = new DeleteConceptRelationOperation(menuItem.getLocalizedLabel(),
+                    editor.getUndoContext(), editor.getTaxon(), relations, conceptView);
+            AbstractUtility.executeOperation(operation);
+        }
     }
 
 	@CanExecute
@@ -77,7 +75,7 @@ public class DeleteConceptRelationHandlerE4 {
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
             ISelection selection = conceptView.getViewer().getSelection();
             canExecute = selection!=null && !selection.isEmpty();
             menuItem.setVisible(canExecute);
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/OpenRelatedConceptHandlerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/OpenRelatedConceptHandlerE4.java
index 89a382d8b..0abbd192f 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/OpenRelatedConceptHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/OpenRelatedConceptHandlerE4.java
@@ -23,8 +23,8 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.model.LineSelection;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -42,14 +42,14 @@ public class OpenRelatedConceptHandlerE4  {
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
             @Optional@Named(IServiceConstants.ACTIVE_SELECTION) TaxonRelationship taxonRelationship) {
 
-        MultiPageTaxonEditor editor = null;
+        TaxonNameEditorE4 editor = null;
         BulkEditor bulkEditor = null;
 
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
-            editor = (MultiPageTaxonEditor) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
+            editor = (TaxonNameEditorE4) e4WrappedPart;
         }
         else if(e4WrappedPart instanceof BulkEditor){
             bulkEditor = (BulkEditor) e4WrappedPart;
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
index e5d30a000..999b258f1 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
@@ -55,8 +55,8 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter.DerivateSearchCompositeController;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IContextListener;
@@ -507,8 +507,8 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
         }
         if(listenToSelectionChange){
             selectedTaxon = null;
-            if(activePart instanceof MultiPageTaxonEditor){
-                selectedTaxon = ((MultiPageTaxonEditor) activePart).getTaxon();
+            if(activePart instanceof TaxonNameEditorE4){
+                selectedTaxon = ((TaxonNameEditorE4) activePart).getTaxon();
             }
             else if(selection instanceof IStructuredSelection){
                 Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
index 8ad5be449..1779f873a 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
@@ -47,8 +47,8 @@ import eu.etaxonomy.cdm.model.description.IDescribable;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;
@@ -168,8 +168,8 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
                 }
             }
             Object firstElement = structuredSelection.getFirstElement();
-            if (partObject instanceof MultiPageTaxonEditor){
-                if (firstElement != ((MultiPageTaxonEditor)partObject).getTaxon()){
+            if (partObject instanceof TaxonNameEditorE4){
+                if (firstElement != ((TaxonNameEditorE4)partObject).getTaxon()){
                     showEmptyPage();
                     return;
                 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DescriptionsMenuPropertyTesterE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DescriptionsMenuPropertyTesterE4.java
index 815c4581c..20ed65f0a 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DescriptionsMenuPropertyTesterE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DescriptionsMenuPropertyTesterE4.java
@@ -11,7 +11,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -160,7 +160,7 @@ public class DescriptionsMenuPropertyTesterE4 extends PropertyTester {
 	}
 
 	private boolean isTaxonEditor() {
-	    if(AbstractUtility.getActiveE4Editor() instanceof MultiPageTaxonEditor){
+	    if(AbstractUtility.getActiveE4Editor() instanceof TaxonNameEditorE4){
 	        return true;
 	    }
 	    return false;
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java
index bf7fd741f..843ce33a5 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java
@@ -38,10 +38,8 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -62,7 +60,7 @@ import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
  */
 public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
     private UUID newAcceptedTaxonNodeUuid;
-    private TaxonNameEditor editor;
+    private TaxonNameEditorE4 editor;
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
@@ -71,8 +69,8 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
 
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
-            editor = (TaxonNameEditor) ((MultiPageTaxonEditor) e4WrappedPart).getPage(Page.NAME);
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
+            editor = (TaxonNameEditorE4) e4WrappedPart;
         }
         Taxon actualTaxon= null;
 
@@ -127,7 +125,7 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
             }
             newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();
 
-            String moveMessage = String.format(Messages.MoveDescriptionElementsHandler_ELEMENTS_MOVED, editor.getEditor().getTaxon());
+            String moveMessage = String.format(Messages.MoveDescriptionElementsHandler_ELEMENTS_MOVED, editor.getTaxon());
 
             AbstractPostOperation operation = new MoveDescriptionElementsOperation(
                     menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(),
@@ -150,10 +148,11 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
                 //AbstractUtility.close(editor.getMultiPageTaxonEditor());
 
                 try {
-                    MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
-                    if(possibleOpenEditor != null){
-                        AbstractUtility.close(possibleOpenEditor);
-                    }
+                    //FIXME E4 migrate
+//                    MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
+//                    if(possibleOpenEditor != null){
+//                        AbstractUtility.close(possibleOpenEditor);
+//                    }
                     EditorUtil.openTaxonNodeE4(newAcceptedTaxonNodeUuid);
                 } catch (PartInitException e) {
                     MessagingUtils.error(this.getClass(), e);
@@ -181,7 +180,7 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
             ISelection selection = factualDataPart.getViewer().getSelection();
             if(selection instanceof IStructuredSelection){
                 Object firstElement = ((IStructuredSelection) selection).getFirstElement();
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java
index 53900d450..60bf6a78d 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java
@@ -21,7 +21,6 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PartInitException;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
@@ -31,15 +30,14 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 
@@ -54,7 +52,7 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
     private MoveDescriptionToOtherTaxonOperation operation;
 
     private UUID newAcceptedTaxonNodeUuid;
-    private MultiPageTaxonEditor editor;
+    private TaxonNameEditorE4 editor;
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
@@ -64,13 +62,13 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
 
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof MultiPageTaxonEditor){
-            editor = (MultiPageTaxonEditor) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonNameEditorE4){
+            editor = (TaxonNameEditorE4) e4WrappedPart;
             if (this.editor.isDirty()){
                 boolean proceed = MessageDialog.openQuestion(null,
                         Messages.MoveDescriptionToOtherTaxonHandler_SAVE_CHANGES, Messages.MoveDescriptionToOtherTaxonHandler_SAVE_CHANGES_MESSAGE);
                 if (proceed) {
-                    editor.doSave(AbstractUtility.getMonitor());
+                    editor.save(AbstractUtility.getMonitor());
                 } else {
                     return;
                 }
@@ -90,15 +88,14 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
 
         // Choose the target taxon
         List<UUID> excludeTaxa = new ArrayList<UUID>();
-        
+
         excludeTaxa.add(descriptions.get(0).getTaxon().getUuid());
 
         //get current taxon node
         TaxonNode node = null;
         Classification classification = null;
-        MultiPageTaxonEditor taxonEditor = EditorUtil.getActiveMultiPageTaxonEditor();
-        if(taxonEditor!=null){
-            node = ((TaxonEditorInput) taxonEditor.getEditorInput()).getTaxonNode();
+        if(editor!=null){
+            node = editor.getEditorInput().getTaxonNode();
             classification = node.getClassification();
         }
         TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
@@ -121,7 +118,7 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
                     newAcceptedTaxonNode,
                     this,
                     editor,
-                    (ICdmEntitySessionEnabled)editor.getEditorInput());
+                    editor.getEditorInput());
             AbstractUtility.executeOperation(operation);
         }
 
@@ -135,17 +132,18 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
 
             @Override
             public void run() {
-                AbstractUtility.close(editor);
-
+                //FIXME E4 migrate
+//                AbstractUtility.close(editor);
+//
                 try {
-                    MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
-                    if(possibleOpenEditor != null){
-                        AbstractUtility.close(possibleOpenEditor);
-                    }
+//                    MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
+//                    if(possibleOpenEditor != null){
+//                        AbstractUtility.close(possibleOpenEditor);
+//                    }
                     EditorUtil.openTaxonNodeE4(newAcceptedTaxonNodeUuid);
-                } catch (PartInitException e) {
-                    MessagingUtils.error(this.getClass(), e);
-                    throw new RuntimeException(e);
+//                } catch (PartInitException e) {
+//                    MessagingUtils.error(this.getClass(), e);
+//                    throw new RuntimeException(e);
                 } catch (Exception e) {
                     MessagingUtils.warningDialog(Messages.MoveDescriptionToOtherTaxonHandler_CREATE_FAILED, this, e.getMessage());
                 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java
index e0b2e328d..df787d1e2 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java
@@ -29,8 +29,8 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Tree;
 
 import eu.etaxonomy.cdm.model.description.IDescribable;
-import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.media.MediaContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.media.MediaLabelProvider;
@@ -104,8 +104,8 @@ public class MediaViewPartE4 extends AbstractCdmEditorPartE4
 	        }
 
 	        Object firstElement = structuredSelection.getFirstElement();
-	        if (partObject instanceof MultiPageTaxonEditor){
-	            if (firstElement != ((MultiPageTaxonEditor)partObject).getTaxon()){
+	        if (partObject instanceof TaxonNameEditorE4){
+	            if (firstElement != ((TaxonNameEditorE4)partObject).getTaxon()){
 	                showEmptyPage();
 	                return;
 	            }
diff --git a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
index 8cde7d596..a95ddb853 100644
--- a/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
+++ b/eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
@@ -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.
 */
@@ -20,14 +20,12 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.jdom.Element;
 
-import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.out.pdf.PdfOutputModule;
 import eu.etaxonomy.cdm.print.out.xml.XMLOutputModule;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
 import eu.etaxonomy.taxeditor.printpublisher.wizard.DirectPublishingWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -39,48 +37,49 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public class GeneratePdfHandler extends AbstractHandler {
-	
+
 	private PublishConfigurator configurator;
 
 	/** {@inheritDoc} */
-	public Object execute(ExecutionEvent event) throws ExecutionException {
+	@Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
 		// make the editors taxon the selected taxon to export
-		IEditorPart editor = HandlerUtil.getActiveEditor(event);	
+		IEditorPart editor = HandlerUtil.getActiveEditor(event);
 
 		IEditorInput input = editor.getEditorInput();
-		
-		if(!(input instanceof TaxonEditorInput)){
+
+		if(!(input instanceof TaxonEditorInputE4)){
 			MessagingUtils.warningDialog("PDF generation not supported for selected input", this, "Generating PDF output is not supported for the current active editor");
-			
+
 			return null;
 		}
-		
-		configurator = PublishConfigurator.NewLocalInstance((ICdmRepository) CdmStore.getCurrentApplicationConfiguration());
-		
-		Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInput) input);
+
+		configurator = PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationConfiguration());
+
+		Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInputE4) input);
 		configurator.addSelectedTaxonNodeElements(taxonNodeElement);
-		
+
 		configurator.setDoPublishEntireBranches(false);
-		
+
 		configurator.addOutputModule(new PdfOutputModule());
 		configurator.addOutputModule(new XMLOutputModule());
-		
+
 		DirectPublishingWizard wizard = new DirectPublishingWizard(configurator);
 		WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), wizard);
-		
+
 		dialog.open();
-		
+
 		return null;
 	}
-	
-	private Element getTaxonNodeElement(TaxonEditorInput input){
-		
+
+	private Element getTaxonNodeElement(TaxonEditorInputE4 input){
+
 		UUID taxonNodeUuid = input.getTaxonNode().getUuid();
-		
+
 		IXMLEntityFactory factory = configurator.getFactory();
-		
+
 		Element taxonNodeElement = factory.getTaxonNode(taxonNodeUuid);
-		
+
 		return taxonNodeElement;
 	}
 }
