performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / operations / CreateConceptRelationOperation.java
index 1b09ec4d0140824c6e17b75e84f15869a71d2b9c..9b44de6883426000e0faa46a41c70887acae8e15 100644 (file)
@@ -1,77 +1,92 @@
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\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
-\r
-package eu.etaxonomy.taxeditor.operations;\r
-\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.core.commands.operations.IUndoContext;\r
-import org.eclipse.core.runtime.IAdaptable;\r
-import org.eclipse.core.runtime.IProgressMonitor;\r
-import org.eclipse.core.runtime.IStatus;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 26.01.2009\r
- * @version 1.0\r
- * @author n.hoffmann\r
- */\r
-public class CreateConceptRelationOperation extends AbstractPostOperation {\r
-       \r
-       private Taxon concept;\r
-       private TaxonRelationshipType taxonRelationshipType;\r
-       \r
-       public CreateConceptRelationOperation(String label,\r
-                       IUndoContext undoContext, Taxon taxon, Taxon concept, TaxonRelationshipType taxonRelationshipType\r
-                       , IPostOperationEnabled postOperationEnabled) {\r
-               super(label, undoContext, taxon, postOperationEnabled);\r
-               this.concept = concept;\r
-               this.taxonRelationshipType = taxonRelationshipType;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)\r
-        */\r
-       @Override\r
-       public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
-                       throws ExecutionException {\r
-\r
-               monitor.worked(20);\r
-               // add concept to taxon\r
-               concept.addTaxonRelation(taxon, taxonRelationshipType, null, null);     \r
-               monitor.worked(40);\r
-               \r
-               // redraw editor if exists\r
-               return postExecute(concept);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)\r
-        */\r
-       @Override\r
-       public IStatus redo(IProgressMonitor monitor, IAdaptable info)\r
-                       throws ExecutionException {\r
-               return execute(monitor, info);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)\r
-        */\r
-       @Override\r
-       public IStatus undo(IProgressMonitor monitor, IAdaptable info)\r
-                       throws ExecutionException {\r
-               \r
-               taxon.removeTaxon(concept, taxonRelationshipType);\r
-               \r
-               // redraw editor if exists\r
-               return postExecute(null);\r
-       }\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.operations;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+
+/**
+ * <p>CreateConceptRelationOperation class.</p>
+ *
+ * @author p.ciardelli
+ * @author n.hoffmann
+ * @created 26.01.2009
+ * @version 1.0
+ */
+public class CreateConceptRelationOperation extends AbstractPostOperation {
+       
+       private Taxon concept;
+       private TaxonRelationshipType taxonRelationshipType;
+       
+       /**
+        * <p>Constructor for CreateConceptRelationOperation.</p>
+        *
+        * @param label a {@link java.lang.String} object.
+        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+        * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
+        * @param concept a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
+        * @param taxonRelationshipType a {@link eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType} object.
+        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operations.IPostOperationEnabled} object.
+        */
+       public CreateConceptRelationOperation(String label,
+                       IUndoContext undoContext, Taxon taxon, Taxon concept, TaxonRelationshipType taxonRelationshipType
+                       , IPostOperationEnabled postOperationEnabled) {
+               super(label, undoContext, taxon, postOperationEnabled);
+               this.concept = concept;
+               this.taxonRelationshipType = taxonRelationshipType;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+        */
+       /** {@inheritDoc} */
+       @Override
+       public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+                       throws ExecutionException {
+
+               monitor.worked(20);
+               // add concept to taxon
+               concept.addTaxonRelation(taxon, taxonRelationshipType, null, null);     
+               monitor.worked(40);
+               
+               // redraw editor if exists
+               return postExecute(concept);
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+        */
+       /** {@inheritDoc} */
+       @Override
+       public IStatus redo(IProgressMonitor monitor, IAdaptable info)
+                       throws ExecutionException {
+               return execute(monitor, info);
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+        */
+       /** {@inheritDoc} */
+       @Override
+       public IStatus undo(IProgressMonitor monitor, IAdaptable info)
+                       throws ExecutionException {
+               
+               taxon.removeTaxon(concept, taxonRelationshipType);
+               
+               // redraw editor if exists
+               return postExecute(null);
+       }
+}