/**\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
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
\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
* @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
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
element = TextData.NewInstance();\r
}\r
\r
- \r
+\r
element.setFeature(feature);\r
description.addElement(element);\r
monitor.worked(40);\r
@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
public IStatus undo(IProgressMonitor monitor, IAdaptable info)\r
throws ExecutionException {\r
description.removeElement(element);\r
- \r
+\r
return postExecute(null);\r
}\r
}\r