Renamed package with "actions"
authorp.ciardelli <p.ciardelli@localhost>
Wed, 28 May 2008 09:19:26 +0000 (09:19 +0000)
committerp.ciardelli <p.ciardelli@localhost>
Wed, 28 May 2008 09:19:26 +0000 (09:19 +0000)
14 files changed:
.gitattributes
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddQuickName.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddSynonymToTaxon.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionDeleteTaxon.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionMoveTaxon.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNameEditor.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNewChildNameEditor.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionPopulatePropertySheet.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionRemoveTaxonFromTree.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionSaveTaxon.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/NameTransfer.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/SynonymRelationshipTransfer.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/TaxonTransfer.java [deleted file]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/WidgetTransfer.java [deleted file]

index b6a188d4152b03b86afc2f31fc5b8683ec3b0e35..a8fc6924d5eb6b843dd6bd0db723fac8331b09f3 100644 (file)
@@ -383,19 +383,6 @@ eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/NomenclaturalC
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/SideBySidePerspective.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/TaxEditorPlugin.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/TaxonomicPreferences.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddQuickName.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddSynonymToTaxon.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionDeleteTaxon.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionMoveTaxon.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNameEditor.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNewChildNameEditor.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionPopulatePropertySheet.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionRemoveTaxonFromTree.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionSaveTaxon.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/NameTransfer.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/SynonymRelationshipTransfer.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/TaxonTransfer.java -text
-eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/WidgetTransfer.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/model/NameEditorInput.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/model/NameTreeContentProvider.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/model/PropertySheetNode.java -text
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddQuickName.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddQuickName.java
deleted file mode 100644 (file)
index 169a19e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.jface.action.Action;\r
-import org.eclipse.ui.PlatformUI;\r
-\r
-import eu.etaxonomy.cdm.model.name.BotanicalName;\r
-import eu.etaxonomy.cdm.model.name.Rank;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-import eu.etaxonomy.taxeditor.view.NameListView;\r
-import eu.etaxonomy.taxeditor.view.TaxonomicTreeViewer;\r
-\r
-/**\r
- * Open up a celleditor in the taxonomic tree \r
- *  to add a quickname to taxon\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionAddQuickName extends Action {\r
-       Taxon parentTaxon;\r
-       \r
-       public ActionAddQuickName(Taxon parentTaxon) {\r
-               this.parentTaxon = parentTaxon;\r
-       }\r
-       \r
-       public void run() {\r
-       \r
-               // Create empty Taxon, add it to its parent\r
-               Taxon childTaxon = new Taxon();\r
-               childTaxon.setName(BotanicalName.NewInstance(Rank.GENUS()));\r
-               \r
-               // TODO getTitleCache is currently returning "null", not null\r
-               //  hence its being set here - change!\r
-               childTaxon.getName().setTitleCache(null);\r
-               parentTaxon.addTaxonomicChild(childTaxon, null, null);\r
-               \r
-               // Add childTaxon to observable tree list, \r
-               //  causing it to appear in the tree\r
-               TaxEditorPlugin.getDefault().getObservableTaxonTreeList().add(childTaxon);\r
-               \r
-               // Open new node\r
-               TaxonomicTreeViewer treeViewer = (TaxonomicTreeViewer) ((NameListView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().\r
-                               findView(NameListView.ID)).getTreeViewer(); \r
-               treeViewer.revealTaxon(childTaxon);\r
-               \r
-               // Put cursor in empty node\r
-               treeViewer.editElement(childTaxon, 0);\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddSynonymToTaxon.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionAddSynonymToTaxon.java
deleted file mode 100644 (file)
index 003274e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**\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.controller;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.eclipse.jface.action.Action;\r
-\r
-import eu.etaxonomy.cdm.model.name.BotanicalName;\r
-import eu.etaxonomy.cdm.model.name.HomotypicalGroup;\r
-import eu.etaxonomy.cdm.model.name.Rank;\r
-import eu.etaxonomy.cdm.model.taxon.Synonym;\r
-import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.view.nameviewersupport.TesterooWritableSet;\r
-import eu.etaxonomy.taxeditor.view.propertysheetsupport.NonViralNamePropertySource;\r
-\r
-/**\r
- * Add a new synonym to a taxon.\r
- * \r
- * @author p.ciardelli\r
- * @created 06.05.2008\r
- * @version 1.0\r
- *\r
- */\r
-public class ActionAddSynonymToTaxon extends Action {\r
-       private static final Logger logger = Logger\r
-                       .getLogger(ActionAddSynonymToTaxon.class);\r
-       \r
-       Taxon taxon;\r
-       Synonym synonym;\r
-       \r
-       public ActionAddSynonymToTaxon(Taxon taxon, Synonym synonym) {\r
-               this.taxon = taxon;\r
-               this.synonym = synonym;\r
-       }\r
-\r
-       public ActionAddSynonymToTaxon(Taxon taxon, String synonymNameCache) {\r
-                               \r
-               this.taxon = taxon;\r
-               this.synonym = new Synonym();\r
-               \r
-               BotanicalName name = BotanicalName.PARSED_NAME(synonymNameCache);\r
-//             name.setHomotypicalGroup(new HomotypicalGroup());\r
-               boolean homoGroupCreated = (name.getHomotypicalGroup() != null);\r
-               logger.warn("Homotypical group automatically created with new name? " + homoGroupCreated);\r
-               this.synonym.setName(name);\r
-}      \r
-\r
-       public void run() {\r
-               taxon.addSynonym(synonym, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF());\r
-               \r
-               TesterooWritableSet.getInstance().add(synonym);\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionDeleteTaxon.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionDeleteTaxon.java
deleted file mode 100644 (file)
index 4f35c98..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**\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.controller;\r
-\r
-/**\r
- * Adds tree functionality (get parent, get children) to ObservableListContentProvider;\r
- *  much code was copied almost in tact from parent class due to\r
- *  viewer type restrictions and private settings of variables and methods\r
- * \r
- * @author p.ciardelli\r
- * @created 14.05.2008\r
- * @version 1.0\r
- */\r
-import org.apache.log4j.Logger;\r
-import org.eclipse.jface.action.Action;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-\r
-/**\r
- * Delete this taxon from the CDM\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionDeleteTaxon extends Action {\r
-       private static final Logger logger = Logger.getLogger(ActionDeleteTaxon.class);\r
-       \r
-       Taxon taxon;\r
-       \r
-       public ActionDeleteTaxon(Taxon taxon) {\r
-               this.taxon = taxon;\r
-       }\r
-       \r
-       public void run() {\r
-               Taxon parentTaxon = taxon.getTaxonomicParent();\r
-               for (TaxonRelationship taxonRelation : parentTaxon.getTaxonRelations()) {\r
-                       \r
-                       TaxonRelationshipType type = taxonRelation.getType();\r
-                       Taxon fromTaxon = taxonRelation.getFromTaxon();\r
-                       \r
-                       if (type.equals(TaxonRelationshipType.TAXONOMICALLY_INCLUDED_IN()) &&\r
-                                       fromTaxon.equals(taxon)) {\r
-                               parentTaxon.removeTaxonRelation(taxonRelation);\r
-                               TaxEditorPlugin.getDefault().getObservableTaxonTreeList().remove(taxon);\r
-                               TaxEditorPlugin.getDefault().getCdmApp().getTaxonService().saveTaxon(parentTaxon);\r
-                               return;\r
-                       }\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionMoveTaxon.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionMoveTaxon.java
deleted file mode 100644 (file)
index 85283ab..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.jface.action.Action;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-\r
-/**\r
- * Moves taxon in the taxonomic tree by assigning it a new parent\r
- *  and triggering observable tree list update\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionMoveTaxon extends Action {\r
-       Taxon taxon;\r
-       Taxon newParentTaxon;\r
-       \r
-       public ActionMoveTaxon(Taxon taxon, Taxon newParentTaxon) {\r
-               this.taxon = taxon;\r
-               this.newParentTaxon = newParentTaxon;\r
-       }\r
-       \r
-       public void run() {\r
-               \r
-               // TODO Taxon.setParentTaxon(newParentTaxon)\r
-               taxon.setTaxonomicParent(newParentTaxon, null, null);\r
-               \r
-               // Trigger re-draw in list by removing then adding taxon\r
-               TaxEditorPlugin.getDefault().getObservableTaxonTreeList().remove(taxon);                        \r
-               TaxEditorPlugin.getDefault().getObservableTaxonTreeList().add(taxon);\r
-\r
-               // Save the taxon to the CDM\r
-               TaxEditorPlugin.getDefault().getCdmApp().getTaxonService().saveTaxon(taxon);\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNameEditor.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNameEditor.java
deleted file mode 100644 (file)
index f57dcd0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-       package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.jface.action.Action;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.PartInitException;\r
-import org.eclipse.ui.PlatformUI;\r
-\r
-import eu.etaxonomy.cdm.model.name.BotanicalName;\r
-import eu.etaxonomy.cdm.model.name.Rank;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-import eu.etaxonomy.taxeditor.view.MultiPageTaxonEditor;\r
-import eu.etaxonomy.taxeditor.model.NameEditorInput;\r
-import eu.etaxonomy.taxeditor.view.LeftPane;\r
-import eu.etaxonomy.taxeditor.view.NameListView;\r
-import eu.etaxonomy.taxeditor.view.TaxonomicTreeViewer;\r
-\r
-/**\r
- * Opens a name editor for an existing or new taxon\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionOpenNameEditor extends Action {\r
-\r
-       private Taxon taxon;\r
-       public static final String ID = "eu.etaxonomy.taxeditor.controller.opennameeditoraction"; //$NON-NLS-1$\r
-       \r
-       public ActionOpenNameEditor(Taxon taxon) {\r
-               this.taxon = taxon;\r
-       }\r
-\r
-       public ActionOpenNameEditor() {\r
-\r
-               // the text for the menu item\r
-               setText("New taxon");\r
-               \r
-               setId(ID);\r
-               \r
-               this.taxon = new Taxon();\r
-               taxon.setName(BotanicalName.NewInstance(Rank.GENUS()));\r
-               \r
-       }\r
-       \r
-       public void run() {\r
-\r
-               \r
-               // If this is a non-empty taxon being opened for the first time,\r
-               //  add to recent names list            \r
-               if (taxon.getName().getTitleCache() != null &&\r
-                               !TaxEditorPlugin.getDefault().getObservableRecentNamesList().contains(taxon))\r
-                       TaxEditorPlugin.getDefault().getObservableRecentNamesList().add(0, taxon);\r
-               \r
-               // If this taxon is not visible in the tree, open node\r
-               ((TaxonomicTreeViewer) ((NameListView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().\r
-                               findView(NameListView.ID)).getTreeViewer()).revealTaxon(taxon);\r
-               \r
-               IEditorInput input = new NameEditorInput(taxon);\r
-               try {\r
-                               TaxEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().\r
-                                       getActivePage().openEditor(input, MultiPageTaxonEditor.ID);\r
-                       } catch (PartInitException e) {\r
-                               // TODO Auto-generated catch block\r
-                               e.printStackTrace();\r
-                       }\r
-        \r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNewChildNameEditor.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionOpenNewChildNameEditor.java
deleted file mode 100644 (file)
index 5f28919..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.jface.action.Action;\r
-\r
-import eu.etaxonomy.cdm.model.name.BotanicalName;\r
-import eu.etaxonomy.cdm.model.name.Rank;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-\r
-/**\r
- * Opens a name editor for a new taxon with a parent taxon\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionOpenNewChildNameEditor extends Action {\r
-\r
-       private Taxon taxon;\r
-       public static final String ID = "eu.etaxonomy.taxeditor.controller.opennameeditoraction"; //$NON-NLS-1$\r
-       \r
-       public ActionOpenNewChildNameEditor(Taxon parentTaxon) {\r
-               \r
-               taxon = new Taxon();\r
-               taxon.setName(BotanicalName.NewInstance(Rank.GENUS()));\r
-               \r
-               // TODO getTitleCache is currently returning "null", not null\r
-               //  hence its being set here - change!\r
-               taxon.getName().setTitleCache(null);\r
-               \r
-               parentTaxon.addTaxonomicChild(taxon, null, null);\r
-       }\r
-\r
-       public ActionOpenNewChildNameEditor() {\r
-               setId(ID);\r
-       }\r
-       \r
-       public void run() {\r
-               new ActionOpenNameEditor(taxon).run();\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionPopulatePropertySheet.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionPopulatePropertySheet.java
deleted file mode 100644 (file)
index d43dfb0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.jface.action.Action;\r
-import org.eclipse.jface.viewers.ISelection;\r
-\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-\r
-/**\r
- * Convert an object to a structured selection, pass it to the\r
- *  universal property sheet provider.\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionPopulatePropertySheet extends Action {\r
-       TaxonNameBase name;\r
-       private ISelection selection;\r
-       \r
-       public ActionPopulatePropertySheet(ISelection selection) {\r
-               this.selection = selection;\r
-       }\r
-       \r
-       public void run() {\r
-               TaxEditorPlugin.getDefault().getProvider().setSelection(this.selection);\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionRemoveTaxonFromTree.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionRemoveTaxonFromTree.java
deleted file mode 100644 (file)
index 12fdc04..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.jface.action.Action;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-\r
-/**\r
- * Remove a Taxon from the tree without removing it from\r
- *  the CDM, i.e. when a temporary Taxon has been created for\r
- *  quickname\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionRemoveTaxonFromTree extends Action {\r
-       Taxon taxon;\r
-       \r
-       public ActionRemoveTaxonFromTree(Taxon taxon) {\r
-               this.taxon = taxon;\r
-       }\r
-       \r
-       public void run() {\r
-       \r
-               // Remove Taxon from taxon tree list\r
-               TaxEditorPlugin.getDefault().getObservableTaxonTreeList().remove(taxon);\r
-               \r
-               taxon = null;\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionSaveTaxon.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/ActionSaveTaxon.java
deleted file mode 100644 (file)
index 4826e36..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.eclipse.jface.action.Action;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
-\r
-/**\r
- * Commit any changes to this taxon to the CDM\r
- * \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class ActionSaveTaxon extends Action {\r
-       private static final Logger logger = Logger.getLogger(ActionSaveTaxon.class);\r
-       \r
-       Taxon taxon;\r
-       \r
-       public ActionSaveTaxon(Taxon taxon) {\r
-               this.taxon = taxon;\r
-       }\r
-       \r
-       public void run() {\r
-               // If this is a new taxon, add it to the recent names list;\r
-               //  if it is already in the tree, remove then re-add it\r
-               //  to force a re-sort\r
-               if (!TaxEditorPlugin.getDefault().getObservableTaxonTreeList().contains(taxon)) {\r
-                       TaxEditorPlugin.getDefault().getObservableRecentNamesList().add(0, taxon);\r
-               } else {\r
-                       TaxEditorPlugin.getDefault().getObservableTaxonTreeList().remove(taxon);\r
-               }                       \r
-               TaxEditorPlugin.getDefault().getObservableTaxonTreeList().add(taxon);\r
-\r
-               // Save the taxon to the CDM\r
-               TaxEditorPlugin.getDefault().getCdmApp().getTaxonService().saveTaxon(taxon);\r
-               \r
-               // Notify taxon listeners in case name has been updated\r
-               // NOTE: I took this out, and for some reason, the names started disappearing\r
-               //      from the tax. tree on save!\r
-               taxon.firePropertyChange("name", null, null);\r
-       }\r
-}
\ No newline at end of file
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/NameTransfer.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/NameTransfer.java
deleted file mode 100644 (file)
index 333ff98..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.swt.dnd.ByteArrayTransfer;\r
-import org.eclipse.swt.dnd.TransferData;\r
-\r
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
-\r
-/**\r
- * For drag and drop - a drag widget with this transfer type can only be dropped onto\r
- *  a drop widget with the same type.\r
- *    \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class NameTransfer extends ByteArrayTransfer {\r
-\r
-       private static final String TYPENAME = "name_type";\r
-       private static final int NAMETYPEID = registerType (TYPENAME);          \r
-       private static final NameTransfer INSTANCE = new NameTransfer();\r
-       \r
-       /*\r
-        * The object associated with this transfer event\r
-        */\r
-       private TaxonNameBase name;\r
-               \r
-       /*\r
-        * Returns the singleton\r
-        */\r
-       public static NameTransfer getInstance() {\r
-               return INSTANCE;\r
-       }\r
-       /*\r
-        * Set transfer data for local use\r
-        */\r
-       public void setName(TaxonNameBase name) {\r
-               this.name = name;\r
-       }\r
-       /*\r
-        * Returns the local transfer data\r
-        */\r
-       public TaxonNameBase getName() {\r
-               return name;\r
-       }\r
-       \r
-       /* \r
-        * The type ID is used to identify this transfer\r
-        */\r
-       @Override\r
-       protected int[] getTypeIds() {\r
-               return new int[] { NAMETYPEID };\r
-       }\r
-\r
-       @Override\r
-       protected String[] getTypeNames() {\r
-               return new String[] { TYPENAME } ;\r
-       }\r
-\r
-       @Override\r
-       protected void javaToNative(Object object, TransferData transferData) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See nativeToJava below\r
-               byte[] check = TYPENAME.getBytes();\r
-               super.javaToNative(check, transferData);\r
-       }\r
-\r
-       @Override\r
-       protected Object nativeToJava(TransferData transferData) {\r
-               Object result = super.nativeToJava(transferData);\r
-               if (isInvalidNativeType(result)) {\r
-                       throw new RuntimeException(); //$NON-NLS-1$\r
-               }\r
-               return name;\r
-       }\r
-       \r
-       private boolean isInvalidNativeType(Object result) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See javaToNative above\r
-               return !(result instanceof byte[])\r
-                               || !TYPENAME.equals(new String((byte[]) result));\r
-       }\r
-}\r
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/SynonymRelationshipTransfer.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/SynonymRelationshipTransfer.java
deleted file mode 100644 (file)
index 242dfd7..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.swt.dnd.ByteArrayTransfer;\r
-import org.eclipse.swt.dnd.TransferData;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-\r
-/**\r
- * For drag and drop - a drag widget with this transfer type \r
- *  can only be dropped onto a drop widget with the same type.\r
- *    \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class SynonymRelationshipTransfer extends ByteArrayTransfer {\r
-\r
-       private static final String RELATIONTYPENAME = "relation_type";\r
-       private static final int RELATIONTYPEID = registerType (RELATIONTYPENAME);              \r
-       private static final SynonymRelationshipTransfer INSTANCE = new SynonymRelationshipTransfer();\r
-       \r
-       /*\r
-        * The object associated with this transfer event\r
-        */\r
-       private SynonymRelationship synonymRelationship;\r
-               \r
-       /*\r
-        * Returns the singleton\r
-        */\r
-       public static SynonymRelationshipTransfer getInstance() {\r
-               return INSTANCE;\r
-       }\r
-       /*\r
-        * Set transfer data for local use\r
-        */\r
-       public void setSynonymRelationship(SynonymRelationship synonymRelationship) {\r
-               this.synonymRelationship = synonymRelationship;\r
-       }\r
-       /*\r
-        * Returns the local transfer data\r
-        */\r
-       public SynonymRelationship getSynonymRelationship() {\r
-               return synonymRelationship;\r
-       }\r
-       \r
-       /* \r
-        * The type ID is used to identify this transfer\r
-        */\r
-       @Override\r
-       protected int[] getTypeIds() {\r
-               return new int[] { RELATIONTYPEID };\r
-       }\r
-\r
-       @Override\r
-       protected String[] getTypeNames() {\r
-               return new String[] { RELATIONTYPENAME } ;\r
-       }\r
-\r
-       @Override\r
-       protected void javaToNative(Object object, TransferData transferData) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See nativeToJava below\r
-               byte[] check = RELATIONTYPENAME.getBytes();\r
-               super.javaToNative(check, transferData);\r
-       }\r
-\r
-       @Override\r
-       protected Object nativeToJava(TransferData transferData) {\r
-               Object result = super.nativeToJava(transferData);\r
-               if (isInvalidNativeType(result)) {\r
-                       throw new RuntimeException(); //$NON-NLS-1$\r
-               }\r
-               return synonymRelationship;\r
-       }\r
-       \r
-       private boolean isInvalidNativeType(Object result) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See javaToNative above\r
-               return !(result instanceof byte[])\r
-                               || !RELATIONTYPENAME.equals(new String((byte[]) result));\r
-       }\r
-}\r
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/TaxonTransfer.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/TaxonTransfer.java
deleted file mode 100644 (file)
index 84c92cf..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.swt.dnd.ByteArrayTransfer;\r
-import org.eclipse.swt.dnd.TransferData;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-\r
-/**\r
- * For drag and drop - a drag widget with this transfer type can only be dropped onto\r
- *  a drop widget with the same type.\r
- *    \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class TaxonTransfer extends ByteArrayTransfer {\r
-\r
-       private static final String TAXONTYPENAME = "taxon_type";\r
-       private static final int TAXONTYPEID = registerType (TAXONTYPENAME);            \r
-       private static final TaxonTransfer INSTANCE = new TaxonTransfer();\r
-       \r
-       /*\r
-        * The object associated with this transfer event\r
-        */\r
-       private TaxonBase taxonBase;\r
-               \r
-       /*\r
-        * Returns the singleton\r
-        */\r
-       public static TaxonTransfer getInstance() {\r
-               return INSTANCE;\r
-       }\r
-       /*\r
-        * Set transfer data for local use\r
-        */\r
-       public void setTaxon(TaxonBase taxon) {\r
-               this.taxonBase = taxon;\r
-       }\r
-       /*\r
-        * Returns the local transfer data\r
-        */\r
-       public TaxonBase getTaxon() {\r
-               return taxonBase;\r
-       }\r
-       \r
-       /* \r
-        * The type ID is used to identify this transfer\r
-        */\r
-       @Override\r
-       protected int[] getTypeIds() {\r
-               return new int[] { TAXONTYPEID };\r
-       }\r
-\r
-       @Override\r
-       protected String[] getTypeNames() {\r
-               return new String[] { TAXONTYPENAME } ;\r
-       }\r
-\r
-       @Override\r
-       protected void javaToNative(Object object, TransferData transferData) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See nativeToJava below\r
-               byte[] check = TAXONTYPENAME.getBytes();\r
-               super.javaToNative(check, transferData);\r
-       }\r
-\r
-       @Override\r
-       protected Object nativeToJava(TransferData transferData) {\r
-               Object result = super.nativeToJava(transferData);\r
-               if (isInvalidNativeType(result)) {\r
-                       throw new RuntimeException(); //$NON-NLS-1$\r
-               }\r
-               return taxonBase;\r
-       }\r
-       \r
-       private boolean isInvalidNativeType(Object result) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See javaToNative above\r
-               return !(result instanceof byte[])\r
-                               || !TAXONTYPENAME.equals(new String((byte[]) result));\r
-       }\r
-}\r
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/WidgetTransfer.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/controller/WidgetTransfer.java
deleted file mode 100644 (file)
index e2e9693..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-package eu.etaxonomy.taxeditor.controller;\r
-\r
-import org.eclipse.swt.dnd.ByteArrayTransfer;\r
-import org.eclipse.swt.dnd.TransferData;\r
-import org.eclipse.swt.widgets.Widget;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-\r
-/**\r
- * For drag and drop - a drag widget with this transfer type can only be dropped onto\r
- *  a drop widget with the same type.\r
- *    \r
- * @author p.ciardelli\r
- *\r
- */\r
-public class WidgetTransfer extends ByteArrayTransfer {\r
-\r
-       private static final String WIDGETTYPENAME = "widget_type";\r
-       private static final int WIDGETTYPEID = registerType (WIDGETTYPENAME);          \r
-       private static final WidgetTransfer INSTANCE = new WidgetTransfer();\r
-       \r
-       /*\r
-        * The object associated with this transfer event\r
-        */\r
-       private Widget widget;\r
-               \r
-       /*\r
-        * Returns the singleton\r
-        */\r
-       public static WidgetTransfer getInstance() {\r
-               return INSTANCE;\r
-       }\r
-       /*\r
-        * Set transfer data for local use\r
-        */\r
-       public void setWidget(Widget widget) {\r
-               this.widget = widget;\r
-       }\r
-       /*\r
-        * Returns the local transfer data\r
-        */\r
-       public Widget getWidget() {\r
-               return widget;\r
-       }\r
-       \r
-       /* \r
-        * The type ID is used to identify this transfer\r
-        */\r
-       @Override\r
-       protected int[] getTypeIds() {\r
-               return new int[] { WIDGETTYPEID };\r
-       }\r
-\r
-       @Override\r
-       protected String[] getTypeNames() {\r
-               return new String[] { WIDGETTYPENAME } ;\r
-       }\r
-\r
-       @Override\r
-       protected void javaToNative(Object object, TransferData transferData) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See nativeToJava below\r
-               byte[] check = WIDGETTYPENAME.getBytes();\r
-               super.javaToNative(check, transferData);\r
-       }\r
-\r
-       @Override\r
-       protected Object nativeToJava(TransferData transferData) {\r
-               Object result = super.nativeToJava(transferData);\r
-               if (isInvalidNativeType(result)) {\r
-                       throw new RuntimeException(); //$NON-NLS-1$\r
-               }\r
-               return widget;\r
-       }\r
-       \r
-       private boolean isInvalidNativeType(Object result) {\r
-               // No encoding needed since this is a hardcoded string read and written\r
-               // in the same process.\r
-               // See javaToNative above\r
-               return !(result instanceof byte[])\r
-                               || !WIDGETTYPENAME.equals(new String((byte[]) result));\r
-       }\r
-}\r