commit 6268cff825d8563faf29831e299e00466d5bfa2e
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Thu Nov 22 14:23:43 2018 +0100

    ref #7923 Extract common interface for feature tree editors

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
index 3a53e1b2f..895cffdfc 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
@@ -52,11 +52,8 @@ import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 import eu.etaxonomy.taxeditor.workbench.part.IE4ViewerPart;
 
 /**
@@ -65,9 +62,9 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4ViewerPart;
  * @date 06.06.2017
  *
  */
-public class FeatureTreeEditor implements ICdmEntitySessionEnabled, ISelectionChangedListener,
-        IE4ViewerPart, IE4SavablePart, IPartContentHasDetails, IPartContentHasSupplementalData,
-        IContextListener, IConversationEnabled, IDirtyMarkable, IPostOperationEnabled {
+public class FeatureTreeEditor implements IFeatureTreeEditor, ISelectionChangedListener,
+        IE4ViewerPart, IPartContentHasDetails, IPartContentHasSupplementalData,
+        IContextListener, IConversationEnabled, IDirtyMarkable {
 
     private ConversationHolder conversation;
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/IFeatureTreeEditor.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/IFeatureTreeEditor.java
new file mode 100644
index 000000000..0b8daaac4
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/IFeatureTreeEditor.java
@@ -0,0 +1,22 @@
+/**
+* Copyright (C) 2018 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.featuretree.e4;
+
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
+
+/**
+ * @author pplitzner
+ * @since Nov 22, 2018
+ *
+ */
+public interface IFeatureTreeEditor extends IPostOperationEnabled, IE4SavablePart, ICdmEntitySessionEnabled {
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddChildFeatureHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddChildFeatureHandler.java
index 2f71c8a6f..95efe5f00 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddChildFeatureHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddChildFeatureHandler.java
@@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureNode;
 import eu.etaxonomy.taxeditor.featuretree.AvailableFeaturesWizard;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.featuretree.e4.operation.AddFeatureOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -44,7 +44,7 @@ public class AddChildFeatureHandler {
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
             UISynchronize sync) {
-        FeatureTreeEditor editor = ((FeatureTreeEditor) thisPart.getObject());
+        IFeatureTreeEditor editor = ((IFeatureTreeEditor) thisPart.getObject());
         if (StoreUtil.checkDirty(editor)) {
             return;
         }
@@ -69,7 +69,7 @@ public class AddChildFeatureHandler {
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             MHandledMenuItem menuItem) {
         boolean canExecute = false;
-        canExecute = thisPart.getObject() instanceof FeatureTreeEditor
+        canExecute = thisPart.getObject() instanceof IFeatureTreeEditor
                 && selection!=null
                 && selection.size()==1
                 && selection.getFirstElement() instanceof FeatureNode;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddFeatureHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddFeatureHandler.java
index 6c2708087..2bc0a2ac0 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddFeatureHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/AddFeatureHandler.java
@@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Shell;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.taxeditor.featuretree.AvailableFeaturesWizard;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.featuretree.e4.operation.AddFeatureOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -43,7 +43,7 @@ public class AddFeatureHandler {
     public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
             @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart, UISynchronize sync) {
-        FeatureTreeEditor editor = ((FeatureTreeEditor) thisPart.getObject());
+        IFeatureTreeEditor editor = ((IFeatureTreeEditor) thisPart.getObject());
 
         if (StoreUtil.checkDirty(editor)) {
             return;
@@ -69,7 +69,7 @@ public class AddFeatureHandler {
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             MHandledMenuItem menuItem) {
         boolean canExecute = false;
-        canExecute = thisPart.getObject() instanceof FeatureTreeEditor
+        canExecute = thisPart.getObject() instanceof IFeatureTreeEditor
                 && selection!=null
                 && selection.size()==1
                 && selection.getFirstElement() instanceof FeatureTree;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CopyFeatureHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CopyFeatureHandler.java
index 7f6a39267..3394d9add 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CopyFeatureHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CopyFeatureHandler.java
@@ -13,13 +13,12 @@ import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.description.FeatureNode;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 
 public class CopyFeatureHandler {
 
     @Execute
-    public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part,
-            @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection){
+    public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection){
         LocalSelectionTransfer.getTransfer().setSelection(selection);
     }
 
@@ -28,7 +27,7 @@ public class CopyFeatureHandler {
             @Named(IServiceConstants.ACTIVE_PART) MPart part,
             MHandledMenuItem menuItem){
         boolean canExecute = false;
-        canExecute =part.getObject() instanceof FeatureTreeEditor
+        canExecute =part.getObject() instanceof IFeatureTreeEditor
                 && selection!=null
                 && selection.size()==1
                 && selection.getFirstElement() instanceof FeatureNode;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CreateFeatureTreeHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CreateFeatureTreeHandler.java
index 427a07981..a632e03a5 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CreateFeatureTreeHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/CreateFeatureTreeHandler.java
@@ -18,7 +18,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
 import org.eclipse.e4.ui.services.IServiceConstants;
 
 import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.featuretree.e4.operation.CreateFeatureTreeOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -32,7 +32,7 @@ public class CreateFeatureTreeHandler {
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart thisPart, UISynchronize sync){
-        FeatureTreeEditor editor = (FeatureTreeEditor) thisPart.getObject();
+        IFeatureTreeEditor editor = (IFeatureTreeEditor) thisPart.getObject();
 
         if (StoreUtil.checkDirty(editor)) {
             return;
@@ -50,7 +50,7 @@ public class CreateFeatureTreeHandler {
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             MHandledMenuItem menuItem) {
         boolean canExecute = false;
-        canExecute = thisPart.getObject() instanceof FeatureTreeEditor;
+        canExecute = thisPart.getObject() instanceof IFeatureTreeEditor;
         menuItem.setVisible(canExecute);
         return canExecute;
     }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/FeatureTreeExportHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/FeatureTreeExportHandler.java
index 16c64741c..9d867866d 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/FeatureTreeExportHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/FeatureTreeExportHandler.java
@@ -28,8 +28,9 @@ import org.eclipse.ui.progress.IProgressConstants;
 import eu.etaxonomy.cdm.io.descriptive.word.out.WordExportConfigurator;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.taxeditor.featuretree.e4.FeatureNodeDropAdapter;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -44,7 +45,7 @@ public class FeatureTreeExportHandler {
     public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
             @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart){
-        FeatureTreeEditor editor = (FeatureTreeEditor) thisPart.getObject();
+        IFeatureTreeEditor editor = (IFeatureTreeEditor) thisPart.getObject();
 
         if (editor.isDirty()) {
             if (MessagingUtils.confirmDialog(FeatureNodeDropAdapter.SAVE_CHANGES_TITLE,
@@ -75,7 +76,7 @@ public class FeatureTreeExportHandler {
             @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
             MHandledMenuItem menuItem) {
         boolean canExecute = false;
-        canExecute = PreferencesUtil.getBooleanValue(PreferencesUtil.SHOW_EXPERIMENTAL_FEATURES)
+        canExecute = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES)
                 && selection!=null
                 && selection.size()==1
                 && selection.getFirstElement() instanceof FeatureTree;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/PasteFeatureHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/PasteFeatureHandler.java
index f41124389..1fe976a3a 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/PasteFeatureHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/PasteFeatureHandler.java
@@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.description.FeatureNode;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.featuretree.e4.operation.AddFeatureOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -25,7 +25,7 @@ public class PasteFeatureHandler {
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part,
             @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection, UISynchronize sync){
-        FeatureTreeEditor editor = (FeatureTreeEditor)part.getObject();
+        IFeatureTreeEditor editor = (IFeatureTreeEditor)part.getObject();
 
         if (StoreUtil.checkDirty(editor)) {
             return;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureHandler.java
index cc7b4d0ef..fa940a724 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureHandler.java
@@ -20,11 +20,10 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.description.FeatureNode;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.featuretree.e4.operation.RemoveFeatureOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
-import eu.etaxonomy.taxeditor.workbench.part.IE4ViewerPart;
 
 /**
  * @author pplitzner
@@ -36,7 +35,7 @@ public class RemoveFeatureHandler {
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, UISynchronize sync){
-        FeatureTreeEditor editor = (FeatureTreeEditor) thisPart.getObject();
+        IFeatureTreeEditor editor = (IFeatureTreeEditor) thisPart.getObject();
 
         if (StoreUtil.checkDirty(editor)) {
             return;
@@ -63,7 +62,7 @@ public class RemoveFeatureHandler {
                 canExecute &= object instanceof FeatureNode;
             }
         }
-        canExecute &= thisPart.getObject() instanceof IE4ViewerPart;
+        canExecute &= thisPart.getObject() instanceof IFeatureTreeEditor;
         menuItem.setVisible(canExecute);
         return canExecute;
     }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureTreeHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureTreeHandler.java
index a3651d448..a4b14b9d1 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureTreeHandler.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/RemoveFeatureTreeHandler.java
@@ -20,7 +20,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor;
+import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
 import eu.etaxonomy.taxeditor.featuretree.e4.operation.RemoveFeatureTreeOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -35,7 +35,7 @@ public class RemoveFeatureTreeHandler {
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, UISynchronize sync){
-        FeatureTreeEditor editor = (FeatureTreeEditor) thisPart.getObject();
+        IFeatureTreeEditor editor = (IFeatureTreeEditor) thisPart.getObject();
 
         if (StoreUtil.checkDirty(editor)) {
             return;
@@ -62,7 +62,7 @@ public class RemoveFeatureTreeHandler {
                 canExecute &= object instanceof FeatureTree;
             }
         }
-        canExecute &= thisPart.getObject() instanceof FeatureTreeEditor;
+        canExecute &= thisPart.getObject() instanceof IFeatureTreeEditor;
         menuItem.setVisible(canExecute);
         return canExecute;
     }
