revert the commit, which is already in hotfix branch
authorKatja Luther <k.luther@bgbm.org>
Thu, 4 Feb 2016 14:07:11 +0000 (15:07 +0100)
committerKatja Luther <k.luther@bgbm.org>
Thu, 4 Feb 2016 14:07:11 +0000 (15:07 +0100)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeSynonymToAcceptedTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java

index 5d5f449d254145e6c856a80a7e762fa58df015c8..c6a9a0cd843ad506a4354b548984f49fc1f9b0be 100644 (file)
@@ -89,9 +89,9 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
                TaxonNode parentNode = (TaxonNode) HibernateProxyHelper.deproxy(((TaxonEditorInput) input).getTaxonNode().getParent());
 
                List<UUID> excludeTaxa = new ArrayList<UUID>();
-               //excludeTaxa.add(taxon.getUuid());//there are some cases where the accepted taxon should be the parent of the new created accepted taxon
+               excludeTaxa.add(taxon.getUuid());
 
-               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select parent", null, null, ((TaxonEditorInput) input).getTaxonNode().getClassification());
+               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select parent", excludeTaxa, null, ((TaxonEditorInput) input).getTaxonNode().getClassification());
 
 
                if(newParentNode != null){
index 5c7ca9a444c804c7227f318ce0a71990876edc87..73c2f94d0eeb09e1a0c80aa04ed91d2a75adbd4c 100644 (file)
@@ -35,8 +35,6 @@ 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 NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED = "isNotHomotypicSynonymOfAcceptedTaxon";
-       
 
        /**
         * <p>Constructor for NameEditorMenuPropertyTester.</p>
@@ -78,10 +76,7 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
                        }
                        else if(ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS.equals(property)){
                                return isAcceptedAndHasNoHomotypicSynonyms(selectedElement);
-                       }else if (NOT_HOMOTYPIC_SYNONYM_OF_ACCEPTED.equals(property)){
-                               return isNotHomotypicSynonymOfAcceptedTaxon(selectedElement);
                        }
-                       
                }
 
                return false;
@@ -95,19 +90,6 @@ public class NameEditorMenuPropertyTester extends org.eclipse.core.expressions.P
                }
                return false;
        }
-       
-       private boolean isNotHomotypicSynonymOfAcceptedTaxon(Object selectedElement) {
-               if (isSynonym(selectedElement)){
-                       Synonym synonym = (Synonym) selectedElement;
-                       for (Taxon taxon:synonym.getAcceptedTaxa()){
-                               if (taxon.getHomotypicGroup().equals(synonym.getHomotypicGroup())){
-                                       return false;
-                               }
-                       }
-               }
-               return true;
-       }
-
 
        /**
         * @param receiver
index dbe283bd139a00b7d8af8f2c6accaa200a55b966..6368cdfeaa57b8723f7c2f6fab942663cf582ac8 100644 (file)
@@ -16,7 +16,6 @@ import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -53,8 +52,6 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITaxonTreeNode>{
             getConversationHolder().bind();
             ITaxonTreeNode parent = getParentTreeNode();
             Taxon taxon = taxonNodePage.getTaxon();
-            Reference sec = taxon.getSec();
-            taxon.setSec(null);
             try{
                UpdateResult result = CdmStore.getService(ITaxonNodeService.class).createNewTaxonNode(parent.getUuid(), taxon, parent.getReference(), parent.getMicroReference());
                        
@@ -67,8 +64,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITaxonTreeNode>{
                 }*/
                generatedTaxonNodeUuid = result.getCdmEntity().getUuid();
                TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);
-               taxonNode.getTaxon().setSec(sec);
-               CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
+
                 Set<CdmBase> affectedObjects = new HashSet<CdmBase>();
                 if (result.getUpdatedObjects().iterator().hasNext()){
                        TaxonNode parentNode = (TaxonNode)result.getUpdatedObjects().iterator().next();
index 043587499ddc7955ad65fd147b547c2f603a59f5..037e7c75b273fab57cb75a446d55be2c28fe7008 100644 (file)
@@ -145,7 +145,6 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                         }
                     }
                 }
-               
             }
         }
     }
@@ -275,8 +274,8 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
        private void setTaxon(TaxonNameBase taxonName) {
                Reference secundum = null;
                if (getParentTreeNode() != null) {
-                       if (this.selection_SecRef.getEntity() != null){
-                               secundum = this.selection_SecRef.getEntity();
+                       if (this.secReference != null){
+                               secundum = this.secReference;
                        } /*else if (getParentTreeNode() instanceof Classification) {
                                secundum = ((Classification) getParentTreeNode())
                                                .getReference();
index 8bb34daab95938ad6e3f9b230cee5b9692da0209..2a07ef5f8c91e187718e66a4e374071c7dbfee8f 100644 (file)
@@ -8,7 +8,6 @@ import java.util.Observable;
 import java.util.Observer;
 
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -420,10 +419,6 @@ public class EntitySelectionElement<T extends CdmBase> extends
                /** {@inheritDoc} */
                @Override
                public void widgetSelected(SelectionEvent e) {
-                       if (StoreUtil.getActiveEditor().isDirty()){
-                               MessageDialog.openInformation(null,"Save changes", "You have made changes that must be saved before this query can be executed");
-                               return;
-                       }
                        WizardDialog dialog = new WizardDialog(selectionElement.getShell(),
                                        new EditFromSelectionWizard(selectionElement));
                        if (dialog.open() == IStatus.OK) {