#5252 Add remove method to manually remove root derivate
authorCherian Mathew <c.mathew@bgbm.org>
Tue, 15 Sep 2015 15:07:27 +0000 (17:07 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Tue, 15 Sep 2015 15:07:27 +0000 (17:07 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/DeleteDerivateOperation.java

index d50ca2fce04ae8360f810c1f38b79e316878b7bd..ec05a6b1d5421ca11cec44955593be749b3237c1 100644 (file)
@@ -252,6 +252,14 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.refresh();
     }
 
+    //FIXME:Remoting hack to make this work for remoting
+    //This should actually be resolved using remoting post operations
+    public void remove(Object obj) {
+        Set<SpecimenOrObservationBase<?>> rootEntities = ((DerivateViewEditorInput) getEditorInput()).getRootEntities();
+        rootEntities.remove(obj);
+        viewer.setInput(rootEntities);
+    }
+
     private void generateMultiLinkSingleReads() {
         Set<SingleRead> multiLinkSingleReads = new HashSet<SingleRead>();
         for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
index 4948aaacccd1e7546e118acbcb2a0532767c5740..a095409820eceac0619944df587cb2a934934863 100644 (file)
@@ -90,6 +90,7 @@ public class DeleteDerivateOperation extends AbstractPostOperation<CdmBase> {
         if(deleteResult.isOk()){
             if(getPostOperationEnabled() instanceof DerivateView){
                 DerivateView derivateView = (DerivateView) getPostOperationEnabled();
+                derivateView.remove(element);
                 //update DerivateView
                 derivateView.getConversationHolder().commit();
                 IStatus returnStatus = postExecute(null);