Merge branch 'develop' into unify_derivative_views
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Nov 2015 10:07:36 +0000 (11:07 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Nov 2015 10:07:36 +0000 (11:07 +0100)
17 files changed:
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientOccurenceService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/DeleteDerivateOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/RemotingDeleteTaxonNodeHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/EditFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PartialElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.java

index 8247b5d6c70d0e34a7581e3cc808932ae08c8a4c..d6cc82eab6afb4ebd88098025c85e00b3b2df4ea 100644 (file)
@@ -160,4 +160,5 @@ commandParameter.name = taxonUUID
 Bundle-Name = Editor Bundle\r
 command.name.48 = delete\r
 command.name.49 = delete\r
-command.name.50 = delete
\ No newline at end of file
+command.name.50 = delete\r
+command.name.51 = delete
index 97d534dec393cee5b10c5847ec005d388a44b9f7..4d31b47f48c470435630df20f0705bd28fbf6656 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
             name="%command.name.33">
       </command>
+      <command
+            categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
+            defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.DeleteConceptRelationHandler"
+            id="eu.etaxonomy.taxeditor.editor.view.concept.command.delete"
+            name="%command.name.51">
+      </command>
       <category
             id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
             name="%category.name.7">
index 185dfe470d6d5cfd63af911c608f05df05d6fddc..61c2e8cf6d4f379f4732612514628eb4a49cdd0e 100644 (file)
@@ -41,7 +41,6 @@ import eu.etaxonomy.cdm.api.service.search.SearchResult;
 import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
 import eu.etaxonomy.cdm.model.common.Annotation;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.ISourceable;
@@ -58,7 +57,6 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
@@ -917,11 +915,6 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.getNonCascadedAssociatedElements(specimen);
     }
 
-    @Override
-    public DeleteResult deleteDerivateHierarchy(CdmBase from, SpecimenDeleteConfigurator config) {
-        return defaultService.deleteDerivateHierarchy(from, config);
-    }
-
     @Override
     public DeleteResult delete(SpecimenOrObservationBase<?> specimen, SpecimenDeleteConfigurator config) {
         return defaultService.delete(specimen, config);
@@ -988,9 +981,6 @@ public class TransientOccurenceService implements IOccurrenceService {
        }
 
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
-     */
     @Override
     public DeleteResult delete(UUID uuid) {
         return defaultService.delete(uuid);
@@ -1001,54 +991,22 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.delete(arg0);
     }
 
-    @Override
-    public DeleteResult deleteSingleRead(SingleRead singleRead, Sequence sequence){
-        return defaultService.deleteSingleRead(singleRead, sequence);
-    }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List)
-     */
     @Override
     public List<SpecimenOrObservationBase> merge(List<SpecimenOrObservationBase> arg0) {
         return defaultService.merge(arg0);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#deleteDerivateHierarchy(java.util.UUID, eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator)
-     */
-    @Override
-    public DeleteResult deleteDerivateHierarchy(UUID arg0, SpecimenDeleteConfigurator arg1) {
-        return defaultService.deleteDerivateHierarchy(arg0, arg1);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#deleteSingleRead(java.util.UUID, java.util.UUID)
-     */
-    @Override
-    public DeleteResult deleteSingleRead(UUID arg0, UUID arg1) {
-        return defaultService.deleteSingleRead(arg0, arg1);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(java.util.UUID, java.util.UUID, java.util.UUID)
-     */
     @Override
     public UpdateResult moveDerivate(UUID arg0, UUID arg1, UUID arg2) {
         return defaultService.moveDerivate(arg0, arg1, arg2);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.DerivedUnit)
-     */
     @Override
     public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to, DerivedUnit derivate) {
         return defaultService.moveDerivate(from, to, derivate);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveSequence(java.util.UUID, java.util.UUID, java.util.UUID)
-     */
     @Override
     public UpdateResult moveSequence(UUID arg0, UUID arg1, UUID arg2) {
         return defaultService.moveSequence(arg0, arg1, arg2);
@@ -1060,17 +1018,11 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.getMediainHierarchy(arg0, arg1, arg2, arg3);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#merge(java.util.List, boolean)
-     */
     @Override
     public List<MergeResult<SpecimenOrObservationBase>> merge(List<SpecimenOrObservationBase> arg0, boolean arg1) {
         return defaultService.merge(arg0, arg1);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase, boolean)
-     */
     @Override
     public MergeResult<SpecimenOrObservationBase> merge(SpecimenOrObservationBase arg0, boolean arg1) {
         return defaultService.merge(arg0, arg1);
@@ -1085,12 +1037,17 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.listAssociatedTaxa(arg0, arg1, arg2, arg3, arg4);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.service.IService#loadWithUpdate(java.util.UUID)
-     */
     @Override
     public SpecimenOrObservationBase loadWithUpdate(UUID arg0) {
         return defaultService.loadWithUpdate(arg0);
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public DeleteResult delete(UUID arg0, SpecimenDeleteConfigurator arg1) {
+        return defaultService.delete(arg0, arg1);
+    }
+
 }
index 409416da2eb438d3da8ce2adb54417dfbac93e0d..f5956fa1bebf439a99de347d0b52c9efb07a8d8f 100644 (file)
@@ -79,12 +79,12 @@ public class DeleteDerivateOperation extends AbstractPostOperation<CdmBase> {
                 && treeNode.getValue().equals(element)
                 && treeNode.getParent()!=null
                 && treeNode.getParent().getValue() instanceof Sequence){
-            deleteResult = CdmStore.getService(IOccurrenceService.class).deleteSingleRead(((SingleRead)element).getUuid(),
+            deleteResult = CdmStore.getService(ISequenceService.class).deleteSingleRead(((SingleRead)element).getUuid(),
                     ((Sequence) treeNode.getParent().getValue()).getUuid());
         } else if(element instanceof Sequence){
-            deleteResult = CdmStore.getService(ISequenceService.class).delete(element.getUuid(), deleteConfigurator);
+            deleteResult = CdmStore.getService(ISequenceService.class).delete(element.getUuid());
         } else {
-            deleteResult = CdmStore.getService(IOccurrenceService.class).deleteDerivateHierarchy(element.getUuid(), deleteConfigurator);
+            deleteResult = CdmStore.getService(IOccurrenceService.class).delete(element.getUuid(), deleteConfigurator);
         }
         if(deleteResult.isOk()){
             if(getPostOperationEnabled() instanceof DerivateView){
index ecbc76b929bcf8b837d4c8bc0fced02405984fb6..ea3fb60d95574044088195bfcc1cd162e470636c 100644 (file)
@@ -28,7 +28,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
-import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator.ChildHandling;
+import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
 import eu.etaxonomy.cdm.model.common.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
index 236dd72c06059b656f53a205e5f65eeabef20e81..53d23d823d4d7134a388432fccaf96ca30ec0415 100644 (file)
@@ -24,7 +24,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
-import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator.ChildHandling;
+import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
index 6a2038534709ea63958236e57366fcd948d9a4a6..ac9ff958b45ff5dca05480a8533cbb1390e3bdb5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -16,12 +16,16 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.viewers.ISelection;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.ui.IEditorPart;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.DeleteTermBaseOperation;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
 import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -33,42 +37,48 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */\r
 public class DeleteTermBaseHandler extends AbstractHandler {\r
 \r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
-        */\r
        @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               DefinedTermEditor editor = (DefinedTermEditor) HandlerUtil\r
+               IEditorPart editor = HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
+               if (editor.isDirty()){\r
+                       boolean proceed = MessageDialog.openQuestion(null,\r
+                                       "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");\r
+                       if (proceed) {\r
+                               editor.doSave(null);\r
+                       } else {\r
+                               return null;\r
+                       }\r
+               }\r
                if (editor instanceof DefinedTermEditor){\r
-                       DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
-                       try {\r
-                               String label = event.getCommand().getName();\r
-                               IUndoContext undoContext = StoreUtil.getUndoContext();\r
+                   DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
+                   try {\r
+                       String label = event.getCommand().getName();\r
+                       IUndoContext undoContext = StoreUtil.getUndoContext();\r
 \r
-                               IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
-                                               .getCurrentSelection(event);\r
+                       ISelection selection = dfe.getViewer().getSelection();\r
+                       if(selection instanceof IStructuredSelection){\r
 \r
-                               Iterator<TermBase> selectionIterator = selection.iterator();\r
+                           Iterator<TermBase> selectionIterator = ((IStructuredSelection) selection).iterator();\r
 \r
-                               while (selectionIterator.hasNext()){\r
+                           while (selectionIterator.hasNext()){\r
 \r
-                                       TermBase term = selectionIterator.next();\r
+                               TermBase term = selectionIterator.next();\r
 \r
 \r
-                                       AbstractPostOperation operation = \r
-                                                       new DeleteTermBaseOperation(label, \r
-                                                                       undoContext,\r
-                                                                       term,\r
-                                                                       dfe.getDefinedTermEditorInput(), \r
-                                                                       editor);\r
-                                       StoreUtil.executeOperation(operation);\r
-\r
-                               }       \r
-                       } catch (NotDefinedException e) {\r
-                               MessagingUtils.error(getClass(), e);\r
-                       }\r
+                               AbstractPostOperation operation =\r
+                                       new DeleteTermBaseOperation(label,\r
+                                               undoContext,\r
+                                               term,\r
+                                               dfe.getDefinedTermEditorInput(),\r
+                                               dfe);\r
+                               AbstractUtility.executeOperation(operation);\r
+                           }\r
+                       }\r
+                   } catch (NotDefinedException e) {\r
+                       MessagingUtils.error(getClass(), e);\r
+                   }\r
                }\r
                return null;\r
        }\r
index a39b9ff525836a4753f2ff3babfe259afd50dfa4..16efff5520ac843b5d9f63c5e16bd6ca3e597be7 100644 (file)
@@ -163,7 +163,9 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                viewer.setInput(featureTree);
 
                text_title.removeModifyListener(this);
-               text_title.setText(featureTree.getTitleCache());
+               if (featureTree != null){
+                       text_title.setText(featureTree.getTitleCache());
+               }
                text_title.addModifyListener(this);
        }
 
index 1a8b2a88922cd8dbc50e1b18e5daec245bbc10a0..8e8a12441070851c78350530f44210288d366ed6 100644 (file)
@@ -11,6 +11,7 @@
 package eu.etaxonomy.taxeditor.featuretree;
 
 import java.util.List;
+import java.util.logging.ErrorManager;
 
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -33,6 +34,8 @@ import org.eclipse.swt.widgets.Text;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -163,13 +166,14 @@ public class SelectFeatureTreeWizardPage extends WizardPage implements ISelectio
                @Override
         public void widgetSelected(SelectionEvent e) {
                        IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+                       Object source = e.getSource();
                        for(Object element : selection.toArray()){
                                viewer.remove(element);
-
+                               ((FeatureTreeEditorWizard) getWizard()).setSelectedFeatureTree(null);
                                DeleteResult result =   CdmStore.getService(IFeatureTreeService.class).delete(((FeatureTree) element).getUuid());
 
                                if (result.isError()){
-
+                                       DeleteResultMessagingUtils.messageDialogWithDetails(result, "The delete of the feature tree was not successful.", null);
                                }
                                viewer.setSelection(new StructuredSelection(new Object[0]));
                        }
index 8149f3aad97c705becace2e52791c88f5976f531..f448fe3c415c2f268b63b9067288aa7aadfc2a1f 100644 (file)
@@ -118,11 +118,27 @@ public class PartialElement extends AbstractCdmFormElement implements ISelectabl
 
        private void handleEvent(Object eventSource){
                if(eventSource == number_month){
-                       partial = TimePeriod.setPartialField(partial, number_month.getInteger(), TimePeriod.MONTH_TYPE);
+                       if (number_month.getInteger() == 0){
+                               partial = TimePeriod.setPartialField(partial, null, TimePeriod.MONTH_TYPE);
+                       } else{
+                               partial = TimePeriod.setPartialField(partial, number_month.getInteger(), TimePeriod.MONTH_TYPE);
+                       }
+                       
                }else if(eventSource == number_day){
-                       partial = TimePeriod.setPartialField(partial, number_day.getInteger(), TimePeriod.DAY_TYPE);
+                       if (number_day.getInteger() == 0){
+                               partial = TimePeriod.setPartialField(partial, null, TimePeriod.DAY_TYPE);
+                       } else{
+                               partial = TimePeriod.setPartialField(partial, number_day.getInteger(), TimePeriod.DAY_TYPE);
+                       }
+                       
+                       
                }else if(eventSource == number_year){
-                       partial = TimePeriod.setPartialField(partial, number_year.getInteger(), TimePeriod.YEAR_TYPE);
+                       if (number_year.getInteger() == 0){
+                               partial = TimePeriod.setPartialField(partial, null, TimePeriod.YEAR_TYPE);
+                       } else{
+                               partial = TimePeriod.setPartialField(partial, number_year.getInteger(), TimePeriod.YEAR_TYPE);
+                       }
+                       
                }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
index 5199df5fce2e6f8abe1e0cf8fd48cbc11457ec8c..ba51d800cd0f2976ca68e4b3e2c721bf12499b00 100644 (file)
@@ -120,4 +120,13 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
 
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
+       
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_nomenclaturalTitle }));
+        updateToggleableCacheField();
+    }
 }
index f223d8c896aa5b33c40c5538391dac8f6bf4f236..15012f0f9c374f7722239b20b58644b40acde73c 100644 (file)
@@ -94,9 +94,7 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
                        handleToggleableCacheField();
                        
                } else if (eventSource == toggleable_nomenclaturalTitleCache) {
-                       getEntity().setNomenclaturalTitle(
-                                       toggleable_nomenclaturalTitleCache.getText(),
-                                       toggleable_nomenclaturalTitleCache.getState());
+                       updateToggleable_nomanclaturalTitleCacheField();
                        setIrrelevant(
                                        toggleable_nomenclaturalTitleCache.getState(),
                                        Arrays.asList(new Object[] { toggleable_nomenclaturalTitleCache, hasAdditionalMembers }));
@@ -113,4 +111,10 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
 
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
+       
+       public void updateToggleable_nomanclaturalTitleCacheField() {
+        if (!getEntity().isProtectedNomenclaturalTitleCache()) {
+            toggleable_nomenclaturalTitleCache.setText(getEntity().getNomenclaturalTitle());
+        }
+    }
 }
index a54f02ab1f00cb40174461aad220ad3a262cf126..d80937e970d00992a2342e2fa6423b6af1305530 100644 (file)
@@ -250,4 +250,15 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                        toggleable_cache.setText(getEntity().getNameCache());
                }
        }
+       
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_appendedPhrase, checkbox_anamorphic }));
+        updateToggleableCacheField();
+    }  
+
+
 }
index 9661e045877c5354ac46bcd0b59840678b1dbfa0..6b82772415c8f007691f004b3215731a67af233d 100644 (file)
@@ -154,4 +154,12 @@ public class NonViralNameDetailElement extends
                    getEntity().setLsid(textLsid.parseText());
                }
        }
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, textLsid }));
+        updateToggleableCacheField();
+    }
 }
index 4ca0bef9c70b7024293e25857af7227afd027b82..346b22cadd7af833ffe6737e1802ccb6e4229e3b 100644 (file)
@@ -60,7 +60,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
        private TextWithLabelElement text_publisher;
        private TextWithLabelElement text_referenceAbstract;
        private TextWithLabelElement text_series;
-       private TextWithLabelElement text_seriesPart;
+//     private TextWithLabelElement text_seriesPart;
        private TextWithLabelElement text_volume;
        private TextWithLabelElement text_abbrevTitle;
        private TextWithLabelElement text_title;
@@ -162,6 +162,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                                "Date Published", entity.getDatePublished(), style);
 
                createUriAndAbstract(this, entity, SWT.NULL);
+               handleToggleableAbbrevTitleField();
+               handleToggleableCacheField();
        }
 
        /*
@@ -185,8 +187,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                // Object[]{text_cache}));
                toggleable_cache.setEnabled(getEntity().isProtectedTitleCache());
                toggleableAbbrevCache.setEnabled(getEntity().isProtectedAbbrevTitleCache());
-        setIrrelevant(toggleable_cache.getState(), Arrays.asList(new Object[] { toggleable_cache }));
-        setIrrelevant(toggleableAbbrevCache.getState(), Arrays.asList(new Object[] { toggleableAbbrevCache}));
+               setIrrelevantReferenceDetail(false);
+               setIrrelevantReferenceDetail(true);
        }
 
        /**
@@ -360,10 +362,10 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                text_editor = formFactory.createTextWithLabelElement(element, "Editor",
                                reference.getEditor(), style);
 
-               // series part
+               /* series part
                text_seriesPart = formFactory.createTextWithLabelElement(element,
                                "Series", reference.getSeriesPart(), style);
-
+*/
                if (referenceType.equals(ReferenceType.Book)) {
                        // edition
                        text_edition = formFactory.createTextWithLabelElement(element,
@@ -432,8 +434,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        getEntity().setPublisher(text_publisher.getText());
                } else if (eventSource == text_referenceAbstract) {
                        getEntity().setReferenceAbstract(text_referenceAbstract.getText());
-               } else if (eventSource == text_seriesPart) {
-                       getEntity().setSeriesPart(text_seriesPart.getText());
+               } else if (eventSource == text_series) {
+                       getEntity().setSeriesPart(text_series.getText());
                } else if (eventSource == text_title) {
                        getEntity().setTitle(text_title.getText());
                        toggleable_cache.setText(text_title.getText());
@@ -474,7 +476,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
     protected void handleToggleableAbbrevTitleField() {
         boolean pushedAbbrevState = toggleableAbbrevCache.getState();
         getEntity().setAbbrevTitleCache(toggleableAbbrevCache.getText(), pushedAbbrevState);
-        setIrrelevant(pushedAbbrevState, Arrays.asList(new Object[] { toggleableAbbrevCache, toggleable_cache, text_title }));
+        setIrrelevantReferenceDetail(true);
         updateToggleableCacheField();
     }
 
@@ -548,4 +550,39 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        }
                }
        }
+       
+       @Override
+       protected void handleToggleableCacheField() {
+       
+               boolean pushedState = toggleable_cache.getState();
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevantReferenceDetail(false);
+        updateToggleableCacheField();
+    }
+       
+       protected void setIrrelevantReferenceDetail(boolean abbrev){
+               
+               List<Object> except = new ArrayList();
+           except.addAll( Arrays.asList(new Object[] { toggleable_cache, toggleableAbbrevCache, text_editor, text_isbn, text_issn, text_organisation, text_pages, text_placePublished, text_publisher, text_referenceAbstract,  text_uri, selection_institution}));
+           boolean pushedState;
+           if (abbrev){
+             except.add(text_title);
+             pushedState = toggleableAbbrevCache.getState();
+           } else{
+               except.add(text_abbrevTitle);
+               pushedState = toggleable_cache.getState();
+           }
+           switch( getEntity().getType()){
+           case Journal:
+               except.add(element_timePeriod);
+               break;
+           case Book:
+               except.remove(text_series);
+               except.remove(text_edition);
+               break;
+           default:
+               break;
+           }   
+           setIrrelevant(pushedState, except);
+       }
 }
index 8139ecd577b6f229a6252d482e2ea8b18bd50e3b..b086a1857fb276d9609687d457804ceb84db5188 100644 (file)
@@ -180,4 +180,12 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                    ((Taxon)getEntity()).setPublish(checkbox_published.getSelection());
                }
        }
+       @Override
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, text_appendedPhrase, checkbox_published, checkbox_unplaced, checkbox_excluded}));
+        updateToggleableCacheField();
+    }
 }
index b9d3cf61628df6a5a2d13a1f012e24bd83c34d32..3b99b77b0c9bed4ef32fe2c26c6eddab34ffd2a2 100644 (file)
@@ -26,7 +26,7 @@ import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
-import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator.ChildHandling;
+import eu.etaxonomy.cdm.api.service.config.NodeDeletionConfigurator.ChildHandling;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;