fix #5524
authorKatja Luther <k.luther@bgbm.org>
Thu, 21 Apr 2016 12:06:44 +0000 (14:06 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 21 Apr 2016 12:06:44 +0000 (14:06 +0200)
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java

index a2287ed..993ee94 100644 (file)
                   label="%command.label.12"
                   style="push">
                <visibleWhen>
+               <and>
                   <not>
                      <or>
                         <reference
                         <reference
                               definitionId="isMisapplication">
                         </reference>
-                        <reference
-                              definitionId="isHomotypicSynonymOfAcceptedTaxon">
-                        </reference>
                      </or>
-                  </not>
+                     </not>
+                       <reference
+                              definitionId="isNotHomotypicSynonymOfAcceptedTaxon">
+                        </reference>
+                  </and>
                </visibleWhen>
             </command>
             <command
                   label="%command.label.56"
                   style="push">
                <visibleWhen>
+                  <and>
                    <reference
                          definitionId="isSynonym">
                    </reference>
+                   <reference
+                         definitionId="isNotHomotypicSynonymOfAcceptedTaxon">
+                   </reference>
+                   </and>
                 </visibleWhen>
           </command>
          <separator
          <with
                variable="selection">
             <test
-                  property="eu.etaxonomy.taxeditor.editor.name.propertyTester.isHomotypicSynonymOfAcceptedTaxon">
+                  property="eu.etaxonomy.taxeditor.editor.name.propertyTester.isNotHomotypicSynonymOfAcceptedTaxon">
             </test>
          </with>
       </definition>
             class="eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester"
             id="eu.etaxonomy.taxeditor.editor.name.propertyTester"
             namespace="eu.etaxonomy.taxeditor.editor.name.propertyTester"
-            properties="isAcceptedTaxon,isSynonym,isMisapplication,isTaxonBase,hasEmptyNames,isAcceptedAndHasNoHomotypicSynonyms"
+            properties="isAcceptedTaxon,isSynonym,isMisapplication,isTaxonBase,hasEmptyNames,isAcceptedAndHasNoHomotypicSynonyms,isNotHomotypicSynonymOfAcceptedTaxon"
             type="org.eclipse.jface.viewers.IStructuredSelection">
       </propertyTester>
       <propertyTester
index 270d9aa..8569346 100644 (file)
@@ -35,8 +35,8 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
        private static final String CONCEPT = "isConceptRelation";
        private static final String EMPTY_NAMES = "hasEmptyNames";
        private static final String ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS = "isAcceptedAndHasNoHomotypicSynonyms";
-       private static final String HOMOTYPIC_SYNONYM_OF_ACCEPTED = "isHomotypicSynonymOfAcceptedTaxon";
-       
+       private static final String NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED = "isNotHomotypicSynonymOfAcceptedTaxon";
+
 
        /**
         * <p>Constructor for NameEditorMenuPropertyTester.</p>
@@ -78,10 +78,10 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
                        }
                        else if(ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS.equals(property)){
                                return isAcceptedAndHasNoHomotypicSynonyms(selectedElement);
-                       }else if (HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){
-                               return isHomotypicSynonymOfAcceptedTaxon(selectedElement);
+                       }else if (NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){
+                               return isNotHomotypicSynonymOfAcceptedTaxon(selectedElement);
                        }
-                       
+
                }
 
                return false;
@@ -95,8 +95,8 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
                }
                return false;
        }
-       
-       private boolean isHomotypicSynonymOfAcceptedTaxon(Object selectedElement) {
+
+       private boolean isNotHomotypicSynonymOfAcceptedTaxon(Object selectedElement) {
                if (isSynonym(selectedElement)){
                        Synonym synonym = (Synonym) selectedElement;
                        for (Taxon taxon:synonym.getAcceptedTaxa()){