handler implementations
authorn.hoffmann <n.hoffmann@localhost>
Mon, 9 Mar 2009 16:14:22 +0000 (16:14 +0000)
committern.hoffmann <n.hoffmann@localhost>
Mon, 9 Mar 2009 16:14:22 +0000 (16:14 +0000)
.gitattributes
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/CreateMisappliedNameHandler.java [new file with mode: 0644]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/EditNewTaxonHandler.java
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/EditTaxonHandler.java
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/MoveTaxonHandler.java [new file with mode: 0644]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/SwapTaxonSynonymHandler.java [new file with mode: 0644]

index dd63dfcac07b387ae0cca1af6d8157c4ea671437..726d36bf27b28253b25f10a6fa7916abd1ea83eb 100644 (file)
@@ -496,12 +496,15 @@ eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/editor/name/Ta
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/AddTaxonomicChildHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/CreateHeterotypicSynonymHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/CreateHomotypicSynonymHandler.java -text
+eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/CreateMisappliedNameHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/DeleteTaxonHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/EditNewTaxonHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/EditTaxonHandler.java -text
+eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/MoveTaxonHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/NewTaxonHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/OpenTaxonHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/SaveAllHandler.java -text
+eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/SwapTaxonSynonymHandler.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/io/InputWizard.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/io/InputWizard2.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/model/CdmSessionDataRepository.java -text
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/CreateMisappliedNameHandler.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/CreateMisappliedNameHandler.java
new file mode 100644 (file)
index 0000000..2ddf1a7
--- /dev/null
@@ -0,0 +1,45 @@
+/**
+ * 
+ */
+package eu.etaxonomy.taxeditor.handlers;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.operations.IUndoableOperation;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.controller.EditorController;
+import eu.etaxonomy.taxeditor.controller.GlobalController;
+import eu.etaxonomy.taxeditor.operations.name.CreateMisappliedNameOperation;
+
+/**
+ * @author nho
+ *
+ */
+public class CreateMisappliedNameHandler extends AbstractHandler implements IHandler {
+       private static final Logger logger = Logger
+                       .getLogger(CreateMisappliedNameHandler.class);
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               Taxon taxon = EditorController.getActiveEditor().getTaxon();
+               
+               IUndoableOperation operation;
+               try {
+                       operation = new CreateMisappliedNameOperation(event.getCommand().getName(), 
+                                               EditorController.getUndoContext(taxon), taxon);
+                       GlobalController.executeOperation(operation);
+               } catch (NotDefinedException e) {
+                       logger.warn("Command name not set");
+               }
+               
+               return null;
+       }
+
+}
index 034dd10228a9a0fc8d43fa83f14dc0eb6e18e708..0f1e4d9c0b781dc38d1597a12c1373aff88c23d8 100644 (file)
@@ -30,7 +30,6 @@ public class EditNewTaxonHandler extends AbstractHandler implements IHandler {
        /* (non-Javadoc)\r
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
         */\r
-       @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
                \r
                EditorController.openUnitializedRootTaxon();\r
index ca95b07c27f6218c420b25f93f49b523b02decc5..1c9f72d05ee7d3fa2f6fba86a08b6ad83107e07e 100644 (file)
@@ -29,7 +29,6 @@ public class EditTaxonHandler extends AbstractHandler{
        /* (non-Javadoc)\r
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
         */\r
-       @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
 \r
                EditorController.open(TreeController.getCurrentSelection(event));\r
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/MoveTaxonHandler.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/MoveTaxonHandler.java
new file mode 100644 (file)
index 0000000..9aa2c1e
--- /dev/null
@@ -0,0 +1,23 @@
+package eu.etaxonomy.taxeditor.handlers;
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+
+/**
+ * @author nho
+ *
+ */
+public class MoveTaxonHandler extends AbstractHandler implements IHandler {
+
+       private static final Logger logger = Logger
+                       .getLogger(MoveTaxonHandler.class);
+       
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               logger.warn("Not yet implemented");
+               return null;
+       }
+
+
+}
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/SwapTaxonSynonymHandler.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/handlers/SwapTaxonSynonymHandler.java
new file mode 100644 (file)
index 0000000..544a3b9
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * 
+ */
+package eu.etaxonomy.taxeditor.handlers;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+
+/**
+ * @author nho
+ *
+ */
+public class SwapTaxonSynonymHandler extends AbstractHandler implements IHandler {
+
+
+       private static final Logger logger = Logger
+                       .getLogger(SwapTaxonSynonymHandler.class);
+
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               logger.warn("Not yet implemented");
+               return null;
+       }
+
+}