commit 0800831bc0403bd2c06f9ade95e4864f8a5a2779
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Wed Jan 30 08:28:24 2019 +0100

    ref #6806 Disable export context menu for feature nodes

diff --git a/eu.etaxonomy.taxeditor.store/fragment.e4xmi b/eu.etaxonomy.taxeditor.store/fragment.e4xmi
index ec32a996b..907b66c8d 100644
--- a/eu.etaxonomy.taxeditor.store/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.store/fragment.e4xmi
@@ -24,6 +24,7 @@
         <children xsi:type="menu:HandledMenuItem" xmi:id="_QXkWYNjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.copy" label="%handledmenuitem.label.13" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/copy_edit.png" command="_cMyQ4NjyEeidDMMI9xTsbQ"/>
         <children xsi:type="menu:MenuSeparator" xmi:id="_So5f0NjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.store.menuseparator.7"/>
         <children xsi:type="menu:Menu" xmi:id="_jPawUPhmEei8uPv-H2wqnw" elementId="eu.etaxonomy.taxeditor.store.menu.export" label="%menu.label.4">
+          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_QGF5kCRZEemBIp_HwXtqoA" coreExpressionId="isFeatureTree"/>
           <children xsi:type="menu:HandledMenuItem" xmi:id="_7vaEcGcqEee0qLTtA2ZpVQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportFeatureTreeOwl" label="%handledmenuitem.label.14" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_xyZ4oPhmEei8uPv-H2wqnw">
             <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_-91IQGcqEee0qLTtA2ZpVQ" coreExpressionId="isShowExperimentalFeatures"/>
           </children>
diff --git a/eu.etaxonomy.taxeditor.store/plugin.xml b/eu.etaxonomy.taxeditor.store/plugin.xml
index f2989764a..48160be9f 100755
--- a/eu.etaxonomy.taxeditor.store/plugin.xml
+++ b/eu.etaxonomy.taxeditor.store/plugin.xml
@@ -117,6 +117,13 @@
         properties="hasPermissions, hasRoles"
         type="org.eclipse.jface.viewers.IStructuredSelection">
    </propertyTester>
+   <propertyTester
+         class="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester"
+         id="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester"
+         namespace="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester"
+         properties="isFeatureTree"
+         type="org.eclipse.jface.viewers.IStructuredSelection">
+   </propertyTester>
 </extension>
 <extension
       point="org.eclipse.core.expressions.definitions">
@@ -258,6 +265,15 @@
                property="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester.isChecklistEditorEnabled">
          </test>
       </definition>
+      <definition
+            id="isFeatureTree">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.featuretree.FeatureTreePropertyTester.isFeatureTree">
+            </test>
+         </with>
+      </definition>
 </extension>
 <extension
       point="org.eclipse.ui.activities">
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreePropertyTester.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreePropertyTester.java
new file mode 100644
index 000000000..40b8fa209
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreePropertyTester.java
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.featuretree;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import eu.etaxonomy.cdm.model.description.FeatureTree;
+
+/**
+ * Property tester used by the feature tree menu.
+ *
+ * @author pplitzner
+ * @since Jan 30, 2019
+ *
+ */
+public class FeatureTreePropertyTester extends PropertyTester {
+
+	private static final String FEATURE_TREE= "isFeatureTree"; //$NON-NLS-1$
+
+	@Override
+    public boolean test(Object receiver, String property, Object[] args,
+			Object expectedValue) {
+
+	    Object[] selectedElements = ((IStructuredSelection) receiver).toArray();
+
+	    if(selectedElements.length == 0){
+			// nothing selected so all tests should fail
+			return false;
+		}
+
+		if(FEATURE_TREE.equals(property)){
+		    return isFeatureTree(selectedElements);
+		}
+		else{
+			return false;
+		}
+	}
+
+	private boolean isFeatureTree(Object[] selectedElements) {
+	    for (Object object : selectedElements){
+	        if(!(object instanceof FeatureTree)){
+	            return false;
+	        }
+	    }
+	    return true;
+	}
+
+}
