set flag... should not be enabled for classifications
authorKatja Luther <k.luther@bgbm.org>
Thu, 24 Oct 2019 09:45:14 +0000 (11:45 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 24 Oct 2019 09:45:14 +0000 (11:45 +0200)
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodePropertyTester.java

index c613b8e65eeb41a1738fb4da77fd5193ec55e789..b1ffe6c9db15c489c44f0e9d1549c4e70d6b5ad9 100644 (file)
@@ -46,7 +46,7 @@
             class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester"
             id="eu.etaxonomy.taxeditor.navigation.navigator.navigatorPropertyTester"
             namespace="eu.etaxonomy.taxeditor.navigation.navigator.navigatorPropertyTester"
-            properties="hasSynonyms,isClassification,isUnplaced,isExcluded,noClassificationExists"
+            properties="hasSynonyms,isClassification,isUnplaced,isExcluded,noClassificationExists,isNotClassification"
             type="java.lang.Object">
       </propertyTester>
       
          <test
                property="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester.isClassification">
          </test>
+      </definition>
+       <definition
+            id="isNotClassification">
+         <test
+               property="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester.isNotClassification">
+         </test>
       </definition>
       <definition
             id="isUnplaced">
index bb3caec055b5b5075418ae5c353ecb545dcc2e17..d7e427d5bb3252b8dddeb2a441cf4c3ef461cc12 100644 (file)
@@ -22,8 +22,9 @@ public class TaxonNodePropertyTester extends PropertyTester {
        private static final Object HAS_SYNONYMS = "hasSynonyms"; //$NON-NLS-1$
        private static final Object HAS_TAXA = "hasTaxa"; //$NON-NLS-1$
        private static final Object IS_CLASSIFICATION = "isClassification"; //$NON-NLS-1$
-       private static final Object IS_UNPLACED = "isUnplaced";
-       private static final Object IS_EXCLUDED = "isExcluded";
+       private static final Object IS_NOT_CLASSIFICATION = "isNotClassification"; //$NON-NLS-1$
+       private static final Object IS_UNPLACED = "isUnplaced"; //$NON-NLS-1$
+       private static final Object IS_EXCLUDED = "isExcluded"; //$NON-NLS-1$
     private static final Object NO_CLASSIFICATION_EXIST = "noClassificationExist";
        /** {@inheritDoc} */
        @Override
@@ -53,13 +54,17 @@ public class TaxonNodePropertyTester extends PropertyTester {
                        TaxonNodeDto node = (TaxonNodeDto) receiver;
                        return node.getTaxonUuid() == null;
                }
+               if (receiver instanceof TaxonNodeDto && IS_NOT_CLASSIFICATION.equals(property)) {
+            TaxonNodeDto node = (TaxonNodeDto) receiver;
+            return node.getTaxonUuid() != null;
+        }
                if (receiver instanceof TaxonNodeDto && IS_UNPLACED.equals(property)) {
             TaxonNodeDto node = (TaxonNodeDto) receiver;
-            return node.isUnplaced();
+            return node.isUnplaced() && node.getTaxonUuid() != null;
         }
                if (receiver instanceof TaxonNodeDto && IS_EXCLUDED.equals(property)) {
             TaxonNodeDto node = (TaxonNodeDto) receiver;
-            return node.isExcluded();
+            return node.isExcluded() && node.getTaxonUuid() != null;
         }
                if (NO_CLASSIFICATION_EXIST.equals(property)) {
            return 0 == CdmStore.getService(IClassificationService.class).count(Classification.class);