fix #5692: adapt delete algorithm to annotatedLineEditor mechanisms
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / annotatedlineeditor / LineAnnotation.java
index ef4f124b70dada677d4330bf1f5fc6c3980443f8..9f41f4b44f20d862e2d8ecababe7b6870cf20bcd 100644 (file)
@@ -14,6 +14,9 @@ import java.util.Set;
 import org.apache.log4j.Logger;
 import org.eclipse.jface.text.source.Annotation;
 
+import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
+
 /**
  * An <code>Annotation</code> which spans an entire line and holds an object associated
  * with the line in an <code>IEntityContainer</code>.
@@ -37,6 +40,7 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
        private boolean markedAsMerged;
        private boolean markedAsNew;
        private T mergeTarget;
+       private DeleteConfiguratorBase configurator= null;
 
 
        /**
@@ -184,7 +188,13 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
                        lineDisplayStrategy.setStatusMessage(entity + " deleted.", entity);
                }
        }
-
+        public void markAsDeleted(DeleteConfiguratorBase config) {
+                       super.markDeleted(true);
+                       this.configurator = config;
+                       if (!isMarkedAsMerged()) {
+                               lineDisplayStrategy.setStatusMessage(entity + " deleted.", entity);
+                       }
+               }
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.IEntityContainer#markAsMerged(eu.etaxonomy.cdm.model.common.CdmBase)
         */
@@ -248,4 +258,13 @@ public class LineAnnotation<T> extends Annotation implements IEntityContainer<T>
     public void setEntity(Object entity) {
         this.entity = (T) entity;
     }
+
+       public DeleteConfiguratorBase getDeleteConfigurator() {
+               return this.configurator;
+       }
+
+       public void setDeleteConfigurator(DeleteConfiguratorBase config) {
+               this.configurator = config;
+               
+       }
 }