performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / operations / ChangeSynonymToHomotypicalGroupBasionymOperation.java
index 017a75a47833345dedd5d21fc30c5879f1ff53c6..39c903c9286ab0ecb2e4cb3347a007cd882253a5 100644 (file)
@@ -1,84 +1,97 @@
-/**\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.Synonym;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 14.01.2009\r
- * @version 1.0\r
- * @deprecated there will be an operation to set the basionym only that automatically unsets the former basionym\r
- */\r
-public class ChangeSynonymToHomotypicalGroupBasionymOperation extends AbstractPostOperation {\r
-       \r
-       private Synonym synonym;\r
-\r
-       public ChangeSynonymToHomotypicalGroupBasionymOperation(String text, IUndoContext undoContext,\r
-                       Taxon taxon, Synonym synonym) {\r
-               super(text, undoContext, taxon);\r
-               \r
-               this.synonym = synonym;\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
-//             // Get basionym for synonyms homotypic group\r
-//             homotypicGroup = synonym.getHomotypicGroup();\r
-//             TaxonNameBase basionym = homotypicGroup.getBasionym();\r
-//             \r
-//             // Check if synonym is already basionym\r
-//             if(basionym != null && basionym.equals(synonym.getName())){\r
-//                     return Status.OK_STATUS;\r
-//             }\r
-               \r
-               // TODO replace w method from cdmlib\r
-               // FIXME this is also old code: reimplement\r
-//             CdmUtil.setGroupBasionym(synonym.getName());\r
-               monitor.worked(40);\r
-\r
-               return postExecute(synonym);\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
-               // TODO replace w method from cdmlib\r
-               // FIXME this is also old code: reimplement\r
-//             CdmUtil.removeGroupBasionym(synonym.getName());\r
-                               \r
-               return postExecute(synonym);\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.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+/**
+ * <p>ChangeSynonymToHomotypicalGroupBasionymOperation class.</p>
+ *
+ * @author p.ciardelli
+ * @created 14.01.2009
+ * @version 1.0
+ * @deprecated there will be an operation to set the basionym only that automatically unsets the former basionym
+ */
+public class ChangeSynonymToHomotypicalGroupBasionymOperation extends AbstractPostOperation {
+       
+       private Synonym synonym;
+
+       /**
+        * <p>Constructor for ChangeSynonymToHomotypicalGroupBasionymOperation.</p>
+        *
+        * @param text 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 synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
+        */
+       public ChangeSynonymToHomotypicalGroupBasionymOperation(String text, IUndoContext undoContext,
+                       Taxon taxon, Synonym synonym) {
+               super(text, undoContext, taxon);
+               
+               this.synonym = synonym;
+       }
+
+       /* (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);
+//             // Get basionym for synonyms homotypic group
+//             homotypicGroup = synonym.getHomotypicGroup();
+//             TaxonNameBase basionym = homotypicGroup.getBasionym();
+//             
+//             // Check if synonym is already basionym
+//             if(basionym != null && basionym.equals(synonym.getName())){
+//                     return Status.OK_STATUS;
+//             }
+               
+               // TODO replace w method from cdmlib
+               // FIXME this is also old code: reimplement
+//             CdmUtil.setGroupBasionym(synonym.getName());
+               monitor.worked(40);
+
+               return postExecute(synonym);
+       }
+
+       /* (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 {
+               // TODO replace w method from cdmlib
+               // FIXME this is also old code: reimplement
+//             CdmUtil.removeGroupBasionym(synonym.getName());
+                               
+               return postExecute(synonym);
+       }
+}