improve performance by first checking preference then checking DB for classification
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 2 Apr 2021 01:12:21 +0000 (03:12 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 2 Apr 2021 01:12:21 +0000 (03:12 +0200)
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewClassificationHandlerE4.java

index 832003dbfa2c8936a9d0034df94c2c59915121d3..3a4e18062ada7522bed1c4b41684bdf295b7bbcd 100644 (file)
@@ -47,7 +47,8 @@ public class NewClassificationHandlerE4 {
     private boolean canExecute(MHandledMenuItem menuItem){
         boolean canExecute = false;
 
-        canExecute = TaxonNodePropertyTester.noClassifiactionExists() || !PreferencesUtil.getBooleanValue(PreferencePredicate.DisableMultiClassification.getKey());
+        //TODO Performance check for existing classification causes server call, this should be cached somehow
+        canExecute = !PreferencesUtil.getBooleanValue(PreferencePredicate.DisableMultiClassification.getKey()) || TaxonNodePropertyTester.noClassifiactionExists();
         menuItem.setVisible(canExecute);
         return canExecute;
     }