- enabled DescriptiveView (Factual Data) to show descriptions of SpecimenOrObservati...
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / uses / operation / CreateUseSummaryOperation.java
index 2a86f90fddd859a3664efaecdb8dcb3ddc0ac583..80c85db61ccca467cd2e22f646eca1d2a4550610 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2011 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
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
 \r
+import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.cdm.model.description.Feature;\r
 import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
@@ -25,19 +26,19 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 \r
 /**\r
  * CreateUseSummaryOperation Class\r
- * @author a.theys     \r
+ * @author a.theys\r
  * @created mar 13, 2012\r
  * @version 1.0\r
  */\r
 public class CreateUseSummaryOperation extends AbstractPostOperation {\r
-       \r
+\r
        public static final String ID = "eu.etaxonomy.taxeditor.editor.use.createUseRecord";\r
-       \r
-       private TaxonDescription description;\r
-       private Feature feature;\r
+\r
+       private final DescriptionBase<?> description;\r
+       private final Feature feature;\r
        private DescriptionElementBase element;\r
 \r
-       \r
+\r
        /**\r
         * <p>Constructor for CreateUseSummaryOperation.</p>\r
         *\r
@@ -48,10 +49,9 @@ public class CreateUseSummaryOperation extends AbstractPostOperation {
         * @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object.\r
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.\r
         */\r
-       public CreateUseSummaryOperation(String label, IUndoContext undoContext,\r
-               Taxon taxon, TaxonDescription description, Feature feature, IPostOperationEnabled postOperationEnabled) {\r
-                       super(label, undoContext, taxon, postOperationEnabled);\r
-               \r
+       public CreateUseSummaryOperation(String label, IUndoContext undoContext, DescriptionBase<?> description, Feature feature, IPostOperationEnabled postOperationEnabled) {\r
+                       super(label, undoContext, (Taxon)null, postOperationEnabled);\r
+\r
                        this.description = description;\r
                        this.feature = feature;\r
        }\r
@@ -71,8 +71,8 @@ public class CreateUseSummaryOperation extends AbstractPostOperation {
                        IUndoContext undoContext, Taxon taxon,\r
                        TaxonDescription description, Feature feature,\r
                        DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {\r
-                       this(label, undoContext, taxon, description, feature, postOperationEnabled);\r
-                       \r
+                       this(label, undoContext, description, feature, postOperationEnabled);\r
+\r
                this.element = element;\r
        }\r
 \r
@@ -86,7 +86,7 @@ public class CreateUseSummaryOperation extends AbstractPostOperation {
                                element = TextData.NewInstance();\r
                }\r
 \r
-               \r
+\r
                element.setFeature(feature);\r
                description.addElement(element);\r
                monitor.worked(40);\r
@@ -97,9 +97,9 @@ public class CreateUseSummaryOperation extends AbstractPostOperation {
        @Override\r
        public IStatus redo(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
-               \r
+\r
                description.addElement(element);\r
-               \r
+\r
                return postExecute(element);\r
        }\r
 \r
@@ -107,7 +107,7 @@ public class CreateUseSummaryOperation extends AbstractPostOperation {
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
                description.removeElement(element);\r
-               \r
+\r
                return postExecute(null);\r
        }\r
 }\r