Merge branch 'develop' into feature/cdm-4.7
authorAndreas Müller <a.mueller@bgbm.org>
Sun, 4 Jun 2017 21:46:03 +0000 (23:46 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Sun, 4 Jun 2017 21:46:03 +0000 (23:46 +0200)
164 files changed:
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties
eu.etaxonomy.taxeditor.application/pom.xml
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveAllHandler.java [deleted file]
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveHandler.java [deleted file]
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.bulkeditor/pom.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/IEntityCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorSearch.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorSelectionPropertyTester.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForIdentifiableEntityE4.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/OccurrenceEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/NameCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/l10n/Messages.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/l10n/messages.properties
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.cdmlib/build.properties
eu.etaxonomy.taxeditor.cdmlib/pom.xml
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/fragment.e4xmi [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/pom.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenSpecimenEditorForTypeSpecimenHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToConceptOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/OpenDistributionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/graph/ConceptGraphView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/CreateConceptRelationHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/OpenRelatedConceptHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/DerivateViewContextMenu.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/ListenToSelectionChangeContextMenu.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AbstractAddDerivativeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddConsensusSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddDnaSampleHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddExistingMediaHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddMediaSpecimenHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddSingleReadHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddSpecimenHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddTissueSampleHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/DeleteDerivateHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ListenToSelectionChangeHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForDescriptionElement.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForSpecimenOrOBservationBase.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForTaxonNode.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadCopyToClipboardHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadRemoveHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadReuseHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ToggleLinkWithTaxonSelectionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchCompositeController.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DescriptionsMenuPropertyTester.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/DeleteMediaOperation.java
eu.etaxonomy.taxeditor.feature.platform/feature.xml
eu.etaxonomy.taxeditor.feature.platform/pom.xml
eu.etaxonomy.taxeditor.feature/feature.xml
eu.etaxonomy.taxeditor.feature/pom.xml
eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.help/pom.xml
eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular.lib/pom.xml
eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular/pom.xml
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/AbstractAlignmentEditorHandler.java
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/AbstractPherogramComponentHandler.java
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/LoadPherogramHandler.java
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ToggleInsertOverwriteHandler.java
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ToggleLeftRightInsertionHandler.java
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/pom.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/Messages.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages.properties
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveFactualDataHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultView.java
eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.printpublisher/pom.xml
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.store/fragment.e4xmi
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/pom.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/AppModelId.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelDistributionUpdateWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ImportFromFileAndChooseVocIdWizardOage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/RISImportWizard.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NomenclaturalCodeHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/VocabularyComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/SetSecundumConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteMediaConfiguratorComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalReferenceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractFormSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CommandHandlerButton.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenuE4.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerUtilE4.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditorContextMenu.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java
eu.etaxonomy.taxeditor.test/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.test/pom.xml
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java
eu.etaxonomy.taxeditor.webapp/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.webapp/pom.xml
eu.etaxonomy.taxeditor.workbench/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.workbench/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.workbench/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.workbench/pom.xml
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/SaveHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre
eu.etaxonomy.taxeditor/pom.xml
eu.etaxonomy.taxeditor/rcp.target
pom.xml

index a3a39ca..15d0410 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Application
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
 Bundle-Vendor: EDIT
 Bundle-Localization: OSGI-INF/l10n/plugin
index e2b5531..7a99367 100644 (file)
@@ -19,4 +19,5 @@ product.name = EDIT Taxonomic Editor
 activity.description = Disable unwanted eclipse UI\r
 activity.name = Disable\r
 product.name.0 = EDIT Taxonomic Editor\r
-command.label.25 = Import Preferences
\ No newline at end of file
+command.label.25 = Import Preferences\r
+command.label.23 = Server-sided Preferences
\ No newline at end of file
index 7ba63da..ae085c8 100644 (file)
@@ -45,7 +45,7 @@ command.label.19 = \u00dcber den Taxonomischen Editor
 command.label.20 = \u00dcber die EDIT Platform
 command.label.21 = Neu
 command.label.22 = Speichern
-command.label.23 = Datenbank Präferenzen
+command.label.23 = Serverseitige Präferenzen
 command.label.24 = Datenbank Reparatur Funktionalität
 command.label.25 = Import Präferenzen
 product.name = EDIT Taxonomischer Editor
index baa5126..94c6a77 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>4.7.0-SNAPSHOT</version>
+    <version>4.8.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
diff --git a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveAllHandler.java b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveAllHandler.java
deleted file mode 100644 (file)
index 9a2f179..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
-* 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;
-
-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.ui.handlers.HandlerUtil;
-
-/**
- * Now handled entirely by native save action.
- *
- * @author p.ciardelli
- * @created 04.09.2009
- * @version 1.0
- * @see ApplicationActionBarAdvisor
- */
-public class SaveAllHandler extends AbstractHandler {
-       private static final Logger logger = Logger.getLogger(SaveAllHandler.class);
-
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
-       /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveAllEditors(false);
-               return null;
-       }
-}
diff --git a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveHandler.java b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/SaveHandler.java
deleted file mode 100644 (file)
index ec28b9e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
-* 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;
-
-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.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Now handled entirely by native save action.
- *
- * @author p.ciardelli
- * @created 04.09.2009
- * @version 1.0
- * @see ApplicationActionBarAdvisor
- */
-public class SaveHandler extends AbstractHandler {
-       private static final Logger logger = Logger.getLogger(SaveHandler.class);
-
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
-       /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               IEditorPart editor = HandlerUtil.getActiveEditor(event);
-               if (editor != null) {
-                       HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveEditor(editor, false);
-               }
-               return null;
-       }
-}
index 02798a2..38d79e0 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Bulkeditor Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
@@ -21,7 +21,8 @@ Require-Bundle: eu.etaxonomy.taxeditor.workbench,
  eu.etaxonomy.taxeditor.store,
  eu.etaxonomy.taxeditor.cdmlib,
  org.eclipse.e4.ui.model.workbench;bundle-version="1.2.0.v20160229-1459",
- org.eclipse.e4.ui.workbench
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.core.di.annotations;bundle-version="1.5.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Import-Package: eu.etaxonomy.taxeditor.editor,
  org.eclipse.core.runtime,
index 299073f..1009e4a 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>4.7.0-SNAPSHOT</version>
+               <version>4.8.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 062138c..13c3aff 100644 (file)
@@ -275,7 +275,8 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                                }
                                if (annotation.isMarkedAsMerged()) {
                                        persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); //  merge
-                               } if (annotation.isMarkedAsDeleted()) {
+                               } 
+                               if (annotation.isMarkedAsDeleted()) {
                                        try {
                                                persistenceService.delete(annotation.getEntity(), annotation.getDeleteConfigurator());
                                        } catch (ReferencedObjectUndeletableException e) {
index decdc7e..4601d24 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -11,8 +11,6 @@ package eu.etaxonomy.taxeditor.annotatedlineeditor;
 
 import java.util.Map;
 
-import eu.etaxonomy.cdm.model.common.ICdmBase;
-
 
 /**
  * <p>IEntityCreator interface.</p>
@@ -22,7 +20,7 @@ import eu.etaxonomy.cdm.model.common.ICdmBase;
  * @version 1.0
  */
 public interface IEntityCreator<T> {
-       
+
        /**
         * <p>createEntity</p>
         *
@@ -31,7 +29,7 @@ public interface IEntityCreator<T> {
         * @return a T object.
         */
        T createEntity(String text);
-       
+
        /**
         * <p>createEntity</p>
         *
@@ -40,21 +38,21 @@ public interface IEntityCreator<T> {
         * @return a T object.
         */
        T createEntity(Object key, String text);
-       
+
        /**
         * Get a map of keys for all objects that can be created by this entity creator
         * along with their string representations.
         *
         * @return a {@link java.util.Map} object.
         */
-       Map<Object, String> getKeyLabelPairs();
-       
+       Map<? extends Object, String> getKeyLabelPairs();
+
        /**
         * Return a flag indicating whether this creator also saves the entities
         *
         * @return true or false
         */
        boolean savesEntity();
-       
+
 
 }
index ff0356c..548802b 100644 (file)
@@ -74,7 +74,7 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
        private boolean isDirty;
 
     private IUndoContext undoContext;
-  
+
        public BulkEditor() {
                super(CdmStore.createConversation());
         undoContext = new UndoContext();
@@ -254,14 +254,15 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
            isDirty = true;
            firePropertyChange(PROP_DIRTY);
        }
-       
-       
+
+
        @Override
        public void doSave(IProgressMonitor progressMonitor) {
            isDirty = false;
 
            super.doSave(progressMonitor);
 
+           this.searchBar.updateEditorInput();
            selectFirstItem();
 
                getSourceViewer().getTextWidget().setFocus();
@@ -300,7 +301,7 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                        getEditorInput().dispose();
                        getEditorInput().bind();
                        getEditorInput().performSearch(query);
-                       
+
                        refresh();
 
                        selectFirstItem();
@@ -345,5 +346,5 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
         return undoContext;
     }
 
-       
+
 }
index b4c13ef..f1e7a0e 100644 (file)
@@ -96,7 +96,7 @@ public class BulkEditorSearch {
         */
        private void registerAtFocusService() {
                IFocusService focusService =
-                       (IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
+                       PlatformUI.getWorkbench().getService(IFocusService.class);
                if (focusService != null) {
                        focusService.addFocusTracker(text, "bulkeditor.textControlId");
                }
@@ -150,7 +150,7 @@ public class BulkEditorSearch {
        /**
         * Shows the results of the search.
         */
-       private void updateEditorInput() {
+       public void updateEditorInput() {
 
                String searchString = getSearchString().trim();
 
index 4a2aee9..c63d7bd 100644 (file)
@@ -23,7 +23,6 @@ public class BulkEditorSelectionPropertyTester extends PropertyTester {
                                        return BulkEditorInputType.getByType(((UuidAndTitleCache) selectedElement).getType())!=null;
                                    }
                                    else if(selectedElement instanceof TreeNode){
-                                       System.out.println(BulkEditorInputType.getByType(((TreeNode) selectedElement).getValue().getClass())!=null);
                                        return BulkEditorInputType.getByType(((TreeNode) selectedElement).getValue().getClass())!=null;
                                    }
                                        return BulkEditorInputType.getByType(selectedElement.getClass())!=null;
index ecc6c89..2d49f3b 100644 (file)
@@ -41,7 +41,7 @@ public class DynamicNewObjectMenu extends CompoundContributionItem {
                        .getLogger(DynamicNewObjectMenu.class);
 
        private final IHandlerService handlerService = (IHandlerService) BulkEditorUtil.getService(IHandlerService.class);
-       private Map<Object, String> classLabelPairs;
+       private Map<? extends Object, String> classLabelPairs;
 
        /** {@inheritDoc} */
        @Override
@@ -88,7 +88,7 @@ public class DynamicNewObjectMenu extends CompoundContributionItem {
         * Get class label pairs from Annotated Line Editor's entity creator.
         * @return
         */
-       private Map<Object, String> getClassLabelPairs() {
+       private Map<? extends Object, String> getClassLabelPairs() {
                IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
                if (editor != null){
                        IEditorInput input = editor.getEditorInput();
index cc9ff85..2ba39ab 100644 (file)
@@ -9,6 +9,7 @@
 
 package eu.etaxonomy.taxeditor.bulkeditor.handler;
 
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -19,6 +20,7 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.text.source.Annotation;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
@@ -32,6 +34,7 @@ import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
 import eu.etaxonomy.cdm.api.service.config.MediaDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
 import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
@@ -51,6 +54,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.bulkeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -107,8 +111,15 @@ public class DeleteHandler extends AbstractHandler {
                                            controller = CdmStore.getCurrentApplicationConfiguration();
                                            if (object instanceof SpecimenOrObservationBase){
                                                IOccurrenceService service = controller.getOccurrenceService();
+                                               config = new SpecimenDeleteConfigurator();
+
+                                DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), CONFIRM_DELETION,  null,  Messages.BulkEditor_DeleteHandler_reallyDeleteSpecimen, MessageDialog.WARNING, new String[] { DELETE, SKIP }, 0, true);
+                                int result_dialog= dialog.open();
+                                if (result_dialog != Status.OK){
+                                    return null;
+                                }
                                                        if (object != null){
-                                                               result = service.isDeletable(((SpecimenOrObservationBase) object).getUuid(), null);
+                                                               result = service.isDeletable(((SpecimenOrObservationBase) object).getUuid(), config);
                                                                errorMessage = "The specimen or observation ";
 
                                                        }
@@ -207,7 +218,12 @@ public class DeleteHandler extends AbstractHandler {
                                                MessagingUtils.messageDialog("Delete not possible", getClass(), "The object could not be deleted. An exception occured.", null);
                                        }
                                }else if (model != null) {
-                        Iterator iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
+                                       int offset = selection.getOffset();
+                                       if (offset == 0){
+                                               offset = 1;
+                                       }
+                        Iterator iter = model.getAnnotationIterator(offset, selection.getLength(), true, true);
+                   //     Iterator<Annotation> iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
                         while (iter.hasNext()) {
                             Object next = iter.next();
                             if (next instanceof LineAnnotation) {
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForIdentifiableEntityE4.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForIdentifiableEntityE4.java
new file mode 100644 (file)
index 0000000..c21063f
--- /dev/null
@@ -0,0 +1,28 @@
+package eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler;
+
+import java.util.UUID;
+
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class OpenBulkEditorForIdentifiableEntityE4 {
+
+       @Execute
+       public void execute(MHandledMenuItem menuItem) {
+           String commandId = menuItem.getCommand().getElementId();
+        UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".uuid");
+           IdentifiableEntity entity = CdmStore.getCommonService().find(IdentifiableEntity.class, uuid);
+               try {
+                       BulkEditorUtil.openEditor(entity);
+               } catch (PartInitException e) {
+            MessagingUtils.error(this.getClass(), "Bulk Editor could not be opened for "+entity, e);
+               }
+       }
+
+}
index 9464f33..6d00f41 100644 (file)
@@ -13,13 +13,14 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
+import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.OccurrenceCreator;
@@ -111,14 +112,23 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
         * @throws ReferencedObjectUndeletableException */
        @Override
     public boolean delete(SpecimenOrObservationBase entity, DeleteConfiguratorBase config ) throws ReferencedObjectUndeletableException {
-               return CdmStore.getService(IOccurrenceService.class).delete(entity) != null;
+           DeleteResult deleteResult;
+           SpecimenDeleteConfigurator specimenConfig;
+           if (config instanceof SpecimenDeleteConfigurator){
+               specimenConfig = (SpecimenDeleteConfigurator)config;
+           }else{
+               specimenConfig = new SpecimenDeleteConfigurator();
+           }
+           deleteResult = CdmStore.getService(IOccurrenceService.class).delete(entity.getUuid(), specimenConfig);
+
+               return deleteResult.isOk();
        }
 
        /** {@inheritDoc} */
        @Override
     public SpecimenOrObservationBase<?> save(SpecimenOrObservationBase entity) {
            return CdmStore.getService(IOccurrenceService.class).merge(entity, true).getMergedEntity();
-          
+
        }
 
        @Override
index eaa6baf..6c6e9a7 100644 (file)
@@ -9,7 +9,7 @@
 
 package eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator;
 
-import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -60,10 +60,12 @@ public class NameCreator implements IEntityCreator<TaxonNameBase> {
         * @return a {@link java.util.Map} object.
         */
         @Override
-    public Map<Object, String> getKeyLabelPairs() {
-               Map<Object, String> result = new TreeMap<Object, String>();
+    public Map<Rank, String> getKeyLabelPairs() {
+               Map<Rank, String> result = new TreeMap<Rank, String>(
+                (Comparator<Rank>) (o1, o2) -> o2.compareTo(o1)
+        );
                List<Rank> ranks = CdmStore.getTermManager().getPreferredTerms(Rank.class);
-               Collections.reverse(ranks);
+               //Collections.reverse(ranks);
                for (Rank rank : ranks) {
                        result.put(rank, rank.getLabel());
                }
index 768046e..3a3cf34 100755 (executable)
@@ -18,6 +18,9 @@ import org.eclipse.osgi.util.NLS;
 public class Messages extends NLS {
     private static final String BUNDLE_NAME = "src/main/java/eu.etaxonomy.taxeditor.bulkeditor.l10n.messages"; //$NON-NLS-1$
     public static String ReferencingObjectsLabelProvider_No_description_available;
+    public static String ConvertPerson2TeamHandler_warning;
+    public static String ConvertPerson2TeamHandler_lable;
+    public static String BulkEditor_DeleteHandler_reallyDeleteSpecimen;
     static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
index 5cb5303..0a32298 100755 (executable)
@@ -1 +1,4 @@
 ReferencingObjectsLabelProvider_No_description_available=No description available
+ConvertPerson2TeamHandler_warning=While reloading the data an exception occured
+ConvertPerson2TeamHandler_lable=Convert Person to Team
+BulkEditor_DeleteHandler_reallyDeleteSpecimen=Do you really want to delete the specimen/field unit? This is irreversible.
\ No newline at end of file
index bfcb11a..916de6b 100755 (executable)
@@ -1 +1,4 @@
-ReferencingObjectsLabelProvider_No_description_available=Keine Beschreibung verfügbar
\ No newline at end of file
+ReferencingObjectsLabelProvider_No_description_available=Keine Beschreibung verfügbar
+ConvertPerson2TeamHandler_warning=Beim Neuladen der Daten ist ein Fehler aufgetreten
+ConvertPerson2TeamHandler_lable=Wandle Person in Team um
+BulkEditor_DeleteHandler_reallyDeleteSpecimen=Möchten Sie das Specimen/die FieldUnit wirklich löschen, dieser Vorgang kann nicht rückgängig gemacht werden.
\ No newline at end of file
index 00bcc23..d0922b8 100644 (file)
@@ -76,7 +76,6 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.DescriptionHelper;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
 
@@ -95,7 +94,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
 
        private String referencedObjectTitleCache;
        private ConversationHolder conversation;
-       private final ICdmEntitySession cdmEntitySession;
+       //private final ICdmEntitySession cdmEntitySession;
        private UUID actualUuid;
        List<CdmBase> referencingObjects = null;
        Set<CdmBase> referencingObjectsSet = null;
@@ -103,7 +102,9 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
        private Job currentJob = null;
 
        public ReferencingObjectsView() {
-           cdmEntitySession = CdmStore.getCurrentSessionManager().bindNullSession();
+         // cdmEntitySession = CdmStore.getCurrentSessionManager().getNullSession();
+
+               //cdmEntitySession = CdmStore.getCurrentSessionManager().bindNullSession();
        }
 
        /** {@inheritDoc} */
@@ -116,6 +117,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                createColumns(viewer);
                viewer.setContentProvider(new ReferencingObjectsContentProvider());
                viewer.setLabelProvider(new ReferencingObjectsLabelProvider());
+
                viewer.setCellModifier(new ICellModifier() {
             @Override
             public void modify(Object element, String property, Object value) {
@@ -147,6 +149,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
         getSite().registerContextMenu(menuManager, viewer);
         Control control = viewer.getControl();
         Menu menu = menuManager.createContextMenu(control);
+        menuManager.setRemoveAllWhenShown(true);
         control.setMenu(menu);
 
         // Propagate selection from viewer
@@ -181,14 +184,14 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
 
        @Override
        public void setFocus() {
-           cdmEntitySession.bind();
+          // cdmEntitySession.bind();
        }
 
        public void updateReferencingObjects(final UUID entityUUID, final Class objectClass) {
            if (actualUuid == entityUUID){
                return ;
            }
-           showEmptyPage();
+
            if(actualMonitor!=null && !actualMonitor.isCanceled()){
 //             boolean success = false;
 //             //wait for cancel to be done
@@ -201,10 +204,11 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                }
 
            }
-               currentJob = new Job("Update Referencing Objects " + entityUUID) {
+           showEmptyPage();
+               currentJob = new Job("Update Referencing Objects") {
 
                        @Override
-                       protected IStatus run(IProgressMonitor monitor) {
+                       protected IStatus run(final IProgressMonitor monitor) {
                                monitor.beginTask("Calculating referencing objects", 100);
                                actualUuid = entityUUID;
 
@@ -220,8 +224,8 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                                }
                                actualMonitor = monitor;
                                if (entityUUID != null){
-                                   ICdmEntitySession previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
-                       cdmEntitySession.bind();
+//                                 ICdmEntitySession previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+//                     cdmEntitySession.bind();
                        referencingObjectsSet = getReferencingObjects(entityUUID, objectClass);
 
                        if(monitor.isCanceled()) {
@@ -240,22 +244,24 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                        }
 
                        if(monitor.isCanceled()) {
-                           if(previousCdmEntitySession != null) {
-                               previousCdmEntitySession.bind();
-                           }
+//                         if(previousCdmEntitySession != null) {
+//                             previousCdmEntitySession.bind();
+//                         }
 
                            return Status.CANCEL_STATUS;
                        }
                        monitor.worked(80);
-                    updateView();
 
-                       if(previousCdmEntitySession != null) {
-                           previousCdmEntitySession.bind();
-                       }
+                       updateView();
+//                     if(previousCdmEntitySession != null) {
+//                         previousCdmEntitySession.bind();
+//                     }else{
+//                             CdmStore.getCurrentSessionManager().bind(null);
+//                     }
                       // actualUuid = entityUUID;
                                }
                                monitor.done();
-
+                               actualMonitor = null;
 
                                return Status.OK_STATUS;
 
@@ -265,20 +271,6 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                currentJob.setUser(true);
 
                currentJob.schedule();
-//             final IJobChangeListener listener;
-//             listener =  new JobChangeAdapter() {
-//            @Override
-//            public void done(IJobChangeEvent event) {
-//                System.err.println("Job is done" + entityUUID);
-//                //event.getJob().cancel();
-//            }
-//
-//        };
-//        currentJob.addJobChangeListener(listener);
-
-
-
-
        }
 
        private Set<CdmBase> getReferencingObjects(UUID entity, Class objectClass) {
@@ -390,6 +382,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
            Display.getDefault().asyncExec(new Runnable() {
             @Override
             public void run() {
+
                        if (viewer != null && !viewer.getControl().isDisposed()){
                                try{
                                        viewer.setInput(referencingObjects);
@@ -398,7 +391,6 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
 
                                        //enable/disable table
                                        viewer.getControl().setEnabled(referencingObjects!=null);
-
                                }catch(Exception e){
                                    e.printStackTrace();
                                    logger.debug(e.getStackTrace());
@@ -415,11 +407,12 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
            Display.getDefault().asyncExec(new Runnable() {
             @Override
             public void run() {
-                   if (referencedObjectTitleCache != null){
+               if (referencedObjectTitleCache != null){
                     setContentDescription(description);
                 } else {
                     setContentDescription(description);
                 }
+
             }
 
          });
@@ -440,7 +433,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
 
        /** {@inheritDoc} */
        @Override
-       public void showViewer(IWorkbenchPart part, IStructuredSelection selection) {
+       public void showViewer(Object part, IStructuredSelection selection) {
        //      this.part = part;
 
                Object firstElement = selection.getFirstElement();
@@ -486,7 +479,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                conversation.close();
                selectionService.removePostSelectionListener(this);
                selectionService.removeSelectionListener(this);
-               cdmEntitySession.dispose();
+               //cdmEntitySession.dispose();
                super.dispose();
 
        }
index 61ebbc5..b695994 100644 (file)
        <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.8.8.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.8.8.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-4.7.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-test-4.7.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-4.8.0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-test-4.8.0-SNAPSHOT.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.9.2.jar"/>
index f2b0a7a..8d34308 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: CDM Library Dependencies Plugin
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Eclipse-BundleShape: dir
 Export-Package: com.google.api,
  com.google.api.detect,
@@ -82,6 +82,7 @@ Export-Package: com.google.api,
  eu.etaxonomy.cdm.io.outputmodel,
  eu.etaxonomy.cdm.io.pilotOutputHtml,
  eu.etaxonomy.cdm.io.reference.endnote.in,
+ eu.etaxonomy.cdm.io.reference.ris.in,
  eu.etaxonomy.cdm.io.sdd,
  eu.etaxonomy.cdm.io.sdd.ikeyplus,
  eu.etaxonomy.cdm.io.sdd.in,
@@ -643,15 +644,15 @@ Bundle-ClassPath: .,
  lib/aspectjrt-1.8.8.jar,
  lib/aspectjweaver-1.8.8.jar,
  lib/batik-xml-1.7.jar,
- lib/cdmlib-commons-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-ext-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-io-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-model-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-persistence-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-print-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-remote-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-services-4.7.0-SNAPSHOT.jar,
- lib/cdmlib-test-4.7.0-SNAPSHOT.jar,
+ lib/cdmlib-commons-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-ext-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-io-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-model-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-persistence-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-print-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-remote-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-services-4.8.0-SNAPSHOT.jar,
+ lib/cdmlib-test-4.8.0-SNAPSHOT.jar,
  lib/com.springsource.org.aopalliance-1.0.0.jar,
  lib/com.springsource.org.apache.commons.logging-1.1.1.jar,
  lib/commons-beanutils-1.9.2.jar,
index e12cacf..bbe77ea 100644 (file)
@@ -6,15 +6,15 @@ bin.includes = META-INF/,\
                lib/aspectjrt-1.8.8.jar,\
                lib/aspectjweaver-1.8.8.jar,\
                lib/batik-xml-1.7.jar,\
-               lib/cdmlib-commons-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-ext-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-io-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-model-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-persistence-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-print-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-remote-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-services-4.7.0-SNAPSHOT.jar,\
-               lib/cdmlib-test-4.7.0-SNAPSHOT.jar,\
+               lib/cdmlib-commons-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-ext-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-io-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-model-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-persistence-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-print-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-remote-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-services-4.8.0-SNAPSHOT.jar,\
+               lib/cdmlib-test-4.8.0-SNAPSHOT.jar,\
                lib/com.springsource.org.aopalliance-1.0.0.jar,\
                lib/com.springsource.org.apache.commons.logging-1.1.1.jar,\
                lib/commons-beanutils-1.9.2.jar,\
index e225d23..89abade 100644 (file)
@@ -4,7 +4,7 @@
   <parent>\r
     <groupId>eu.etaxonomy</groupId>\r
     <artifactId>taxeditor-parent</artifactId>\r
-    <version>4.7.0-SNAPSHOT</version>\r
+    <version>4.8.0-SNAPSHOT</version>\r
   </parent>\r
   <modelVersion>4.0.0</modelVersion>\r
   <artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>\r
index 577a82f..f10e87b 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Editor Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: OSGI-INF/l10n/plugin
@@ -28,14 +28,26 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.zest.core,
  org.eclipse.zest.layouts,
  eu.etaxonomy.taxeditor.cdmlib,
- org.eclipse.ui.ide
+ org.eclipse.ui.ide,
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.e4.core.di,
+ org.eclipse.e4.ui.model.workbench,
+ org.eclipse.e4.ui.di
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.core.databinding.beans,
+Import-Package: javax.inject;version="1.0.0",
+ org.eclipse.core.databinding.beans,
  org.eclipse.core.databinding.observable.list,
  org.eclipse.core.databinding.observable.map,
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
+ org.eclipse.e4.core.di.annotations,
+ org.eclipse.e4.ui.di,
+ org.eclipse.e4.ui.model.application,
+ org.eclipse.e4.ui.model.application.ui,
+ org.eclipse.e4.ui.model.application.ui.basic,
+ org.eclipse.e4.ui.model.application.ui.menu,
+ org.eclipse.e4.ui.services,
  org.eclipse.equinox.app,
  org.eclipse.jface.databinding.viewers,
  org.eclipse.jface.text,
index cbecb3f..bbd81a8 100644 (file)
@@ -189,4 +189,23 @@ command.name.TOGGLE_LINK_WITH_TAXON_SELECTION = Toggle link with taxon selection
 viewCommandMapping.viewerName.NAME_EDITOR = Name Editor\r
 viewCommandMapping.viewerName.SPECIMEN_EDITOR = Specimen Editor\r
 viewCommandMapping.viewerName.CHECKLIST_EDITOR = Distribution Editor\r
-command.name.OPEN_EDITOR_FOR_TYPE_SPECIMEN = Open specimen editor for type specimen
\ No newline at end of file
+command.name.OPEN_EDITOR_FOR_TYPE_SPECIMEN = Open specimen editor for type specimen
+menu.label.5 = Add...
+handledmenuitem.label.1 = Specimen
+handledmenuitem.label.2 = Tissue Sample
+handledmenuitem.label.3 = DNA Sample
+handledmenuitem.label.4 = Consensus Sequence
+menu.label.6 = Media
+handledmenuitem.label.5 = Media Specimen
+handledmenuitem.label.6 = Existing Media
+handledmenuitem.label.7 = Single Read
+handledmenuitem.label.8 = Create Field Unit For ...
+handledmenuitem.label.9 = Create Field Unit
+command.commandname.1 = Create Field Unit
+command.commandname.2 = Add Specimen
+command.commandname.3 = Add Tissue Sample
+command.commandname.4 = Add DNA Sample
+command.commandname.5 = Add Existing Media
+command.commandname.6 = Add Media Specimen
+command.commandname.7 = Add Consensus Sequence
+command.commandname.8 = Add Single Read
diff --git a/eu.etaxonomy.taxeditor.editor/fragment.e4xmi b/eu.etaxonomy.taxeditor.editor/fragment.e4xmi
new file mode 100644 (file)
index 0000000..85719aa
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_OhwnQCTfEeeiN5lBIuqN3g">
+  <imports xsi:type="commands:Command" xmi:id="_WPjpoDSnEeek0dKsFNy--Q" elementId="eu.etaxonomy.taxeditor.command.openPart"/>
+  <imports xsi:type="commands:Command" xmi:id="_Qz6EMD62EeekvPZafWEv7w" elementId="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity"/>
+  <imports xsi:type="commands:Command" xmi:id="_majwMEaQEeeXMc6kSYO7Xg" elementId="org.eclipse.ui.file.save"/>
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_gSpRsDQDEeeTNOFVGI4q2w" featurename="descriptors" parentElementId="xpath:/">
+    <elements xsi:type="basic:PartDescriptor" xmi:id="_gSpRsTQDEeeTNOFVGI4q2w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView" label="%command.label.DERIVATIVE_EDITOR" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/derivate_view-16x16-32.png" tooltip="%command.label.DERIVATIVE_EDITOR" allowMultiple="true" category="Sample Category" closeable="true" dirtyable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+      <tags>View</tags>
+      <tags>categoryTag:Sample Category</tags>
+      <handlers xmi:id="_E5l4wDVqEee_b7RlBzTDRw" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.CreateFieldUnitHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.CreateFieldUnitHandler" command="_BjF3ADVqEee_b7RlBzTDRw"/>
+      <handlers xmi:id="_ha1I4DmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddSpecimenHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddSpecimenHandler" command="_qqMbcDmBEeeOos_QXKSXcA"/>
+      <handlers xmi:id="_FOiO0DocEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddTissueSampleHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddTissueSampleHandler" command="_I2LD4DocEeecLdI14WMq7w"/>
+      <handlers xmi:id="_mrTfkDonEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddDnaSampleHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddDnaSampleHandler" command="_jsbToDonEeecLdI14WMq7w"/>
+      <handlers xmi:id="_B5hkYDooEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddMediaSpecimenHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddMediaSpecimenHandler" command="_pKdiQDoqEeecLdI14WMq7w"/>
+      <handlers xmi:id="_3RPaQDorEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddExistingMediaHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddExistingMediaHandler" command="_-haZEDonEeecLdI14WMq7w"/>
+      <handlers xmi:id="_OOIwoDooEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddConsensusSequenceHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddConsensusSequenceHandler" command="_IdPwEDooEeecLdI14WMq7w"/>
+      <handlers xmi:id="_Vf1coDooEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddSingleReadHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddSingleReadHandler" command="_LTuN8DooEeecLdI14WMq7w"/>
+      <handlers xmi:id="_Y1cLkDueEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.ToggleLinkWithTaxonSelectionHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.ToggleLinkWithTaxonSelectionHandler" command="_UwK_UDueEeeOtqC_3qh40A"/>
+      <handlers xmi:id="_sGhWgDulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler" command="_fKT-wDulEeeOtqC_3qh40A"/>
+      <handlers xmi:id="_QNvcUDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler.copySingleRead" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadCopyToClipboardHandler" command="_N0wLsDumEeeOtqC_3qh40A"/>
+      <handlers xmi:id="_bAGysDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler.reuseSingleRead" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadReuseHandler" command="_HmerkDumEeeOtqC_3qh40A"/>
+      <handlers xmi:id="_ed9ZoDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler.removeSingleRead" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadRemoveHandler" command="_K4DxEDumEeeOtqC_3qh40A"/>
+      <handlers xmi:id="_CQjyIDvaEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler" command="_YPp1wDvREeeOtqC_3qh40A"/>
+      <handlers xmi:id="_OJK8QD62EeekvPZafWEv7w" elementId="eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler.OpenBulkEditorForIdentifiableEntityE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.bulkeditor/eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler.OpenBulkEditorForIdentifiableEntityE4" command="_Qz6EMD62EeekvPZafWEv7w"/>
+      <handlers xmi:id="_BWBGgEaQEeeXMc6kSYO7Xg" elementId="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SaveHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.SaveHandler" command="_majwMEaQEeeXMc6kSYO7Xg"/>
+      <menus xsi:type="menu:PopupMenu" xmi:id="_CYXZ0DQEEeeTNOFVGI4q2w" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.specimeneditor">
+        <children xsi:type="menu:Menu" xmi:id="_cdjzEDmAEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.menu.add" label="%menu.label.5">
+          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_ASKmMDpCEeecM-jyCkToYw" coreExpressionId="isAddDerivateAllowed"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_R27WIDmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.specimen" label="%handledmenuitem.label.1" command="_qqMbcDmBEeeOos_QXKSXcA"/>
+          <children xsi:type="menu:MenuSeparator" xmi:id="_ueupgDowEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.0"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_TKz_4DmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.tissuesample" label="%handledmenuitem.label.2" command="_I2LD4DocEeecLdI14WMq7w"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_UukRoDmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.dnasample" label="%handledmenuitem.label.3" command="_jsbToDonEeecLdI14WMq7w"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_YYSxYDmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.consensussequence" label="%handledmenuitem.label.4" command="_IdPwEDooEeecLdI14WMq7w"/>
+          <children xsi:type="menu:Menu" xmi:id="_C4qJUDosEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.menu.specimen_editor.media" label="%menu.label.6">
+            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_8zj4sDo-EeecM-jyCkToYw" coreExpressionId="isAddMediaAllowed"/>
+            <children xsi:type="menu:HandledMenuItem" xmi:id="_WwK9ADmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.mediaspecimen" label="%handledmenuitem.label.5" command="_pKdiQDoqEeecLdI14WMq7w"/>
+            <children xsi:type="menu:HandledMenuItem" xmi:id="_MecX0DosEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.existingmedia" label="%handledmenuitem.label.6" command="_-haZEDonEeecLdI14WMq7w"/>
+          </children>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_Z-LKEDmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.singleread" label="%handledmenuitem.label.7" command="_LTuN8DooEeecLdI14WMq7w"/>
+        </children>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_O4ujcDuhEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.1"/>
+        <children xsi:type="menu:DynamicMenuContribution" xmi:id="_yz9M4DxrEeeqBMqdgjGMrQ" elementId="eu.etaxonomy.taxeditor.editor.specimeneditor.dynamicmenucontribution.cdmViewer" label="Open in..." contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.CdmViewerContextMenuE4"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_sp6BoDy8EeeqBMqdgjGMrQ" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.5"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_um1oYDVpEee_b7RlBzTDRw" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.create_field_unit_for_taxon" label="%handledmenuitem.label.8" command="_BjF3ADVqEee_b7RlBzTDRw"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_5GMRcDWQEeeNfoZ3nN0K8Q" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.createfieldunit" label="%handledmenuitem.label.9" command="_BjF3ADVqEee_b7RlBzTDRw"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_QoiUMDuhEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.2"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_eElJ8DueEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabellink_with_taxon_selection" label="%command.label.LINK_WITH_TAXON_SELECTION" command="_UwK_UDueEeeOtqC_3qh40A"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_9nI4IDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.4"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_h4pX0DumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandnamereuse_single_read" label="%command.label.REUSE_SINGLE_READ_HERE" command="_HmerkDumEeeOtqC_3qh40A"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_oQXH0DumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelreuse_single_read_for_other_sequence" label="%command.label.REUSE_SINGLE_READ_FOR_OTHER_SEQUENCE" command="_N0wLsDumEeeOtqC_3qh40A"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_1apX0DumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelremove_single_read_from_this_sequence" label="%command.label.REMOVE_SINGLE_READ_FROM_THIS_SEQUENCE" command="_K4DxEDumEeeOtqC_3qh40A"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="_c0f98DulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.3"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_XWW6QDulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel52" label="%command.label.52" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/delete.gif" command="_YPp1wDvREeeOtqC_3qh40A"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_wg0-oDulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel54" label="%command.label.54" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/deep-delete-16x16-32.png" command="_fKT-wDulEeeOtqC_3qh40A"/>
+      </menus>
+    </elements>
+  </fragments>
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="__mwtMDVpEee_b7RlBzTDRw" featurename="commands" parentElementId="xpath:/">
+    <elements xsi:type="commands:Command" xmi:id="_BjF3ADVqEee_b7RlBzTDRw" elementId="eu.etaxonomy.taxeditor.editor.command.specimeneditor.create_field_unit" commandName="%command.commandname.1"/>
+    <elements xsi:type="commands:Command" xmi:id="_qqMbcDmBEeeOos_QXKSXcA" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_specimen" commandName="%command.commandname.2"/>
+    <elements xsi:type="commands:Command" xmi:id="_I2LD4DocEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_tissue_sample" commandName="%command.commandname.3"/>
+    <elements xsi:type="commands:Command" xmi:id="_jsbToDonEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_dna_sample" commandName="%command.commandname.4"/>
+    <elements xsi:type="commands:Command" xmi:id="_-haZEDonEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_existing_media_specimen" commandName="%command.commandname.5"/>
+    <elements xsi:type="commands:Command" xmi:id="_pKdiQDoqEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_media_specimen" commandName="%command.commandname.6"/>
+    <elements xsi:type="commands:Command" xmi:id="_IdPwEDooEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_consensus_sequence" commandName="%command.commandname.7"/>
+    <elements xsi:type="commands:Command" xmi:id="_LTuN8DooEeecLdI14WMq7w" elementId="eu.etaxonomy.taxeditor.editor.command.add_derivate.add_single_read" commandName="%command.commandname.8"/>
+    <elements xsi:type="commands:Command" xmi:id="_UwK_UDueEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection" commandName="%command.label.LINK_WITH_TAXON_SELECTION"/>
+    <elements xsi:type="commands:Command" xmi:id="_fKT-wDulEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.derivate.deepDelete" commandName="%command.label.54"/>
+    <elements xsi:type="commands:Command" xmi:id="_HmerkDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead" commandName="%command.name.REUSE_SINGLE_READ"/>
+    <elements xsi:type="commands:Command" xmi:id="_K4DxEDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence" commandName="%command.name.REMOVE_SINGLE_READ"/>
+    <elements xsi:type="commands:Command" xmi:id="_N0wLsDumEeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard" commandName="%command.name.COPY_SINGLE_READ_TO_CLIPBOARD"/>
+    <elements xsi:type="commands:Command" xmi:id="_YPp1wDvREeeOtqC_3qh40A" elementId="eu.etaxonomy.taxeditor.editor.derivate.delete" commandName="Delete"/>
+  </fragments>
+</fragment:ModelFragments>
index 838b951..4c12d83 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
             name="%editor.name.8">
       </editor>
-         <editor
-               class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-               default="false"
-               icon="icons/derivate_view-16x16-32.png"
-               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-               name="%editor.name.DERIVATIVE_EDITOR">
-         </editor>
    </extension>
       <extension
             point="org.eclipse.ui.views">
          </separator>
       </menuContribution>
       <menuContribution
-            locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
-         <separator
-               name="eu.etaxonomy.taxeditor.editor.separator4"
-               visible="true">
-         </separator>
-         <dynamic
-               class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
-               id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
-         </dynamic>
-         <dynamic
-               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
-               id="eu.etaxonomy.taxeditor.editor.derivativeEditor.CdmViewerContextMenu">
-         </dynamic>
-         <separator
-               name="eu.etaxonomy.taxeditor.editor.separator1"
-               visible="true">
-         </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection"
-               label="%command.label.LINK_WITH_TAXON_SELECTION"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <not>
-                  <reference
-                        definitionId="isDerivativeEditorLinkedToTaxonSelection">
-                  </reference>
-               </not>
-            </visibleWhen>
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection"
-               label="%command.label.UNLINK_FROM_TAXON_SELECTION"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isDerivativeEditorLinkedToTaxonSelection">
-               </reference>
-            </visibleWhen>
-         </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.editor.separator3"
-               visible="true">
-         </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead"
-               id="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleReadMenuItem"
-               label="%command.label.REUSE_SINGLE_READ_HERE"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isSingleReadReusableHere">
-               </reference>
-            </visibleWhen>
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard"
-               label="%command.label.REUSE_SINGLE_READ_FOR_OTHER_SEQUENCE"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isSingleRead">
-               </reference>
-            </visibleWhen>
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence"
-               label="%command.label.REMOVE_SINGLE_READ_FROM_THIS_SEQUENCE"
-               style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isSingleReadReused">
-               </reference>
-            </visibleWhen>
-         </command>
-         <separator
-               name="eu.etaxonomy.taxeditor.editor.separator7"
-               visible="true">
-         </separator>
-         <command
-               commandId="org.eclipse.ui.edit.delete"
-               label="%command.label.52"
-               style="push">
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.derivate.deepDelete"
-               icon="icons/deep-delete-16x16-32.png"
-               label="%command.label.54"
-               style="push">
-         </command>
-      </menuContribution>
-      <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor">
          <dynamic
                class="eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditorContextMenu"
          </dynamic>
       </menuContribution>
       
-      
-      
-      
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.uses">
          <command
          </activeWhen>
       </handler>
       <handler
-            class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
-            commandId="org.eclipse.ui.edit.delete">
-         <activeWhen>
-            <with
-                  variable="activePartId">
-               <equals
-                     value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
-               </equals>
-            </with>
-         </activeWhen>
-      </handler>
-      <handler
             class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
             commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
       </handler>
          </commandParameter>
       </command>
       <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivate.deepDelete"
-            name="%command.name.44">
-      </command>
-      <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionToOtherTaxonHandler"
             id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionToTaxon"
             name="%command.name.OPEN_DERIVATIVE_EDITOR">
       </command>
       <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.ListenToSelectionChangeHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivative.listenToSelectionChange"
-            name="%command.name.LINK_WITH_TAXON_SELECTION">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard"
-            name="%command.name.COPY_SINGLE_READ_TO_CLIPBOARD">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead"
-            name="%command.name.REUSE_SINGLE_READ">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence"
-            name="%command.name.REMOVE_SINGLE_READ">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.ToggleLinkWithTaxonSelectionHandler"
-            id="eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection"
-            name="%command.name.TOGGLE_LINK_WITH_TAXON_SELECTION">
-      </command>
-      <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.defaultHandler.DefaultOpenSpecimenEditorForTypeSpecimenHandler"
             id="eu.etaxonomy.taxeditor.openSpecimenEditorForTypeSpecimen"
             name="%command.name.OPEN_EDITOR_FOR_TYPE_SPECIMEN">
          </with>
       </definition>
       <definition
-            id="isSingleReadReusableHere">
+            id="isSpecimenOrObservationBase">
          <with
                variable="selection">
             <test
-                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleReadReusableHere">
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSpecimenOrObservationBase">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isDerivativeEditorLinkedToTaxonSelection">
+         <with
+               variable="activeEditor">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.view.derivate.DerivativeEditorPropertyTester.isLinkedWithTaxonSelection">
             </test>
          </with>
       </definition>
       <definition
-            id="isSingleReadReused">
+            id="isOrphanedTaxon">
          <with
                variable="selection">
             <test
-                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleReadReused">
+                  forcePluginActivation="true"
+                  property="eu.etaxonomy.taxeditor.editor.name.propertyTester.isOrphaned">
             </test>
          </with>
       </definition>
       <definition
-            id="isDerivativeEditorLinkedToTaxonSelection">
+            id="isAddDerivateAllowed">
          <with
-               variable="activeEditor">
+               variable="selection">
             <test
-                  property="eu.etaxonomy.taxeditor.editor.view.derivate.DerivativeEditorPropertyTester.isLinkedWithTaxonSelection">
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isAddDerivateAllowed">
             </test>
          </with>
       </definition>
       <definition
-            id="isOrphanedTaxon">
+            id="isAddMediaAllowed">
          <with
                variable="selection">
             <test
-                  forcePluginActivation="true"
-                  property="eu.etaxonomy.taxeditor.editor.name.propertyTester.isOrphaned">
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isAddMediaAllowed">
             </test>
          </with>
       </definition>
             class="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
             id="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
             namespace="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
-            properties="isSequence,isSingleRead,isSingleReadReusableHere,isSingleReadReused"
+            properties="isSequence,isSingleRead,isSpecimenOrObservationBase,isAddDerivateAllowed,isAddMediaAllowed"
             type="org.eclipse.jface.viewers.IStructuredSelection">
       </propertyTester>
       <propertyTester
             viewerName="Specimen Editor">
       </viewCommandMapping>
     </extension>
+   <extension
+         id="id1"
+         point="org.eclipse.e4.workbench.model">
+      <fragment
+            apply="initial"
+            uri="fragment.e4xmi">
+      </fragment>
+   </extension>
 </plugin>
index 49e9571..0412ee7 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
        <groupId>eu.etaxonomy</groupId>
        <artifactId>taxeditor-parent</artifactId>
-    <version>4.7.0-SNAPSHOT</version>
+    <version>4.8.0-SNAPSHOT</version>
   </parent>
   
   <modelVersion>4.0.0</modelVersion>
index b61dc0e..4b24599 100644 (file)
@@ -44,14 +44,6 @@ import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
-//import eu.etaxonomy.taxeditor.store.view.dataimport.BioCaseEditorInput;
-//import eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor;
-//import eu.etaxonomy.taxeditor.view.dataimport.DataImportEditorInput;
-//import eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditor;
-//import eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditorInput;
-//import eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportEditor;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -112,17 +104,6 @@ public class EditorUtil extends AbstractUtility {
        }
 
        /**
-        * Opens a new DerivateView for the given input
-        * @param input a {@link DerivateViewEditorInput} representing the selected derivate
-        * @throws PartInitException
-        */
-       public static void open(DerivateViewEditorInput input)
-               throws PartInitException {
-           open(input, DerivateView.ID);
-       }
-
-
-       /**
         * Opens a new ChecklistView for the given input
         * @param input a {@link ChecklistEditorInput} representing the selected checklist
         * @throws PartInitException
@@ -277,7 +258,7 @@ public class EditorUtil extends AbstractUtility {
         * @return the taxon editor that has focus
         */
        public static MultiPageTaxonEditor getActiveMultiPageTaxonEditor() {
-               IEditorPart editorPart = getActiveEditor();
+               Object editorPart = getActiveE4Editor();
                if (editorPart != null && editorPart instanceof MultiPageTaxonEditor) {
                        MultiPageTaxonEditor editor = (MultiPageTaxonEditor) editorPart;
                        editor.getConversationHolder().bind();
index a52db81..bd046f6 100644 (file)
@@ -44,7 +44,7 @@ public class EditCdmAuthoritiesHandler  extends AbstractHandler {
         */
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
-               BulkEditor editor = (BulkEditor) EditorUtil.getActiveEditor();
+               BulkEditor editor = (BulkEditor) EditorUtil.getActiveE4Editor();
 
                ISelection selection = editor.getSite().getSelectionProvider().getSelection();
                if(selection instanceof LineSelection){
index 04101f6..646f416 100644 (file)
@@ -3,22 +3,23 @@ package eu.etaxonomy.taxeditor.editor.handler;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
 
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 public class OpenDerivateViewHandler extends AbstractHandler {
 
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        try {
-            EditorUtil.open(new DerivateViewEditorInput());
-        } catch (PartInitException e) {
-            MessagingUtils.error(OpenDerivateViewHandler.class, Messages.OpenDerivateViewHandler_COULD_NOT_OPEN, e);
-        }
+        MPart part = TaxeditorStorePlugin.getDefault().getWorkbench().getService(EPartService.class).showPart(
+                AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW, PartState.ACTIVATE);
+        DerivateView derivateView = (DerivateView) part.getObject();
+        derivateView.init(new DerivateViewEditorInput());
         return null;
     }
 
index 9b17170..636c0f4 100644 (file)
@@ -2,17 +2,13 @@ package eu.etaxonomy.taxeditor.editor.handler;
 
 
 import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 
 
 
@@ -24,9 +20,9 @@ import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
  */
 public class SpecimenPropertyTester extends PropertyTester {
     private static final String SEQUENCE = "isSequence"; //$NON-NLS-1$
-    private static final String SINGLE_READ = "isSingleRead"; //$NON-NLS-1$
-    private static final String IS_SINGLEREAD_REUSABLE_HERE = "isSingleReadReusableHere"; //$NON-NLS-1$
-    private static final String IS_SINGLEREAD_REUSED = "isSingleReadReused"; //$NON-NLS-1$
+    private static final String IS_SPECIMEN_OR_OBSERVATION_BASE = "isSpecimenOrObservationBase"; //$NON-NLS-1$
+    private static final String IS_ADD_DERIVATE_ALLOWED = "isAddDerivateAllowed"; //$NON-NLS-1$
+    private static final String IS_ADD_MEDIA_ALLOWED = "isAddMediaAllowed"; //$NON-NLS-1$
 
 
     public SpecimenPropertyTester() {}
@@ -41,46 +37,37 @@ public class SpecimenPropertyTester extends PropertyTester {
                 if (SEQUENCE.equals(property)) {
                     return isSequence(treeNodeOfSelection.getValue());
                 }
-                else if (SINGLE_READ.equals(property)) {
-                       return isSingleReadAlignment(treeNodeOfSelection.getValue());
+                else if (IS_SPECIMEN_OR_OBSERVATION_BASE.equals(property)) {
+                    return isSpecimenOrObservationBase(treeNodeOfSelection.getValue());
                 }
-                else if (IS_SINGLEREAD_REUSABLE_HERE.equals(property)) {
-                    return isSingleReadReusableHere(treeNodeOfSelection.getValue());
+                else if (IS_ADD_DERIVATE_ALLOWED.equals(property)) {
+                    return isAddDerivateAllowed(treeNodeOfSelection.getValue());
                 }
-                else if (IS_SINGLEREAD_REUSED.equals(property)) {
-                    return isSingleReadReused(treeNodeOfSelection.getValue());
+                else if (IS_ADD_MEDIA_ALLOWED.equals(property)) {
+                    return isAddMediaAllowed(treeNodeOfSelection.getValue());
                 }
             }
         }
         return false;
     }
 
-    private boolean isSingleReadReused(Object value) {
-        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-        final IEditorPart activeEditor = window.getActivePage().getActiveEditor();
-        if(value instanceof SingleRead){
-            if(activeEditor instanceof DerivateView
-                    && ((DerivateView) activeEditor).getMultiLinkSingleReads().contains(value)){
-                return true;
-            }
-        }
-        return false;
+
+    private boolean isSpecimenOrObservationBase(Object object) {
+       return (object instanceof SpecimenOrObservationBase);
+       }
+
+    private boolean isAddDerivateAllowed(Object object) {
+        return (object instanceof SpecimenOrObservationBase || object instanceof Sequence)
+                && !(object instanceof MediaSpecimen);
     }
 
-    private boolean isSingleReadReusableHere(Object value) {
-        TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
-        if(value instanceof Sequence && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead
-                && !((Sequence) value).getSingleReads().contains(clipboardNode.getValue())){
-            return true;
-        }
-        return false;
+    private boolean isAddMediaAllowed(Object object) {
+        return object instanceof SpecimenOrObservationBase
+                && !(object instanceof MediaSpecimen);
     }
 
     private boolean isSequence(Object object) {
-       return (object instanceof Sequence);
-       }
-
-       private boolean isSingleReadAlignment(Object object) {
-       return (object instanceof SingleRead);
+        return (object instanceof Sequence);
     }
+
 }
index 9c18681..1c9fa15 100644 (file)
@@ -2,15 +2,17 @@ package eu.etaxonomy.taxeditor.editor.handler.defaultHandler;
 import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
 
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 
 public class DefaultOpenSpecimenEditorForTypeSpecimenHandler extends
@@ -23,11 +25,11 @@ public class DefaultOpenSpecimenEditorForTypeSpecimenHandler extends
 
        @Override
        protected void open(ExecutionEvent event, SpecimenTypeDesignation entity) {
-        try {
-            EditorUtil.open(new DerivateViewEditorInput(entity.getUuid()));
-        } catch (PartInitException e) {
-            MessagingUtils.error(DefaultOpenSpecimenEditorForTypeSpecimenHandler.class, Messages.DefaultOpenSpecimenEditorForTypeSpecimenHandler_COULD_NOT_OPEN, e);
-        }              
+           DerivateViewEditorInput input = new DerivateViewEditorInput(entity.getUuid());
+           MPart part = TaxeditorStorePlugin.getDefault().getWorkbench().getService(EPartService.class).showPart(
+                   AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW, PartState.ACTIVATE);
+           DerivateView derivateView = (DerivateView) part.getObject();
+           derivateView.init(input);
        }
 
 }
index c0c2d47..9029a23 100644 (file)
@@ -3,6 +3,7 @@
  */
 package eu.etaxonomy.taxeditor.editor.key.polytomous;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -30,7 +31,10 @@ public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<
             UUID polytomousKeyUuid) {
         super(conversation);
         this.keyUuid = polytomousKeyUuid;
-        this.key = CdmStore.getService(IPolytomousKeyService.class).load(polytomousKeyUuid, null);
+        List<String> propertyPath = new ArrayList<>();
+        propertyPath.add("root");
+        propertyPath.add("root.*");
+        this.key = CdmStore.getService(IPolytomousKeyService.class).load(polytomousKeyUuid, propertyPath);
         this.name = key.getTitleCache();
     }
 
index 597f3fd..cb2cadc 100644 (file)
@@ -50,16 +50,6 @@ public class Messages extends NLS {
     public static String ConceptContainer_SEC_REQUIRED;
     public static String ConceptGraphView_VIEWER_NAME;
        public static String ConceptViewPart_VIEWER_NAME;
-       public static String CreateDerivateContextMenu_ADD;
-    public static String CreateDerivateContextMenu_DNA_SAMPLE;
-    public static String CreateDerivateContextMenu_MEDIA;
-    public static String CreateDerivateContextMenu_MEDIA_EXISTING;
-    public static String CreateDerivateContextMenu_MEDIA_SPECIMEN;
-    public static String CreateDerivateContextMenu_NO_CHILD_DERIVATE;
-    public static String CreateDerivateContextMenu_SEQUENCE;
-    public static String CreateDerivateContextMenu_SINGLE_READ;
-    public static String CreateDerivateContextMenu_SPECIMEN;
-    public static String CreateDerivateContextMenu_TISSUE_SAMPLE;
     public static String CreateFieldUnitContextMenu_CREATE_FIELD_UNIT;
        public static String CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR;
        public static String DefaultOpenSpecimenEditorForTypeSpecimenHandler_COULD_NOT_OPEN;
@@ -146,8 +136,6 @@ public class Messages extends NLS {
        public static String KeyEditor_GRAPH;
     public static String KeyEditor_LIST;
     public static String KeyEditor_SAVING;
-    public static String ListenToSelectionChangeContextMenu_LINK;
-    public static String ListenToSelectionChangeContextMenu_UNLINK;
     public static String MediaViewPart_MEDIA;
     public static String MisapplicationContainer_SEC_REF_REQUIRED;
     public static String MoveDerivateOperation_MOVE_NOT_POSSIBLE;
index 394a2db..136e769 100644 (file)
@@ -1,13 +1,3 @@
-CreateDerivateContextMenu_ADD=Add...
-CreateDerivateContextMenu_DNA_SAMPLE=DNA Sample
-CreateDerivateContextMenu_MEDIA=Media...
-CreateDerivateContextMenu_MEDIA_EXISTING=Use existing media item
-CreateDerivateContextMenu_MEDIA_SPECIMEN=Media item
-CreateDerivateContextMenu_NO_CHILD_DERIVATE=No child derivatives
-CreateDerivateContextMenu_SEQUENCE=Consensus Sequence
-CreateDerivateContextMenu_SINGLE_READ=Single Read
-CreateDerivateContextMenu_SPECIMEN=Specimen
-CreateDerivateContextMenu_TISSUE_SAMPLE=Tissue Sample
 CreateFieldUnitContextMenu_CREATE_FIELD_UNIT=Create new field unit
 CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR=Create new field unit for %s
 SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Remove from this Sequence
@@ -203,8 +193,6 @@ ChecklistEditor_TAXON=Taxon
 ChecklistEditor_UNKNOWN=unknown
 OpenRelatedConceptHandler_COULD_NOT_OPEN=Could not open taxon
 OpenRelatedConceptHandler_COULD_NOT_OPEN_MESSAGE=Could not open the taxon: %s
-ListenToSelectionChangeContextMenu_LINK=Link with taxon selection
-ListenToSelectionChangeContextMenu_UNLINK=Unlink from taxon selection
 DeleteDerivateHandler_INVALID_SELECTION=Selection is not valid for this delete handler
 DeleteDerivateHandler_LABEL=Delete of derivates
 DeleteDerivateHandler_SUCCESSFULL_BUT_EXCEPTIONS=Delete was successfull, but with exceptions
index 5e2ca74..d515f18 100644 (file)
@@ -1,13 +1,3 @@
-CreateDerivateContextMenu_ADD=Hinzufügen...
-CreateDerivateContextMenu_DNA_SAMPLE=DNA Probe
-CreateDerivateContextMenu_MEDIA=Media...
-CreateDerivateContextMenu_MEDIA_EXISTING=Vorhandendes Medienobjekt verwenden
-CreateDerivateContextMenu_MEDIA_SPECIMEN=Medienobjekt
-CreateDerivateContextMenu_NO_CHILD_DERIVATE=Keine Kind-Derivate
-CreateDerivateContextMenu_SEQUENCE=Konsensussequenz
-CreateDerivateContextMenu_SINGLE_READ=Single Read
-CreateDerivateContextMenu_SPECIMEN=Beleg
-CreateDerivateContextMenu_TISSUE_SAMPLE=Gewebeprobe
 CreateFieldUnitContextMenu_CREATE_FIELD_UNIT=Erzeuge neue Field Unit
 CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR=Erzeuge neue Field Unit für %s
 SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Von Sequenz entfernen
@@ -203,8 +193,6 @@ ChecklistEditor_TAXON=Taxon
 ChecklistEditor_UNKNOWN=unbekannt
 OpenRelatedConceptHandler_COULD_NOT_OPEN=Konnte Taxon nicht öffnen
 OpenRelatedConceptHandler_COULD_NOT_OPEN_MESSAGE=Konnte Taxon nicht öffnen: %s
-ListenToSelectionChangeContextMenu_LINK=Verknüpfe mit Taxonauswahl
-ListenToSelectionChangeContextMenu_UNLINK=Verknüpfung mit Taxonauswahl aufheben
 DeleteDerivateHandler_INVALID_SELECTION=Auswahl ungültig
 DeleteDerivateHandler_LABEL=Löschen von Derivaten
 DeleteDerivateHandler_SUCCESSFULL_BUT_EXCEPTIONS=Löschen war erfolgreich, aber es gab Exceptions
@@ -219,7 +207,7 @@ DeleteHandler_DELETE=L
 DeleteHandler_INVALID_SELECTION=Auswahl ungültig für den DeleteHandler
 DeleteHandler_SKIP=Überspringen
 DeleteMediaHandler_CONFIRM=Löschen bestätigen
-DeleteMediaHandler_CONFIRM_MESSAGE=Wollen sie wirklich das Medienobjekt löschen?
+DeleteMediaHandler_CONFIRM_MESSAGE=Wollen sie wirklich den Mediendatensatz löschen?
 DeleteMediaHandler_DELETE=Löschen
 DeleteMediaHandler_SKIP=Überspringen
 DerivateSearchComposite_ALL=Alle
index 859552a..da9d5fe 100644 (file)
@@ -857,8 +857,7 @@ public class TaxonNameEditor extends EditorPart implements
         * @return a boolean.
         */
        public boolean isActive() {
-               IWorkbenchPart activePart = AbstractUtility.getActivePart();
-               return editor.equals(activePart);
+               return editor.equals(AbstractUtility.getActiveE4Part());
        }
 
        /**
index 8146960..5194c7a 100644 (file)
@@ -107,16 +107,18 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler,
 
                AbstractUtility.executeOperation(operation);
                DeleteResult result = ((DeleteTaxonBaseOperation)operation).getResult();
-               if (result.isError()){
-            DeleteResultMessagingUtils.messageDialogWithDetails(result, Messages.DeleteDerivateOperation_DELETE_FAILED, TaxeditorEditorPlugin.PLUGIN_ID);
-        } else if (selectedElement instanceof Synonym){
-            this.editor.redraw();
-                   if (!result.getExceptions().isEmpty()){
-                DeleteResultMessagingUtils.messageDialogWithDetails(result, Messages.DeleteTaxonBaseHandler_DELETE_SYNONYM_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS, TaxeditorEditorPlugin.PLUGIN_ID);
-            }
-               } else if (selectedElement instanceof Taxon && !result.getExceptions().isEmpty()){
-               this.editor.redraw();
-            DeleteResultMessagingUtils.messageDialogWithDetails(result, Messages.DeleteTaxonBaseHandler_DELETE_MISAPPLIEDNAME_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS, TaxeditorEditorPlugin.PLUGIN_ID);
+               if (result != null){
+               if (result.isError()){
+                DeleteResultMessagingUtils.messageDialogWithDetails(result, Messages.DeleteDerivateOperation_DELETE_FAILED, TaxeditorEditorPlugin.PLUGIN_ID);
+            } else if (selectedElement instanceof Synonym){
+                this.editor.redraw();
+                   if (!result.getExceptions().isEmpty()){
+                    DeleteResultMessagingUtils.messageDialogWithDetails(result, Messages.DeleteTaxonBaseHandler_DELETE_SYNONYM_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS, TaxeditorEditorPlugin.PLUGIN_ID);
+                }
+               } else if (selectedElement instanceof Taxon && !result.getExceptions().isEmpty()){
+               this.editor.redraw();
+                DeleteResultMessagingUtils.messageDialogWithDetails(result, Messages.DeleteTaxonBaseHandler_DELETE_MISAPPLIEDNAME_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS, TaxeditorEditorPlugin.PLUGIN_ID);
+               }
                }
 
 
index 165c1ca..3b6a073 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
@@ -84,15 +85,25 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
+               
+               UpdateResult result;
                try {
-                       newNode = (TaxonNode) CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(),
+                       result = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(),
                                element.getUuid(),
                                parentNode.getUuid(),
-                               true).getCdmEntity();
+                               true);
+                       if (result.isAbort()){
+                               
+                               MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonOperation_INCONSISTENT_DATA, getClass(), result.toString());
+                               return postExecute(null);
+                       }
+                       newNode = (TaxonNode) result.getCdmEntity();
                } catch (HomotypicalGroupChangeException e) {
-                       MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonOperation_INCONSISTENT_DATA, getClass(), e.getMessage());
-                       return postExecute(null);
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
                }
+               
+               
                monitor.worked(20);
                //newTaxon = (Taxon) CdmStore.getService(ITaxonService.class).merge(newTaxon);
                //element.removeSynonym(synonym);
index 5bcc43e..884a67d 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
@@ -75,7 +76,8 @@ public class ChangeSynonymToConceptOperation extends AbstractPostTaxonOperation
 //             fromTaxon.addTaxonRelation(taxon, taxonRelationshipType, null, null);
 
                monitor.worked(20);
-       Taxon fromTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToRelatedTaxon(synonym, element, taxonRelationshipType, null, null);
+               UpdateResult result = CdmStore.getService(ITaxonService.class).changeSynonymToRelatedTaxon(synonym, element, taxonRelationshipType, null, null);
+       Taxon fromTaxon = (Taxon)result.getCdmEntity();
                monitor.worked(40);
 
 //             TaxonRelationshipType.
index e0576c3..45eec0c 100644 (file)
@@ -36,7 +36,7 @@ public class OpenDistributionHandler extends AbstractHandler {
     public Object execute(ExecutionEvent event) throws ExecutionException {
 
         ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-        ChecklistEditor editor = (ChecklistEditor) EditorUtil.getActiveEditor();
+        ChecklistEditor editor = (ChecklistEditor) EditorUtil.getActiveE4Editor();
 
         if (currentSelection instanceof IStructuredSelection) {
 
index 79e9985..7b78110 100644 (file)
@@ -47,7 +47,7 @@ import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart;
  * @created Jan 24, 2011
  * @version 1.0
  */
-public class ConceptViewPart extends AbstractCdmEditorViewPart 
+public class ConceptViewPart extends AbstractCdmEditorViewPart
 implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept"; //$NON-NLS-1$
@@ -59,11 +59,11 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
                if(part == this){
                    return;
                }
-               if(AbstractUtility.getActiveEditor() == null){
+               if(AbstractUtility.getActiveE4Editor() == null){
                        showEmptyPage();
                        return;
                }
-               
+
         if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart) {
             // do not show empty page as these views are also used to edit the
             // description selected in this view
@@ -93,7 +93,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
                }
 
        }
-       
+
        @Override
        protected String createPartTitle(Object selectedObject) {
                if(selectedObject instanceof TaxonEditorInput){
@@ -135,6 +135,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
                Control control = viewer.getControl();
                Menu menu = menuManager.createContextMenu(control);
+               menuManager.setRemoveAllWhenShown(true);
 
                control.setMenu(menu);
        }
@@ -149,8 +150,8 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
                public ConceptRelationViewer(Composite parent) {
                        super(parent);
-               } 
-               
+               }
+
                @Override
                public ISelection getSelection() {
                        ISelection selection = super.getSelection();
@@ -158,11 +159,11 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
                                Object firstElement = ((IStructuredSelection) selection).getFirstElement();
                                TaxonRelationship taxonRelationship = ((Entry<TaxonRelationship, Taxon>)firstElement).getKey();
                                return new StructuredSelection(taxonRelationship);
-                               
+
                        }
                        return selection;
                }
-               
+
                @Override
                public void setSelection(ISelection selection) {
                        super.setSelection(selection);
index 3ad4d3e..14243a7 100644 (file)
@@ -45,7 +45,7 @@ public class ConceptGraphView extends AbstractCdmEditorViewPart {
 //                     return;
 //             }
 
-               if(EditorUtil.getActiveEditor() == null){
+               if(EditorUtil.getActiveE4Editor() == null){
                        showEmptyPage();
                        return;
                }
index 6e945a2..db45226 100644 (file)
@@ -18,7 +18,6 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
@@ -48,7 +47,7 @@ public class CreateConceptRelationHandler extends AbstractHandler {
            IUndoContext undoContext = null;
            ConversationHolder conversationHolder = null;
            Taxon taxon = null;
-               IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+               Object activeEditor = AbstractUtility.getActiveE4Editor();
                if(activeEditor instanceof MultiPageTaxonEditor){
                    MultiPageTaxonEditor taxonEditor = (MultiPageTaxonEditor)activeEditor;
                    taxon = taxonEditor.getTaxon();
index 186b25b..9ece4d9 100644 (file)
@@ -14,7 +14,6 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
@@ -46,7 +45,7 @@ public class OpenRelatedConceptHandler extends AbstractHandler {
             Object selectedElement = structuredSelection.getFirstElement();
 
             if(selectedElement instanceof TaxonRelationship){
-                IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+                Object activeEditor = AbstractUtility.getActiveE4Editor();
                 if(activeEditor instanceof MultiPageTaxonEditor){
                     relatedTaxon = getRelatedTaxon((TaxonRelationship) selectedElement, ((MultiPageTaxonEditor) activeEditor).getTaxon());
                 }
index f8a9f0e..7a56897 100644 (file)
@@ -3,6 +3,7 @@ package eu.etaxonomy.taxeditor.editor.view.derivate;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -10,12 +11,27 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.inject.Named;
+
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.MenuManager;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.di.Persist;
+import org.eclipse.e4.ui.model.application.ui.MDirtyable;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.services.EMenuService;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
 import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.AbstractTreeViewer;
 import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.jface.viewers.TreeSelection;
@@ -26,19 +42,8 @@ import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
@@ -73,12 +78,14 @@ import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
  * Displays the derivate hierarchy of the specimen specified in the editor input.
  *
  */
-public class DerivateView extends EditorPart implements IPartContentHasFactualData, IConversationEnabled,
+public class DerivateView implements IPartContentHasFactualData, IConversationEnabled,
         ICdmEntitySessionEnabled, IDirtyMarkable, IPostOperationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
-        IContextListener, ISelectionListener {
+        IContextListener {
+
     private static final String SPECIMEN_EDITOR = Messages.DerivateView_SPECIMEN_EDITOR;
 
     public static final String ID = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"; //$NON-NLS-1$
+    public static final String INPUT_ID = ID+".editorInput"; //$NON-NLS-1$
 
     public static final String YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION = Messages.DerivateView_YOU_NEED_TO_SAVE;
     public static final String VIEW_HAS_UNSAVED_CHANGES = Messages.DerivateView_UNSAVED_CHANGES;
@@ -101,54 +108,11 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
        private static final int WARN_THRESHOLD = 200;
 
-    private DelaySelection delaySelection = null;
-    /**
-     * This is the monitor for the DelaySelection runnable.
-     * If it is <code>true</code> then it is currently delaying a selection.
-     */
-    private boolean isInDelay;
-
-
-    /**
-     * This class invokes internal_selectionChanged() in a separate thread.
-     * This allows an asynchronous and/or delayed handling of selection changes
-     */
-    private class DelaySelection implements Runnable{
-        private IWorkbenchPart part;
-        private ISelection selection;
-
-        public DelaySelection(IWorkbenchPart part, ISelection selection) {
-            super();
-            this.part = part;
-            this.selection = selection;
-        }
-
-        @Override
-        public void run() {
-            try{
-                selectionChanged_internal(part, selection);
-            }
-            finally{
-                isInDelay = false;
-            }
-        }
-
-        public synchronized void setSelection(ISelection selection) {
-            this.selection = selection;
-        }
-
-        public synchronized void setPart(IWorkbenchPart part) {
-            this.part = part;
-        }
-
-    }
 
        private ConversationHolder conversation;
 
        private TreeViewer viewer;
 
-    private boolean isDirty;
-
     private final int dndOperations = DND.DROP_MOVE;
 
     private DerivateLabelProvider labelProvider;
@@ -177,25 +141,44 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
     private Taxon selectedTaxon;
 
-    private ISelectionService selectionService;
+    @Inject
+    private ESelectionService selService;
+
+    @Inject
+    private MDirtyable dirty;
+
+    @Inject
+    private EPartService partService;
+
+    private ISelectionChangedListener selectionChangedListener;
 
     /**
      * Default constructor
      */
+    @Inject
     public DerivateView() {
     }
 
-
     /**
      * {@inheritDoc}
      */
-    @Override
-    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-        this.setSite(site);
-        this.setInput(input);
+    public void init(DerivateViewEditorInput editorInput){
         this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
         this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
 
+        //init tree
+        Collection<UUID> derivativeUuids = editorInput.getDerivativeUuids();
+        checkWarnThreshold(derivativeUuids);
+        updateRootEntities(derivativeUuids);
+        //set taxon filter
+        derivateSearchCompositeController.setTaxonFilter(editorInput.getTaxonUuid());
+        //reset status bar
+        //TODO e4
+//        getEditorSite().getActionBars().getStatusLineManager().setMessage(""); //$NON-NLS-1$
+    }
+
+    @PostConstruct
+    public void createPartControl(Composite parent, EMenuService menuService) {
         if (CdmStore.isActive() && conversation == null) {
             conversation = CdmStore.createConversation();
         }
@@ -204,10 +187,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         }
         //listen to context changes
         CdmStore.getContextManager().addContextListener(this);
-    }
-
-    @Override
-    public void createPartControl(Composite parent) {
 
         parent.setLayout(new GridLayout());
 
@@ -234,29 +213,18 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.setLabelProvider(labelProvider);
         viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
         viewer.getTree().setEnabled(CdmStore.isActive());
-        // Propagate selection from viewer
-        getSite().setSelectionProvider(viewer);
 
-        //listen to selection changes
-        selectionService = getSite().getWorkbenchWindow().getSelectionService();
-        selectionService.addSelectionListener(this);
+        selectionChangedListener = new ISelectionChangedListener() {
+            @Override
+            public void selectionChanged(SelectionChangedEvent event) {
+                IStructuredSelection isel = (IStructuredSelection) event.getSelection();
+                selService.setSelection((isel.size() == 1 ? isel.getFirstElement() : isel.toArray()));
+            }
+        };
+        viewer.addSelectionChangedListener(selectionChangedListener);
 
         //create context menu
-        MenuManager menuManager = new MenuManager();
-        menuManager.setRemoveAllWhenShown(true);
-        getSite().registerContextMenu(menuManager, viewer);
-        Control control = viewer.getControl();
-        Menu menu = menuManager.createContextMenu(control);
-        control.setMenu(menu);
-
-        //init tree
-        Collection<UUID> derivativeUuids = ((DerivateViewEditorInput)getEditorInput()).getDerivativeUuids();
-        checkWarnThreshold(derivativeUuids);
-               updateRootEntities(derivativeUuids);
-        //set taxon filter
-        derivateSearchCompositeController.setTaxonFilter(((DerivateViewEditorInput) getEditorInput()).getTaxonUuid());
-        //reset status bar
-        getEditorSite().getActionBars().getStatusLineManager().setMessage(""); //$NON-NLS-1$
+        menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.editor.popupmenu.specimeneditor");
 
         //add drag'n'drop support
         Transfer[] transfers = new Transfer[] {LocalSelectionTransfer.getTransfer(),};
@@ -300,53 +268,59 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
 
 
     public void updateRootEntities(List<SpecimenOrObservationBase> derivates) {
-            if(derivates!=null){
-                this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
-                this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
-                for (SpecimenOrObservationBase derivate : derivates) {
+        if(derivates!=null){
+            this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
+            this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+            for (SpecimenOrObservationBase derivate : derivates) {
 
-                    if(derivate instanceof FieldUnit){
-                        derivateToRootEntityMap.put(derivate, derivate);
+                if(derivate instanceof FieldUnit){
+                    derivateToRootEntityMap.put(derivate, derivate);
+                }
+                else {
+                    SpecimenOrObservationBase<?> topMostDerivate = EditorUtil.getTopMostDerivate(derivate);
+                    if(topMostDerivate!=null){
+                        derivateToRootEntityMap.put(derivate, topMostDerivate);
                     }
-                    else {
-                        SpecimenOrObservationBase<?> topMostDerivate = EditorUtil.getTopMostDerivate(derivate);
-                        if(topMostDerivate!=null){
-                            derivateToRootEntityMap.put(derivate, topMostDerivate);
-                        }
-                        else{
-                            derivateToRootEntityMap.put(derivate, derivate);
-                        }
+                    else{
+                        derivateToRootEntityMap.put(derivate, derivate);
                     }
                 }
-                for (SpecimenOrObservationBase<?> specimen : derivateToRootEntityMap.values()) {
-                    rootElements.add(specimen);
-                }
             }
-            labelProvider.updateLabelCache(rootElements);
-            viewer.setInput(rootElements);
+            for (SpecimenOrObservationBase<?> specimen : derivateToRootEntityMap.values()) {
+                rootElements.add(specimen);
+            }
+        }
+        labelProvider.updateLabelCache(rootElements);
+        viewer.setInput(rootElements);
 
-            getEditorSite().getActionBars().getStatusLineManager().setMessage(String.format(Messages.DerivateView_CNT_DERIVATIVES_FOUND, rootElements.size()));
+        //TODO e4
+        //            getEditorSite().getActionBars().getStatusLineManager().setMessage(String.format(Messages.DerivateView_CNT_DERIVATIVES_FOUND, rootElements.size()));
 
-            //set selection to derivatives if the filter criteria
-            //taxon assignment or derivative type are set
-            if(derivates!=null && !derivateSearchCompositeController.isDefaultSearch()){
-                List<TreeNode> nodesToSelect = new ArrayList<TreeNode>();
-                for (SpecimenOrObservationBase specimenOrObservationBase : derivates) {
-                    nodesToSelect.add(new TreeNode(specimenOrObservationBase));
-                }
-                viewer.setSelection(new StructuredSelection(nodesToSelect));
-            }
-            else{
-                viewer.setSelection(null);
+        //set selection to derivatives if the filter criteria
+        //taxon assignment or derivative type are set
+        if(derivates!=null && !derivateSearchCompositeController.isDefaultSearch()){
+            List<TreeNode> nodesToSelect = new ArrayList<TreeNode>();
+            for (SpecimenOrObservationBase specimenOrObservationBase : derivates) {
+                nodesToSelect.add(new TreeNode(specimenOrObservationBase));
             }
+            setSelection(new StructuredSelection(nodesToSelect));
+        }
+        else{
+            setSelection(null);
+        }
+    }
 
+    private void setSelection(StructuredSelection selection){
+        viewer.removeSelectionChangedListener(selectionChangedListener);
+        viewer.setSelection(selection);
+        viewer.addSelectionChangedListener(selectionChangedListener);
     }
 
     public void updateLabelCache(){
         labelProvider.updateLabelCache(rootElements);
     }
 
-    @Override
+    @Persist
     public void doSave(IProgressMonitor monitor) {
         String taskName = Messages.DerivateView_SAVING_HIERARCHY;
         monitor.beginTask(taskName, 3);
@@ -365,37 +339,18 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         this.setDirty(false);
         monitor.worked(1);
         monitor.done();
-        firePropertyChange(PROP_DIRTY);
+        dirty.setDirty(false);
         refreshTree();
     }
 
-    @Override
-    public void doSaveAs() {
-    }
-
-    @Override
-    public String getTitleToolTip() {
-        return Messages.DerivateView_DERIVATIVE_EDITOR;
-    }
-
-    @Override
-    public boolean isDirty() {
-        return isDirty;
-    }
-
     /**
      * @param isDirty the isDirty to set
      */
     public void setDirty(boolean isDirty) {
-        this.isDirty = isDirty;
-    }
-
-    @Override
-    public boolean isSaveAsAllowed() {
-        return false;
+        dirty.setDirty(isDirty);
     }
 
-    @Override
+    @Focus
     public void setFocus() {
         //make sure to bind again if maybe in another view the conversation was unbound
         if(conversation!=null && !conversation.isBound()){
@@ -419,7 +374,7 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
     @Override
     public void changed(Object element) {
         setDirty(true);
-        firePropertyChange(IEditorPart.PROP_DIRTY);
+//        firePropertyChange(IEditorPart.PROP_DIRTY);
         viewer.update(new TreeNode(element), null);
     }
 
@@ -524,9 +479,8 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return cdmEntitySession;
     }
 
-    @Override
+    @PreDestroy
     public void dispose() {
-        super.dispose();
         if(conversation!=null){
             conversation.close();
         }
@@ -534,16 +488,23 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
             cdmEntitySession.dispose();
         }
     }
-    public void selectionChanged_internal(IWorkbenchPart part, ISelection selection) {
-       if(part == this){
+
+
+    @Inject
+    @Optional
+    public void selectionChanged(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) ISelection selection,
+            @Named(IServiceConstants.ACTIVE_PART) MPart activePart, MPart thisPart)
+    {
+       if(activePart == this || viewer==null){
             return;
         }
         if(viewer.getTree().isDisposed()){
             return;
         }
         if(listenToSelectionChange){
-            if(part instanceof MultiPageTaxonEditor){
-                selectedTaxon = ((MultiPageTaxonEditor) part).getTaxon();
+            selectedTaxon = null;
+            if(activePart instanceof MultiPageTaxonEditor){
+                selectedTaxon = ((MultiPageTaxonEditor) activePart).getTaxon();
             }
             else if(selection instanceof IStructuredSelection){
                 Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
@@ -564,25 +525,15 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
                 }
                 checkWarnThreshold(uuids);
                 updateRootEntities(uuids);
-                setPartName(SPECIMEN_EDITOR+": " + selectedTaxon.getName()); //$NON-NLS-1$
-            }
-        }
-    }
 
-    @Override
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-       if(delaySelection==null){
-            delaySelection = new DelaySelection(part, selection);
-        }
-        delaySelection.setPart(part);
-        delaySelection.setSelection(selection);
-        if(!isInDelay){
-            isInDelay = true;
-            Display.getCurrent().asyncExec(delaySelection);
+                thisPart.setLabel(SPECIMEN_EDITOR+": " + selectedTaxon.getName()); //$NON-NLS-1$
+            }
+            else{
+                updateRootEntities((Collection<UUID>)Collections.EMPTY_LIST);
+            }
         }
     }
 
-
        private void checkWarnThreshold(Collection<UUID> uuids) {
                if(uuids!=null && uuids.size()>WARN_THRESHOLD){
                        MessagingUtils.warningDialog(Messages.DerivateView_PERF_WARNING, this.getClass(), String.format(Messages.DerivateView_PERF_WARNING_MESSAGE, uuids.size()));
@@ -602,15 +553,15 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return new ArrayList<SpecimenOrObservationBase<?>>(rootElements);
     }
 
-    public void toggleListenToSelectionChange() {
+    public void toggleListenToSelectionChange(MPart part) {
         listenToSelectionChange = !listenToSelectionChange;
         derivateSearchCompositeController.setEnabled(!listenToSelectionChange);
         if(!listenToSelectionChange){
             selectedTaxon = null;
-            setPartName(SPECIMEN_EDITOR);
+            part.setLabel(SPECIMEN_EDITOR);
         }
         else if(selectedTaxon==null){
-            setPartName(SPECIMEN_EDITOR+Messages.DerivateView_NO_TAXON_SELECTED);
+            part.setLabel(SPECIMEN_EDITOR+Messages.DerivateView_NO_TAXON_SELECTED);
         }
     }
 
@@ -663,4 +614,9 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
 
+
+    public boolean isDirty() {
+        return dirty.isDirty();
+    }
+
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java
deleted file mode 100644 (file)
index 0d9d17e..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.media.Media;
-import eu.etaxonomy.cdm.model.molecular.DnaSample;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
-import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
-
-/**
- * Context menu for the creation of derivates in the derivate hierarchy.
- *
- */
-public class CreateDerivateContextMenu extends CompoundContributionItem {
-
-    private static final String SINGLE_READ = Messages.CreateDerivateContextMenu_SINGLE_READ;
-    private static final String CONSENSUS_SEQUENCE = Messages.CreateDerivateContextMenu_SEQUENCE;
-    private static final String MEDIA_SPECIMEN = Messages.CreateDerivateContextMenu_MEDIA_SPECIMEN;
-    private static final String DNA_SAMPLE = Messages.CreateDerivateContextMenu_DNA_SAMPLE;
-    private static final String TISSUE_SAMPLE = Messages.CreateDerivateContextMenu_TISSUE_SAMPLE;
-    private static final String SPECIMEN = Messages.CreateDerivateContextMenu_SPECIMEN;
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        IContributionItem[] contributionItems = new IContributionItem[] {
-                new ContributionItem() {
-                    @Override
-                    public void fill(Menu menu, int index) {
-                        MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
-                        addItem.setText(Messages.CreateDerivateContextMenu_ADD);
-                        Menu addMenu = new Menu(menu);
-                        addItem.setMenu(addMenu);
-                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                        final ISelection selection = window.getActivePage().getSelection();
-                        TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-                        if(selectedTreeNode!=null){
-                            //context menu for FieldUnit
-                            if(selectedTreeNode.getValue() instanceof FieldUnit){
-                                createMenuItem(addMenu, SPECIMEN, selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen, DerivationEventType.GATHERING_IN_SITU());
-                                new MenuItem(addMenu, SWT.SEPARATOR);
-                                createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
-                                createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.StillImage, DerivationEventType.ACCESSIONING());
-                                return;
-                            }
-                            //context menu for Specimen
-                            else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
-
-                                createMenuItem(addMenu, TISSUE_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample, DerivationEventType.PREPARATION());
-                                createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.StillImage, DerivationEventType.ACCESSIONING());
-                                return;
-                            }
-                            //context menu for TissueSample
-                            else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
-                               createMenuItem(addMenu, DNA_SAMPLE, selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample, DerivationEventType.DNA_EXTRACTION());
-                               createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.StillImage, DerivationEventType.ACCESSIONING());
-                                return;
-                            }
-                            //context menu for DnaSample
-                            else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                                createMenuItem(addMenu, CONSENSUS_SEQUENCE, selectedTreeNode, Sequence.class, null, null);
-                                createMenuItem(addMenu, MEDIA_SPECIMEN, selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.StillImage, DerivationEventType.ACCESSIONING());
-                                return;
-                            }
-                            //context menu for Sequence
-                            else if(selectedTreeNode.getValue() instanceof Sequence){
-                                createMenuItem(addMenu, SINGLE_READ, selectedTreeNode, SingleRead.class, null, null);
-                                return;
-                            }
-                        }
-                        MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
-                        menuItem.setText(Messages.CreateDerivateContextMenu_NO_CHILD_DERIVATE);
-                        menuItem.setEnabled(false);
-                    }
-
-
-                }
-        };
-        return contributionItems;
-    }
-
-    private void createMenuItem(Menu menu, String menuLabel, final TreeNode selectedNode, Class<?> childClass, final SpecimenOrObservationType specimenType, final DerivationEventType derivationEventType) {
-        if(specimenType!=null && specimenType.equals(SpecimenOrObservationType.StillImage)){
-            //media submenu
-            MenuItem mediaItem = new MenuItem(menu, SWT.CASCADE);
-            mediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA);
-            Menu mediaMenu = new Menu(menu);
-            mediaItem.setMenu(mediaMenu);
-
-            //media specimen menu
-            MenuItem menuItem = new MenuItem(mediaMenu, SWT.NONE);
-            menuItem.setText(menuLabel);
-            menuItem.addSelectionListener(new WidgetSelectionListener(selectedNode, childClass, specimenType, derivationEventType));
-
-            //existing media menu
-            MenuItem existingMediaItem = new MenuItem(mediaMenu, SWT.NONE);
-            existingMediaItem.setText(Messages.CreateDerivateContextMenu_MEDIA_EXISTING);
-            existingMediaItem.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    //select media
-                    Media media = MediaSelectionDialog.select(AbstractUtility.getShell(), null, null);
-                    if(media!=null){
-                        //create MediaSpecimen
-                        MediaSpecimen mediaSpecimen = MediaSpecimen.NewInstance(specimenType);
-                        mediaSpecimen.setMediaSpecimen(media);
-
-                        //attach to parent
-                        if(selectedNode.getValue() instanceof SpecimenOrObservationBase){
-                            SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedNode.getValue();
-
-                            specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, mediaSpecimen, derivationEventType));
-                            mediaSpecimen.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
-                            mediaSpecimen.getTitleCache(); //update title cache
-                            CdmStore.getService(IOccurrenceService.class).merge(specimenOrObservationBase, true);
-                           
-                        }
-
-                        //refresh view
-                        DerivateView derivateView = null;
-                        if(AbstractUtility.getActivePart() instanceof DerivateView){
-                            derivateView = (DerivateView) AbstractUtility.getActivePart();
-                        }
-                        if(derivateView!=null){
-
-                            derivateView.getConversationHolder().commit();
-                            derivateView.refreshTree(mediaSpecimen);
-                        }
-                    }
-                }
-            });
-        }
-        else{
-            MenuItem menuItem = new MenuItem(menu, SWT.NONE);
-            menuItem.setText(menuLabel);
-            menuItem.addSelectionListener(new WidgetSelectionListener(selectedNode, childClass, specimenType, derivationEventType));
-        }
-    }
-
-    private class WidgetSelectionListener extends SelectionAdapter{
-
-        private final TreeNode selectedNode;
-        //TODO: we need a common interface for the generic like e.g. "IDerivateHierarchyNode"
-        private final Class<?> childClass;
-        private final SpecimenOrObservationType specimenType;
-        private final DerivationEventType derivationEventType;
-
-        /**
-         * @param selectedNode
-         * @param specimenType
-         */
-        public WidgetSelectionListener(TreeNode selectedNode, Class<?> childClass, SpecimenOrObservationType specimenType, DerivationEventType derivationEventType) {
-            this.selectedNode = selectedNode;
-            this.childClass = childClass;
-            this.specimenType = specimenType;
-            this.derivationEventType = derivationEventType;
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            DerivateView derivateView = null;
-            if(AbstractUtility.getActivePart() instanceof DerivateView){
-                derivateView = (DerivateView) AbstractUtility.getActivePart();
-            }
-            if(derivateView!=null){
-                if(derivateView.isDirty()){
-                    e.doit = false;
-                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                    return;
-                }
-            }
-
-            Object createdElement = null;
-            Object selectedDerivate = selectedNode.getValue();
-            if(selectedDerivate instanceof DnaSample && ((DnaSample) selectedDerivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                DnaSample dnaSample = (DnaSample)selectedDerivate;
-                if(childClass.equals(Sequence.class)){
-                    Sequence newInstance = Sequence.NewInstance(dnaSample, "", 0); //$NON-NLS-1$
-                    createdElement = newInstance;
-                }
-                CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase) selectedDerivate, true);
-            } else if(selectedDerivate instanceof Sequence){
-                SingleRead newInstance = SingleRead.NewInstance();
-                ((Sequence) selectedDerivate).addSingleRead(newInstance);
-                createdElement = newInstance;
-                CdmApplicationState.getCurrentAppConfig().getSequenceService().merge((Sequence)selectedDerivate, true);
-                
-            }
-            if(selectedDerivate instanceof SpecimenOrObservationBase && DerivedUnit.class.isAssignableFrom(childClass)){
-                SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedDerivate;
-                DerivedUnit derivedUnit;
-                if(childClass.equals(DnaSample.class)){
-                    derivedUnit = DnaSample.NewInstance();
-                    if(specimenType==SpecimenOrObservationType.DnaSample){
-                        derivedUnit.setRecordBasis(SpecimenOrObservationType.DnaSample);
-                    }
-                    else if(specimenType==SpecimenOrObservationType.TissueSample){
-                        derivedUnit.setRecordBasis(SpecimenOrObservationType.TissueSample);
-                    }
-                }
-                else if(childClass.equals(MediaSpecimen.class)){
-                    derivedUnit = MediaSpecimen.NewInstance(specimenType);
-                    //a MediaSpecimen with no media attached does not make sense. Hence we add one
-                    ((MediaSpecimen)derivedUnit).setMediaSpecimen(Media.NewInstance());
-                }
-                else{
-                    derivedUnit = DerivedUnit.NewInstance(specimenType);
-                }
-                specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, derivedUnit, derivationEventType));
-                derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
-                derivedUnit.getTitleCache(); //update title cache
-                createdElement = derivedUnit;
-                CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase) selectedDerivate, true);
-                
-            }
-
-            //refresh view
-            if(derivateView!=null){
-                derivateView.getConversationHolder().commit();
-                derivateView.refreshTree(createdElement);
-            }
-        }
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java
deleted file mode 100644 (file)
index 922450a..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
-import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * Context menu for the SingleReads in the derivate hierarchy.
- *
- */
-public class CreateFieldUnitContextMenu extends CompoundContributionItem {
-
-    private enum CommandType {
-        COPY_TO_CLIPBOARD, REMOVE_FROM_SEQUENCE, ADD_TO_SEQUENCE
-    }
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        IContributionItem[] contributionItems = new IContributionItem[] {
-                new ContributionItem() {
-                    @Override
-                    public void fill(Menu menu, int index) {
-                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                        IWorkbenchPart activePart = window.getActivePage().getActivePart();
-                        if(activePart instanceof DerivateView){
-                            final DerivateView derivateView = (DerivateView) activePart;
-                            if(derivateView.isListenToSelectionChange()){
-                                Object selectionInput = derivateView.getSelectionInput();
-                                if(selectionInput instanceof CdmBase && ((CdmBase) selectionInput).isInstanceOf(Taxon.class)){
-                                    final Taxon taxon = HibernateProxyHelper.deproxy(CdmStore.getService(ITaxonService.class).load(((CdmBase)selectionInput).getUuid()), Taxon.class);
-                                    MenuItem item = new MenuItem(menu, SWT.NONE);
-                                    item.setText(String.format(Messages.CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR, taxon.getName()));
-                                    item.addSelectionListener(new SelectionAdapter() {
-                                        @Override
-                                        public void widgetSelected(SelectionEvent e) {
-                                            if(derivateView.isDirty()){
-                                                MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                                                return;
-                                            }
-
-                                            FieldUnit fieldUnit = FieldUnit.NewInstance();
-                                            fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
-                                            IndividualsAssociation association = IndividualsAssociation.NewInstance(fieldUnit);
-                                            TaxonDescription description;
-                                            if(!taxon.getDescriptions().isEmpty()){
-                                                description = taxon.getDescriptions().iterator().next();
-                                            }
-                                            else{
-                                                description = TaxonDescription.NewInstance(taxon);
-                                            }
-                                            description.addElement(association);
-                                            CdmStore.getService(ITaxonService.class).merge(taxon);
-                                            
-
-                                            derivateView.getConversationHolder().commit();
-                                            derivateView.addFieldUnit(fieldUnit);
-                                            derivateView.refreshTree(fieldUnit);
-                                        }
-                                    });
-                                }
-                            }
-                            else{
-                                MenuItem item = new MenuItem(menu, SWT.NONE);
-                                item.setText(Messages.CreateFieldUnitContextMenu_CREATE_FIELD_UNIT);
-                                item.addSelectionListener(new SelectionAdapter() {
-                                    @Override
-                                    public void widgetSelected(SelectionEvent e) {
-                                        if(derivateView.isDirty()){
-                                            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                                            return;
-                                        }
-                                        FieldUnit fieldUnit = FieldUnit.NewInstance();
-                                        fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
-                                        derivateView.getConversationHolder().commit();
-                                        derivateView.addFieldUnit(fieldUnit);
-                                        derivateView.updateRootEntities();
-                                        derivateView.refreshTree(fieldUnit);
-                                    }
-                                });
-                            }
-                        }
-                    }
-                }
-        };
-        return contributionItems;
-    }
-}
-
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/DerivateViewContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/DerivateViewContextMenu.java
deleted file mode 100644 (file)
index 6657e71..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-public class DerivateViewContextMenu extends CompoundContributionItem  {
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        IContributionItem[] contributionItems = new IContributionItem[] {
-                new CreateFieldUnitContextMenu(),
-                new CreateDerivateContextMenu(),
-                new Separator(),
-//                new ListenToSelectionChangeContextMenu(),
-        };
-        return contributionItems;
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/ListenToSelectionChangeContextMenu.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/ListenToSelectionChangeContextMenu.java
deleted file mode 100644 (file)
index 068f249..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu;
-
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.ImageResources;
-
-/**
- * Context menu for the SingleReads in the derivate hierarchy.
- *
- */
-public class ListenToSelectionChangeContextMenu extends CompoundContributionItem {
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        IContributionItem[] contributionItems = new IContributionItem[] {
-                new ContributionItem() {
-                    @Override
-                    public void fill(Menu menu, int index) {
-                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                        IWorkbenchPart activePart = window.getActivePage().getActivePart();
-                        if(activePart instanceof DerivateView){
-                            final DerivateView derivateView = (DerivateView) activePart;
-                            MenuItem item = new MenuItem(menu, SWT.NONE);
-                            if(derivateView.isListenToSelectionChange()){
-                                item.setText(Messages.ListenToSelectionChangeContextMenu_UNLINK);
-                            }
-                            else{
-                                item.setText(Messages.ListenToSelectionChangeContextMenu_LINK);
-                            }
-                            item.setImage(ImageResources.getImage(ImageResources.SYNCED));
-                            item.addSelectionListener(new SelectionAdapterExtension(derivateView));
-                        }
-                    }
-                }
-        };
-        return contributionItems;
-    }
-
-    private final class SelectionAdapterExtension extends SelectionAdapter {
-
-        private final DerivateView derivateView;
-
-        private SelectionAdapterExtension(DerivateView derivateView) {
-            this.derivateView = derivateView;
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            derivateView.toggleListenToSelectionChange();
-        }
-    }
-}
-
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AbstractAddDerivativeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AbstractAddDerivativeHandler.java
new file mode 100644 (file)
index 0000000..ea9ad3c
--- /dev/null
@@ -0,0 +1,82 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.TreeNode;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public abstract class AbstractAddDerivativeHandler {
+
+       @Execute
+       public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) TreeNode node, @Named(IServiceConstants.ACTIVE_PART) MPart part) {
+           DerivateView derivateView = (DerivateView) part.getObject();
+
+           checkDirtyState(derivateView);
+
+           Object selectedDerivative = node.getValue();
+           if(isAllowed(selectedDerivative)){
+               Object createdElement = addElement(selectedDerivative);
+               refreshView(derivateView, createdElement);
+           }
+       }
+
+    @CanExecute
+    public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) TreeNode node, MHandledMenuItem item) {
+        boolean canExecute = false;
+
+        Object derivate = node.getValue();
+        canExecute = isAllowed(derivate);
+        item.setVisible(canExecute);
+        return canExecute;
+    }
+
+    private void refreshView(DerivateView derivateView, Object createdElement) {
+        if(derivateView!=null){
+            derivateView.getConversationHolder().commit();
+            derivateView.refreshTree(createdElement);
+        }
+    }
+
+       private void checkDirtyState(DerivateView derivateView){
+               if(derivateView!=null){
+                   if(derivateView.isDirty()){
+                       MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                       return;
+                   }
+               }
+       }
+
+       protected Object addElement(Object selectedDerivative){
+           Object createdElement = null;
+           SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>) selectedDerivative;
+           DerivedUnit derivedUnit = createDerivative();
+           specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, derivedUnit, getDerivationeType()));
+           derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
+           derivedUnit.getTitleCache(); //update title cache
+           createdElement = derivedUnit;
+           CdmStore.getService(IOccurrenceService.class).merge((SpecimenOrObservationBase<?>) selectedDerivative, true);
+           return createdElement;
+       }
+
+       protected abstract DerivedUnit createDerivative();
+
+       protected abstract DerivationEventType getDerivationeType();
+
+    protected abstract boolean isAllowed(Object derivative);
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddConsensusSequenceHandler.java
new file mode 100644 (file)
index 0000000..bee79f6
--- /dev/null
@@ -0,0 +1,50 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class AddConsensusSequenceHandler extends AbstractAddDerivativeHandler{
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if(derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.DnaSample){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Object addElement(Object selectedDerivative) {
+        Sequence newInstance = Sequence.NewInstance((DnaSample) selectedDerivative, "", 0); //$NON-NLS-1$
+        CdmStore.getService(IOccurrenceService.class).merge((DnaSample) selectedDerivative, true);
+        return newInstance;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        //not used here
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        //not used here
+        return null;
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddDnaSampleHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddDnaSampleHandler.java
new file mode 100644 (file)
index 0000000..48de826
--- /dev/null
@@ -0,0 +1,40 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+
+public class AddDnaSampleHandler extends AbstractAddDerivativeHandler{
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if(derivative instanceof FieldUnit || (derivative instanceof DerivedUnit
+                && ((DerivedUnit) derivative).getRecordBasis().equals(SpecimenOrObservationType.PreservedSpecimen))
+                || (derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.TissueSample)){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        DnaSample dnaSample = DnaSample.NewInstance();
+        dnaSample.setRecordBasis(SpecimenOrObservationType.DnaSample);
+        return dnaSample;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        return DerivationEventType.DNA_EXTRACTION();
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddExistingMediaHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddExistingMediaHandler.java
new file mode 100644 (file)
index 0000000..04a2cc2
--- /dev/null
@@ -0,0 +1,51 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
+
+public class AddExistingMediaHandler extends AbstractAddDerivativeHandler{
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if(derivative instanceof FieldUnit
+                || (derivative instanceof DerivedUnit && ((DerivedUnit) derivative).getRecordBasis().equals(SpecimenOrObservationType.PreservedSpecimen))
+                || (derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.TissueSample)
+                || (derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.DnaSample)){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        MediaSpecimen mediaSpecimen = null;
+        //select media
+        Media media = MediaSelectionDialog.select(AbstractUtility.getShell(), null, null);
+        if(media!=null){
+            //create MediaSpecimen
+            mediaSpecimen = MediaSpecimen.NewInstance(SpecimenOrObservationType.StillImage);
+            mediaSpecimen.setMediaSpecimen(media);
+        }
+        return mediaSpecimen;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        return DerivationEventType.ACCESSIONING();
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddMediaSpecimenHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddMediaSpecimenHandler.java
new file mode 100644 (file)
index 0000000..dbdd382
--- /dev/null
@@ -0,0 +1,47 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import javax.inject.Inject;
+
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+
+public class AddMediaSpecimenHandler extends AbstractAddDerivativeHandler{
+
+    @Inject
+    private EModelService modelService;
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if(derivative instanceof FieldUnit
+                || (derivative instanceof DerivedUnit && ((DerivedUnit) derivative).getRecordBasis().equals(SpecimenOrObservationType.PreservedSpecimen))
+                || (derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.TissueSample)
+                || (derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.DnaSample)){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        return MediaSpecimen.NewInstance(SpecimenOrObservationType.StillImage);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        return DerivationEventType.ACCESSIONING();
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddSingleReadHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddSingleReadHandler.java
new file mode 100644 (file)
index 0000000..4efac11
--- /dev/null
@@ -0,0 +1,50 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+
+public class AddSingleReadHandler extends AbstractAddDerivativeHandler{
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if(derivative instanceof Sequence){
+            return true;
+        }
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Object addElement(Object selectedDerivative) {
+        SingleRead newInstance = SingleRead.NewInstance();
+        ((Sequence) selectedDerivative).addSingleRead(newInstance);
+        CdmApplicationState.getCurrentAppConfig().getSequenceService().merge((Sequence)selectedDerivative, true);
+        return newInstance;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        //not used here
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        //not used here
+        return null;
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddSpecimenHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddSpecimenHandler.java
new file mode 100644 (file)
index 0000000..574edec
--- /dev/null
@@ -0,0 +1,35 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+
+public class AddSpecimenHandler extends AbstractAddDerivativeHandler{
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if(derivative instanceof FieldUnit){
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        return DerivationEventType.GATHERING_IN_SITU();
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddTissueSampleHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddTissueSampleHandler.java
new file mode 100644 (file)
index 0000000..81f303f
--- /dev/null
@@ -0,0 +1,40 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+
+public class AddTissueSampleHandler extends AbstractAddDerivativeHandler{
+
+    @Override
+    protected boolean isAllowed(Object derivative) {
+        if (derivative instanceof FieldUnit || (derivative instanceof DerivedUnit
+                && ((DerivedUnit) derivative).getRecordBasis().equals(SpecimenOrObservationType.PreservedSpecimen))) {
+            return true;
+        }
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivedUnit createDerivative() {
+        DnaSample dnaSample = DnaSample.NewInstance();
+        dnaSample.setRecordBasis(SpecimenOrObservationType.TissueSample);
+        return dnaSample;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected DerivationEventType getDerivationeType() {
+        return DerivationEventType.PREPARATION();
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java
new file mode 100644 (file)
index 0000000..16cbb9f
--- /dev/null
@@ -0,0 +1,100 @@
+
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
+import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class CreateFieldUnitHandler {
+
+       @Execute
+       public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, MHandledMenuItem item) {
+        DerivateView derivateView = (DerivateView) part.getObject();
+        if(item.getElementId().equals(AppModelId.HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_CREATE_FIELD_UNIT_FOR_TAXON)){
+            Object selectionInput = derivateView.getSelectionInput();
+            if(selectionInput instanceof CdmBase && ((CdmBase) selectionInput).isInstanceOf(Taxon.class)){
+                final Taxon taxon = HibernateProxyHelper.deproxy(CdmStore.getService(ITaxonService.class).load(((CdmBase)selectionInput).getUuid()), Taxon.class);
+                if(derivateView.isDirty()){
+                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                    return;
+                }
+
+                FieldUnit fieldUnit = FieldUnit.NewInstance();
+                fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
+                IndividualsAssociation association = IndividualsAssociation.NewInstance(fieldUnit);
+                TaxonDescription description;
+                if(!taxon.getDescriptions().isEmpty()){
+                    description = taxon.getDescriptions().iterator().next();
+                }
+                else{
+                    description = TaxonDescription.NewInstance(taxon);
+                }
+                description.addElement(association);
+                CdmStore.getService(ITaxonService.class).merge(taxon);
+
+
+                derivateView.getConversationHolder().commit();
+                derivateView.addFieldUnit(fieldUnit);
+                derivateView.refreshTree(fieldUnit);
+            }
+        }
+        else{
+            if(derivateView.isDirty()){
+                MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+                return;
+            }
+            FieldUnit fieldUnit = FieldUnit.NewInstance();
+            fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
+            derivateView.getConversationHolder().commit();
+            derivateView.addFieldUnit(fieldUnit);
+            derivateView.updateRootEntities();
+            derivateView.refreshTree(fieldUnit);
+        }
+       }
+
+
+       @CanExecute
+       public boolean canExecute(@Named(IServiceConstants.ACTIVE_PART) MPart part, MHandledMenuItem item) {
+           DerivateView derivateView = (DerivateView) part.getObject();
+           boolean listenToSelectionChange = derivateView.isListenToSelectionChange();
+           setItemVisibility(item, listenToSelectionChange);
+           if(listenToSelectionChange &&
+                   item.getElementId().equals(AppModelId.HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_CREATE_FIELD_UNIT_FOR_TAXON)){
+               Object selectionInput = derivateView.getSelectionInput();
+               if(selectionInput instanceof CdmBase && ((CdmBase) selectionInput).isInstanceOf(Taxon.class)){
+                   final Taxon taxon = HibernateProxyHelper.deproxy(CdmStore.getService(ITaxonService.class).load(((CdmBase)selectionInput).getUuid()), Taxon.class);
+                   item.setLabel(String.format(Messages.CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR, taxon.getName()));
+               }
+           }
+           return true;
+       }
+
+
+    private void setItemVisibility(MHandledMenuItem item, boolean isListeningToSelectionChange) {
+        if(item.getElementId().equals(AppModelId.HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_CREATEFIELDUNIT)){
+            item.setVisible(!isListeningToSelectionChange);
+        }
+        else{
+            item.setVisible(isListeningToSelectionChange);
+        }
+    }
+
+}
\ No newline at end of file
index 34c7cec..6ccb5a0 100644 (file)
@@ -9,20 +9,19 @@
 
 package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
 
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.operations.AbstractOperation;
-import org.eclipse.core.commands.operations.IUndoContext;
+import javax.inject.Named;
+
+import org.eclipse.core.commands.ParameterizedCommand;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
@@ -31,19 +30,14 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.editor.view.derivate.operation.DeleteDerivateOperation;
 import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator.DeleteConfiguratorDialog;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
 
 /**
  *
@@ -51,188 +45,92 @@ import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
  * @date Oct 21, 2014
  *
  */
-public class DeleteDerivateHandler extends RemotingCdmHandler {
+public class DeleteDerivateHandler {
 
-    SpecimenDeleteConfigurator deleteConfigurator;
-    IEditorPart editor;
-    TreeNode node;
 
-    /**
-     * @param label
-     */
-    public DeleteDerivateHandler(String label) {
-        super(label);
+    private SpecimenDeleteConfigurator deleteConfigurator;
 
-    }
+    @Execute
+    public Object execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode treeNode, ParameterizedCommand command) {
+        deleteConfigurator = new SpecimenDeleteConfigurator();
+        if(command.getId().equals(AppModelId.COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATE_DEEPDELETE)){
+            deleteConfigurator.setDeleteChildren(true);
+        }
 
-    /**
-     * @param label
-     */
-    public DeleteDerivateHandler() {
-        super(Messages.DeleteDerivateHandler_LABEL);
+        DerivateView derivateView = (DerivateView) part.getObject();
+        Object value = treeNode.getValue();
+        IStatus allowStatus = allowOperations(derivateView, treeNode);
+        if(allowStatus.isOK()) {
+            DeleteResult deleteResult;
+            if(value instanceof SingleRead
+                    && treeNode.getParent()!=null
+                    && treeNode.getParent().getValue() instanceof Sequence){
+                deleteResult = CdmStore.getService(ISequenceService.class).deleteSingleRead(((SingleRead)value).getUuid(),
+                        ((Sequence) treeNode.getParent().getValue()).getUuid());
+            } else if(value instanceof Sequence){
+                deleteResult = CdmStore.getService(ISequenceService.class).delete(((Sequence) value).getUuid());
+            } else {
+                deleteResult = CdmStore.getService(IOccurrenceService.class).delete(((CdmBase) value).getUuid(), deleteConfigurator);
+            }
 
-    }
+            if (!deleteResult.isOk()) {
+                MessagingUtils.warningDialog(Messages.DeleteDerivateOperation_DELETE_FAILED, this, deleteResult.toString());
 
-//    /** {@inheritDoc} */
-//    @Override
-//    public Object execute(ExecutionEvent event) throws ExecutionException {
-//        IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveSite(event).getSelectionProvider().getSelection();
-//
-//        IWorkbenchPart part = HandlerUtil.getActivePart(event);
-//        IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-//
-//        try {
-//            String label = event.getCommand().getName();
-//
-//            IUndoContext undoContext = EditorUtil.getUndoContext();
-//
-//            if(selection.size()>0){
-//                Object object = selection.iterator().next();
-//
-//                if(object instanceof TreeNode){
-//                    Object value = ((TreeNode) object).getValue();
-//                    if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
-//                        if(postOperationEnabled instanceof IConversationEnabled){
-//                            ConversationHolder conversationHolder = ((IConversationEnabled) postOperationEnabled).getConversationHolder();
-//                            label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder); //$NON-NLS-1$
-//                        }
-//                        SpecimenDeleteConfigurator config = new SpecimenDeleteConfigurator();
-//                        boolean deepDelete = event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivate.deepDelete"); //$NON-NLS-1$
-//                        config.setDeleteChildren(deepDelete);
-//                        config.setDeleteMolecularData(deepDelete);
-//                        DeleteDerivateOperation deleteDerivateOperation = new DeleteDerivateOperation(label, undoContext, (CdmBase) value, (TreeNode) object, postOperationEnabled, config);
-//                        IStatus status = AbstractUtility.executeOperation(deleteDerivateOperation);
-//                        DerivateView derivateView = (DerivateView)postOperationEnabled;
-//                        if(derivateView.postOperation(null)){
-//                            derivateView.remove(object);
-//
-//                           // derivateView.updateRootEntities();
-//                            //update DerivateView
-//
-//
-//                        }
-//                    }
-//                }
-//                else{
-//                    MessagingUtils.error(getClass(), Messages.DeleteDerivateHandler_INVALID_SELECTION, null);
-//                }
-//            }
-//
-//        } catch (NotDefinedException e) {
-//            MessagingUtils.warn(getClass(), "Command name not set"); //$NON-NLS-1$
-//        }
-//        return null;
-//    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public IStatus allowOperations(ExecutionEvent event) {
-        //check whether object can be deleted
-        editor = HandlerUtil.getActiveEditor(event);
-        IStructuredSelection selection = (IStructuredSelection) HandlerUtil
-                .getCurrentSelection(event);
-        AbstractPostOperation operation;
-        deleteConfigurator = new SpecimenDeleteConfigurator();
+                return Status.CANCEL_STATUS;
+            }
+            if(derivateView.postOperation(null)){
+                derivateView.remove(treeNode);
 
+            }
+            return Status.OK_STATUS;
+        }
+        return null;
+    }
+
+    public IStatus allowOperations(DerivateView derivateView, TreeNode treeNode) {
         String confirmationQuestion = Messages.DeleteDerivateOperation_REALLY_DELETE;
         if(deleteConfigurator.isDeleteChildren()){
             confirmationQuestion += Messages.DeleteDerivateOperation_AND_CHILDREN;
         }
 
-        if(editor.isDirty()){
+        if(derivateView.isDirty()){
             MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
             return Status.CANCEL_STATUS;
         }
-
         confirmationQuestion += "?"; //$NON-NLS-1$
         if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfigurator, null, Messages.DeleteDerivateOperation_CONFIRM, confirmationQuestion)){
             return Status.CANCEL_STATUS;
         }
-        Object object = selection.iterator().next();
         DeleteResult deleteResult;
-        if(object instanceof TreeNode){
-            Object value = ((TreeNode) object).getValue();
-            if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
-                if (value instanceof Sequence || value instanceof SingleRead){
-                    deleteResult = CdmStore.getService(ISequenceService.class).isDeletable(((CdmBase)value).getUuid(), deleteConfigurator);
-                } else{
-                    deleteResult = CdmStore.getService(IOccurrenceService.class).isDeletable(((CdmBase)value).getUuid(), deleteConfigurator);
-                }
-                if (deleteResult.isOk() || deleteResult.getExceptions().isEmpty()){ return Status.OK_STATUS;}
-                else{
-                    if (!deleteResult.isOk()){
-                        DeleteResultMessagingUtils.messageDialogWithDetails(deleteResult, Messages.DeleteDerivateOperation_DELETE_FAILED, TaxeditorEditorPlugin.PLUGIN_ID);
-                    } else {
-                        if (!deleteResult.getExceptions().isEmpty()){
-                            DeleteResultMessagingUtils.messageDialogWithDetails(deleteResult, Messages.DeleteDerivateHandler_SUCCESSFULL_BUT_EXCEPTIONS, TaxeditorEditorPlugin.PLUGIN_ID);
-                        }
+        Object value = treeNode.getValue();
+        if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
+            if (value instanceof Sequence || value instanceof SingleRead){
+                deleteResult = CdmStore.getService(ISequenceService.class).isDeletable(((CdmBase)value).getUuid(), deleteConfigurator);
+            } else{
+                deleteResult = CdmStore.getService(IOccurrenceService.class).isDeletable(((CdmBase)value).getUuid(), deleteConfigurator);
+            }
+            if (deleteResult.isOk() || deleteResult.getExceptions().isEmpty()){ return Status.OK_STATUS;}
+            else{
+                if (!deleteResult.isOk()){
+                    DeleteResultMessagingUtils.messageDialogWithDetails(deleteResult, Messages.DeleteDerivateOperation_DELETE_FAILED, TaxeditorEditorPlugin.PLUGIN_ID);
+                } else {
+                    if (!deleteResult.getExceptions().isEmpty()){
+                        DeleteResultMessagingUtils.messageDialogWithDetails(deleteResult, Messages.DeleteDerivateHandler_SUCCESSFULL_BUT_EXCEPTIONS, TaxeditorEditorPlugin.PLUGIN_ID);
                     }
+                }
 
-                    return Status.CANCEL_STATUS;
-                    }
+                return Status.CANCEL_STATUS;
             }
-
         }
-
         return Status.CANCEL_STATUS;
-
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public AbstractOperation prepareOperation(ExecutionEvent event) {
-        IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveSite(event).getSelectionProvider().getSelection();
-
-        IWorkbenchPart part = HandlerUtil.getActivePart(event);
-        IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-
-        try {
-            String label = event.getCommand().getName();
-
-            IUndoContext undoContext = EditorUtil.getUndoContext();
-
-            if(selection.size()>0){
-                Object object = selection.iterator().next();
-
-                if(object instanceof TreeNode){
-                    node = (TreeNode)object;
-                    Object value = ((TreeNode) object).getValue();
-                    if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
-                        if(postOperationEnabled instanceof IConversationEnabled){
-                            ConversationHolder conversationHolder = ((IConversationEnabled) postOperationEnabled).getConversationHolder();
-                            label += " "+DerivateLabelProvider.getDerivateText(value, conversationHolder); //$NON-NLS-1$
-                        }
-
-
-                        DeleteDerivateOperation deleteDerivateOperation = new DeleteDerivateOperation(label, undoContext, (CdmBase) value, (TreeNode) object, postOperationEnabled, this.deleteConfigurator);
-                        return deleteDerivateOperation;
-                    }
-                }
-            }
-        } catch (NotDefinedException e) {
-            MessagingUtils.warn(getClass(), "Command name not set"); //$NON-NLS-1$
-        }
-        return null;
-
+    @CanExecute
+    public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode node,
+            MHandledMenuItem menuItem){
+        boolean canExecute = node !=null;
+        menuItem.setVisible(canExecute);
+        return canExecute;
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void onComplete() {
-
-        IPostOperationEnabled postOperationEnabled = (editor instanceof IPostOperationEnabled) ? (IPostOperationEnabled) editor : null;
-        if (postOperationEnabled != null){
-            DerivateView derivateView = (DerivateView)postOperationEnabled;
-          if(derivateView.postOperation(null)){
-              derivateView.remove(node);
-
-          }
-        }
-    }
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ListenToSelectionChangeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/ListenToSelectionChangeHandler.java
deleted file mode 100644 (file)
index 413c377..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-
-public class ListenToSelectionChangeHandler extends AbstractHandler {
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
-        if(activePart instanceof DerivateView){
-            DerivateView derivativeEditor = (DerivateView)activePart;
-            derivativeEditor.toggleListenToSelectionChange();
-        }
-        return null;
-    }
-
-}
index d5f71ee..8440fad 100644 (file)
@@ -4,19 +4,22 @@ import java.util.Collections;
 import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 public class OpenDerivativeEditorForDescriptionElement extends DefaultOpenHandlerBase<IndividualsAssociation> {
 
@@ -38,11 +41,11 @@ public class OpenDerivativeEditorForDescriptionElement extends DefaultOpenHandle
         SpecimenOrObservationBase associatedSpecimenOrObservation = entity.getAssociatedSpecimenOrObservation();
         if(associatedSpecimenOrObservation!=null){
             UUID specimenUuid = associatedSpecimenOrObservation.getUuid();
-            try {
-                EditorUtil.open(new DerivateViewEditorInput(Collections.singletonList(specimenUuid)));
-            } catch (PartInitException e) {
-                MessagingUtils.error(OpenDerivateViewHandler.class, OpenDerivativeEditorForTaxonNode.OPEN_DERIVATIVE_EDITOR_FOR_TAXON_NODE_COULD_NOT_OPEN, e);
-            }
+            DerivateViewEditorInput input = new DerivateViewEditorInput(Collections.singletonList(specimenUuid));
+            MPart part = TaxeditorStorePlugin.getDefault().getWorkbench().getService(EPartService.class).showPart(
+                    AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW, PartState.ACTIVATE);
+            DerivateView derivateView = (DerivateView) part.getObject();
+            derivateView.init(input);
         }
 
     }
index 627fc9a..bbab719 100644 (file)
@@ -3,17 +3,19 @@ package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
 import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
 
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 public class OpenDerivativeEditorForSpecimenOrOBservationBase extends DefaultOpenHandlerBase<SpecimenOrObservationBase<?>>{
 
@@ -29,14 +31,11 @@ public class OpenDerivativeEditorForSpecimenOrOBservationBase extends DefaultOpe
 
     @Override
     protected void open(ExecutionEvent event, SpecimenOrObservationBase<?> entity) {
-        try {
-            EditorUtil.open(new DerivateViewEditorInput(entity.getUuid()));
-        } catch (PartInitException e) {
-            MessagingUtils.error(OpenDerivateViewHandler.class, OPEN_DERIVATIVE_EDITOR_FOR_TAXON_NODE_COULD_NOT_OPEN, e);
-        }
-
+        DerivateViewEditorInput input = new DerivateViewEditorInput(entity.getUuid());
+        MPart part = TaxeditorStorePlugin.getDefault().getWorkbench().getService(EPartService.class).showPart(
+                AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW, PartState.ACTIVATE);
+        DerivateView derivateView = (DerivateView) part.getObject();
+        derivateView.init(input);
     }
 
-
-
 }
index bfbe233..329ca8d 100644 (file)
@@ -6,20 +6,22 @@ import java.util.List;
 import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.ui.PartInitException;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
 
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler;
+import eu.etaxonomy.taxeditor.editor.AppModelId;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
 import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 public class OpenDerivativeEditorForTaxonNode extends DefaultOpenHandlerBase<TaxonNode> {
 
@@ -40,12 +42,11 @@ public class OpenDerivativeEditorForTaxonNode extends DefaultOpenHandlerBase<Tax
         for (SpecimenOrObservationBase specimenOrObservationBase : specimens) {
             specimenUuids.add(specimenOrObservationBase.getUuid());
         }
-        try {
-            EditorUtil.open(new DerivateViewEditorInput(specimenUuids, taxonUuid));
-        } catch (PartInitException e) {
-            MessagingUtils.error(OpenDerivateViewHandler.class, OPEN_DERIVATIVE_EDITOR_FOR_TAXON_NODE_COULD_NOT_OPEN, e);
-        }
-
+        DerivateViewEditorInput input = new DerivateViewEditorInput(specimenUuids, taxonUuid);
+        MPart part = TaxeditorStorePlugin.getDefault().getWorkbench().getService(EPartService.class).showPart(
+                AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW, PartState.ACTIVATE);
+        DerivateView derivateView = (DerivateView) part.getObject();
+        derivateView.init(input);
     }
 
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadCopyToClipboardHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadCopyToClipboardHandler.java
new file mode 100644 (file)
index 0000000..5952709
--- /dev/null
@@ -0,0 +1,38 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
+
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+
+public class SingleReadCopyToClipboardHandler {
+
+    @Execute
+    public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode){
+        DerivateView derivateView = (DerivateView)part.getObject();
+        LocalSelectionTransfer.getTransfer().setSelection(new StructuredSelection(selectedTreeNode));
+        derivateView.updateLabelCache();
+        derivateView.refreshTree();
+    }
+
+    @CanExecute
+    public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode, MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        if(selectedTreeNode!=null){
+            Object object = selectedTreeNode.getValue();
+            canExecute = (object instanceof SingleRead);
+        }
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadHandler.java
deleted file mode 100644 (file)
index d60651b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeNode;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
-import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-public class SingleReadHandler extends AbstractHandler {
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
-        ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
-        final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
-        TreeNode clipBoardTreeNode = EditorUtil.getTreeNodeOfSelection(clipBoardSelection);
-        TreeNode selectedTreeNode = EditorUtil.getTreeNodeOfSelection(selection);
-        if(activeEditor instanceof DerivateView) {
-            DerivateView derivateView = (DerivateView)activeEditor;
-            if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard")){ //$NON-NLS-1$
-                LocalSelectionTransfer.getTransfer().setSelection(selection);
-            }
-            else if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead")){ //$NON-NLS-1$
-                if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                    return null;
-                }
-                if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
-                        && selectedTreeNode!=null && selectedTreeNode.getValue() instanceof Sequence){
-                    SingleRead singleRead = (SingleRead)clipBoardTreeNode.getValue();
-                    Sequence sequence = (Sequence)selectedTreeNode.getValue();
-                    sequence.addSingleRead(singleRead);
-                    CdmStore.getService(ISequenceService.class).merge(sequence);
-                   
-                    if(activeEditor instanceof DerivateView) {
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree();
-                        LocalSelectionTransfer.getTransfer().setSelection(null);
-                    }
-                }
-            }
-            else if(event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence")){ //$NON-NLS-1$
-                if(activeEditor.isDirty()){
-                    MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
-                    return null;
-                }
-                if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
-                        selectedTreeNode.getValue() instanceof SingleRead && selectedTreeNode.getParent().getValue() instanceof Sequence) {
-                    Sequence sequence = (Sequence) selectedTreeNode.getParent().getValue();
-                    sequence.removeSingleRead((SingleRead) selectedTreeNode.getValue());
-                    CdmStore.getService(ISequenceService.class).merge(sequence);
-                    
-                    if(activeEditor instanceof DerivateView) {
-                        derivateView.getConversationHolder().commit();
-                        derivateView.refreshTree();
-                    }
-                }
-            }
-            derivateView.updateLabelCache();
-            derivateView.refreshTree();
-        }
-        return null;
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadRemoveHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadRemoveHandler.java
new file mode 100644 (file)
index 0000000..9342f30
--- /dev/null
@@ -0,0 +1,55 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.TreeNode;
+
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class SingleReadRemoveHandler {
+
+    @Execute
+    public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode){
+        DerivateView derivateView = (DerivateView)part.getObject();
+        if(derivateView.isDirty()){
+            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+            return;
+        }
+        if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
+                selectedTreeNode.getValue() instanceof SingleRead && selectedTreeNode.getParent().getValue() instanceof Sequence) {
+            Sequence sequence = (Sequence) selectedTreeNode.getParent().getValue();
+            sequence.removeSingleRead((SingleRead) selectedTreeNode.getValue());
+            CdmStore.getService(ISequenceService.class).merge(sequence);
+
+            derivateView.getConversationHolder().commit();
+            derivateView.refreshTree();
+        }
+        derivateView.updateLabelCache();
+        derivateView.refreshTree();
+    }
+
+    @CanExecute
+    public boolean canExecute(@Named(IServiceConstants.ACTIVE_PART) MPart part,
+            @Optional @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode,
+            MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        if(selectedTreeNode!=null){
+            Object value = selectedTreeNode.getValue();
+            canExecute = value instanceof SingleRead && ((DerivateView) part.getObject()).getMultiLinkSingleReads().contains(value);
+        }
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadReuseHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadReuseHandler.java
new file mode 100644 (file)
index 0000000..ea7bea7
--- /dev/null
@@ -0,0 +1,64 @@
+package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeNode;
+
+import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class SingleReadReuseHandler {
+
+    @Execute
+    public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode){
+        ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
+        TreeNode clipBoardTreeNode = EditorUtil.getTreeNodeOfSelection(clipBoardSelection);
+        DerivateView derivateView = (DerivateView)part.getObject();
+        if(derivateView.isDirty()){
+            MessagingUtils.warningDialog(DerivateView.VIEW_HAS_UNSAVED_CHANGES, this, DerivateView.YOU_NEED_TO_SAVE_BEFORE_PERFORMING_THIS_ACTION);
+            return;
+        }
+        if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
+                && selectedTreeNode!=null && selectedTreeNode.getValue() instanceof Sequence){
+            SingleRead singleRead = (SingleRead)clipBoardTreeNode.getValue();
+            Sequence sequence = (Sequence)selectedTreeNode.getValue();
+            sequence.addSingleRead(singleRead);
+            CdmStore.getService(ISequenceService.class).merge(sequence);
+
+            derivateView.getConversationHolder().commit();
+            derivateView.refreshTree();
+            LocalSelectionTransfer.getTransfer().setSelection(null);
+        }
+        derivateView.updateLabelCache();
+        derivateView.refreshTree();
+    }
+
+    @CanExecute
+    public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) TreeNode selectedTreeNode, MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        if(selectedTreeNode!=null){
+            Object value = selectedTreeNode.getValue();
+            TreeNode clipboardNode = EditorUtil.getTreeNodeOfSelection(LocalSelectionTransfer.getTransfer().getSelection());
+            if(value instanceof Sequence && clipboardNode!=null && clipboardNode.getValue() instanceof SingleRead
+                    && !((Sequence) value).getSingleReads().contains(clipboardNode.getValue())){
+                canExecute = true;
+            }
+        }
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+
+}
index 3af34dd..d3ce781 100644 (file)
@@ -1,19 +1,32 @@
 package eu.etaxonomy.taxeditor.editor.view.derivate.handler;
 
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
 
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 
-public class ToggleLinkWithTaxonSelectionHandler extends AbstractHandler {
+public class ToggleLinkWithTaxonSelectionHandler {
 
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        DerivateView derivateView = (DerivateView) HandlerUtil.getActiveEditor(event);
-        derivateView.toggleListenToSelectionChange();
-        return null;
+    @Execute
+    public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part){
+        DerivateView derivateView = (DerivateView) part.getObject();
+        derivateView.toggleListenToSelectionChange(part);
     }
 
+    @CanExecute
+    public boolean canExecute(@Named(IServiceConstants.ACTIVE_PART) MPart part, MHandledMenuItem item){
+        DerivateView derivateView = (DerivateView) part.getObject();
+        if(derivateView.isListenToSelectionChange()){
+            item.setLabel("Unlink from taxon selection");
+        }
+        else{
+            item.setLabel("Link with taxon selection");
+        }
+        return true;
+    }
 }
index 8724b6a..165cf74 100644 (file)
@@ -91,7 +91,7 @@ public class DerivateSearchCompositeController implements Listener{
         default:
             break;
         }
-        derivativeEditor.dispose();
+        derivativeEditor.getCdmEntitySession().dispose();
         derivativeEditor.getCdmEntitySession().bind();
 
         SearchManager searchManager = new SearchManager();
index 6e180d3..83c798e 100644 (file)
@@ -153,7 +153,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
        /** {@inheritDoc} */
        @Override
     protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection) {
-               if(AbstractUtility.getActiveEditor() == null){
+               if(AbstractUtility.getActiveE4Editor() == null){
                        showEmptyPage();
                        return;
                }
index d47ff90..0d1da78 100644 (file)
@@ -160,21 +160,21 @@ public class DescriptionsMenuPropertyTester extends PropertyTester {
        }
 
        private boolean isTaxonEditor() {
-           if(AbstractUtility.getActiveEditor() instanceof MultiPageTaxonEditor){
+           if(AbstractUtility.getActiveE4Editor() instanceof MultiPageTaxonEditor){
                return true;
            }
            return false;
        }
 
        private boolean isBulkEditor() {
-           if(AbstractUtility.getActiveEditor() instanceof BulkEditor){
+           if(AbstractUtility.getActiveE4Editor() instanceof BulkEditor){
                return true;
            }
            return false;
        }
 
        private boolean isDerivateEditor() {
-           if(AbstractUtility.getActiveEditor() instanceof DerivateView){
+           if(AbstractUtility.getActiveE4Editor() instanceof DerivateView){
                return true;
            }
            return false;
index d6347ef..66af4c7 100644 (file)
@@ -28,7 +28,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureNode;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -47,10 +47,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class DynamicFeatureMenu extends CompoundContributionItem {
 
-       private final ISelectionService selectionService = EditorUtil.getActivePart()
-                       .getSite().getWorkbenchWindow().getSelectionService();
-       private final IHandlerService handlerService = (IHandlerService) EditorUtil
-                       .getService(IHandlerService.class);
+       private final ISelectionService selectionService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(ISelectionService.class);
+       private final IHandlerService handlerService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(IHandlerService.class);
 
        /*
         * (non-Javadoc)
@@ -105,7 +103,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
        private void createMenuItem(Menu menu, final Feature feature) {
                MenuItem menuItem = new MenuItem(menu, -1);
                final Feature deproxiedFeature = HibernateProxyHelper.deproxy(feature, Feature.class);
-                               
+
                String label = deproxiedFeature.getLabel(PreferencesUtil.getGlobalLanguage());
                if (label == null){
                        menuItem.setText(deproxiedFeature.getLabel());
index ae33949..cbb052e 100644 (file)
@@ -71,6 +71,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
 
                Control control = viewer.getControl();
                Menu menu = menuMgr.createContextMenu(control);
+               menuMgr.setRemoveAllWhenShown(true);
                control.setMenu(menu);
 
        }
@@ -91,7 +92,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
            if(part==this){
                return;
            }
-               if(AbstractUtility.getActiveEditor() == null){
+               if(AbstractUtility.getActiveE4Editor() == null){
                        showEmptyPage();
                        return;
                }
@@ -136,7 +137,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
                ((BulkEditor) part).forceDirty();
                IStructuredSelection selection = (IStructuredSelection) ((BulkEditor) part).getSelectionProvider().getSelection();
             ((BulkEditor) part).changed(selection.getFirstElement());
-            
+
            }
            super.changed(object);
        }
index cb52a8c..e0fe207 100644 (file)
@@ -64,7 +64,7 @@ public class DeleteMediaOperation extends AbstractPostTaxonOperation {
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
-           ImagesUtility.removeMediaFromGallery(description, media);
+          // ImagesUtility.removeMediaFromGallery(description, media);
 
                monitor.worked(20);
                CdmStore.getService(IMediaService.class).delete(media.getUuid(), config);
index 6f8032c..d419470 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="eu.etaxonomy.taxeditor.feature.platform"
       label="Taxeditor Dependencies"
-      version="4.7.0.qualifier"
+      version="4.8.0.qualifier"
       os="linux,macosx,win32"
       ws="cocoa,gtk,win32"
       arch="x86,x86_64">
index 315306c..af7b231 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>4.7.0-SNAPSHOT</version>
+               <version>4.8.0-SNAPSHOT</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
        <artifactId>eu.etaxonomy.taxeditor.feature.platform</artifactId>
index c6c4e92..848ee96 100644 (file)
@@ -2,7 +2,7 @@
 <feature
       id="eu.etaxonomy.taxeditor.feature"
       label="Taxonomic Editor"
-      version="4.7.0.qualifier"
+      version="4.8.0.qualifier"
       provider-name="EDIT"
       plugin="eu.etaxonomy.taxeditor.application"
       os="linux,macosx,win32"
index 2f0118c..5c60da2 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>4.7.0-SNAPSHOT</version>
+    <version>4.8.0-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
index a156ce6..ae695e2 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Help
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator
 Bundle-Vendor: EDIT
 Require-Bundle: org.eclipse.ui,
index 6d2a131..fe0b3fb 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>4.7.0-SNAPSHOT</version>
+               <version>4.8.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index dc2f916..e79f99c 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: eu.etaxonomy.taxeditor.molecular.lib
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular.lib;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-ClassPath: .,
  lib/owlapi-xmlutils-4.1.4.jar,
  lib/commons-collections4-4.1.jar,
index 4c9fc27..219bde0 100644 (file)
@@ -7,7 +7,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>4.7.0-SNAPSHOT</version>
+    <version>4.8.0-SNAPSHOT</version>
   </parent>
 
   <build>
index 8ec58c1..adfdc71 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Molecular Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
index 65e9b34..5b9e6a4 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>4.7.0-SNAPSHOT</version>
+    <version>4.8.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index c845700..8dedfb8 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.molecular.handler;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IEditorPart;
 
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
@@ -29,7 +28,7 @@ import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
  */
 public abstract class AbstractAlignmentEditorHandler extends AbstractHandler {
        public static AlignmentEditor getActiveAlignmentEditor() {
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+           Object activeEditor = AbstractUtility.getActiveE4Editor();
         if (activeEditor instanceof AlignmentEditor) {
             return (AlignmentEditor)activeEditor;
         }
@@ -37,8 +36,8 @@ public abstract class AbstractAlignmentEditorHandler extends AbstractHandler {
                return null;
         }
        }
-       
-       
+
+
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
        AlignmentEditor editor = getActiveAlignmentEditor();
index e7151aa..8589c7f 100644 (file)
@@ -9,20 +9,18 @@
 package eu.etaxonomy.taxeditor.molecular.handler;
 
 
-import info.bioinfweb.libralign.alignmentarea.AlignmentArea;
-import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;
-import info.bioinfweb.libralign.pherogram.PherogramComponent;
-
 import java.util.Iterator;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
 import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;
+import info.bioinfweb.libralign.alignmentarea.AlignmentArea;
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;
+import info.bioinfweb.libralign.pherogram.PherogramComponent;
 
 
 
@@ -36,7 +34,7 @@ import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;
 public abstract class AbstractPherogramComponentHandler extends AbstractHandler {
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        IWorkbenchPart activePart = AbstractUtility.getActivePart();
+        Object activePart = AbstractUtility.getActiveE4Part();
 
         if (activePart instanceof AlignmentEditor) {
             AlignmentEditor editor = (AlignmentEditor)activePart;
index f89d68c..2168d57 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.ui.IEditorPart;
 
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -36,12 +35,9 @@ import eu.etaxonomy.taxeditor.molecular.l10n.Messages;
 public class LoadPherogramHandler extends AbstractHandler {
        //TODO Change so that also URIs which do not point to files can be specified.
 
-       /* (non-Javadoc)
-     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-     */
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+        Object activeEditor = AbstractUtility.getActiveE4Editor();
         if (activeEditor instanceof AlignmentEditor) {
             AlignmentEditor alignmentEditor = (AlignmentEditor)activeEditor;
 
index cff86d7..2867fd4 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Map;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.commands.IElementUpdater;
@@ -50,7 +49,7 @@ public class ToggleInsertOverwriteHandler extends AbstractAlignmentEditorHandler
 
        @Override
        public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+           Object activeEditor = AbstractUtility.getActiveE4Editor();
                if (activeEditor instanceof AlignmentEditor) {
                        if (((AlignmentEditor)activeEditor).isInsertMode()) {
                            element.setIcon(INSERT_DESCRIPTOR);
@@ -62,7 +61,7 @@ public class ToggleInsertOverwriteHandler extends AbstractAlignmentEditorHandler
                                element.setText("OVR"); //$NON-NLS-1$
                                element.setTooltip(Messages.ToggleInsertOverwriteHandler_SWITCH_INSERTION);
                        }
-            ((ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class)).refreshElements(
+            PlatformUI.getWorkbench().getService(ICommandService.class).refreshElements(
                     ToggleLeftRightInsertionHandler.COMMAND_ID, null);
                }
        }
index 9dbf660..5ea69c7 100644 (file)
@@ -14,7 +14,6 @@ import java.util.Map;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.commands.IElementUpdater;
 import org.eclipse.ui.menus.UIElement;
 
@@ -53,7 +52,7 @@ public class ToggleLeftRightInsertionHandler extends AbstractAlignmentEditorHand
 
     @Override
     public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
-        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+        Object activeEditor = AbstractUtility.getActiveE4Editor();
         if (activeEditor instanceof AlignmentEditor) {
             setBaseEnabled(((AlignmentEditor)activeEditor).isInsertMode());
             if (((AlignmentEditor)activeEditor).isInsertLeftInPherogram()) {
index 4545609..b97a60c 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Navigation Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.cdm,
index 8b4287e..f31de2d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ASCII"?>
 <fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_OhwnQCTfEeeiN5lBIuqN3g">
-  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.toolbar.0">
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.trimcontribution.mainToolbar">
     <elements xsi:type="menu:ToolControl" xmi:id="_7kZI4CTfEeeiN5lBIuqN3g" elementId="eu.etaxonomy.taxeditor.navigation.toolcontrol.search_bar" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.search.SearchBar"/>
   </fragments>
 </fragment:ModelFragments>
index bd413e5..130c92b 100644 (file)
                      <reference
                            definitionId="isCdmStoreConnected">
                      </reference>
-                     <reference
-                           definitionId="isTaxonNode">
-                     </reference>
                   </and>
             </visibleWhen>
          </command>
index ffd5df1..8010ccb 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>4.7.0-SNAPSHOT</version>
+               <version>4.8.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index a1db9fe..4b4f810 100644 (file)
@@ -136,6 +136,7 @@ public class Messages extends NLS {
     public static String SearchResultView_STATUS;
     public static String SetSecundumForSubtreeOperation_CHANGE_SEC_OP;
     public static String SetSecundumForSubtreeOperation_SET_SEC_TASK;
+       public static String SetSecundumForSubtreeHandler_CONFIG_DIALOG_TITLE;
     public static String TaxonLinkHelper_CREATE_FAIL;
 
     public static String TaxonNavigator_LOAD_DATASOURCE;
@@ -175,6 +176,7 @@ public class Messages extends NLS {
     public static String TreeNodeDropAdapter_UNSAVED_PARENT;
     public static String TreeNodeDropAdapter_UNSAVED_PARENT_MESSAGE;
 
+
     static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
index 348685a..37b1180 100644 (file)
@@ -117,6 +117,7 @@ SearchResultView_SEARCHING=Searching...
 SearchResultView_STATUS=Status:
 SetSecundumForSubtreeOperation_CHANGE_SEC_OP=Change secundum reference for all children
 SetSecundumForSubtreeOperation_SET_SEC_TASK=Set secundum reference for subtree
+SetSecundumForSubtreeHandler_CONFIG_DIALOG_TITLE=Set secundum reference for subtree
 TaxonLinkHelper_CREATE_FAIL=Could not create Taxon
 TaxonNavigator_LOAD_DATASOURCE=Loading datasources
 TaxonNavigator_RESTORE=Restoring Taxon Navigator
index 122d06d..5bf8357 100644 (file)
@@ -117,6 +117,7 @@ SearchResultView_SEARCHING=Suche...
 SearchResultView_STATUS=Status:
 SetSecundumForSubtreeOperation_CHANGE_SEC_OP=Secundum Referenz für alle Kinder ändern
 SetSecundumForSubtreeOperation_SET_SEC_TASK=Secundum Referenz für Teilbaum setzen
+SetSecundumForSubtreeHandler_CONFIG_DIALOG_TITLE=Setze Secundum Referenz für Teilbaum
 TaxonLinkHelper_CREATE_FAIL=Konnte Taxon nicht erstellen
 TaxonNavigator_LOAD_DATASOURCE=Lade Datenquellen
 TaxonNavigator_RESTORE=Taxonnavigator wiederherstellen
index 9f2283c..f7c9568 100644 (file)
@@ -12,7 +12,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
@@ -40,7 +39,7 @@ public class MoveFactualDataHandler extends AbstractHandler {
     @Override
     public Object execute(ExecutionEvent event) throws ExecutionException {
         ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-        IWorkbenchPart activePart = AbstractUtility.getActivePart();
+        Object activePart = AbstractUtility.getActiveE4Part();
         TaxonNavigator navigator = null;
         if(activePart instanceof TaxonNavigator){
             navigator = (TaxonNavigator)activePart;
index ee748ad..ca87fd1 100644 (file)
@@ -373,8 +373,12 @@ public class SearchBar implements IContextListener{
 
     @Override
     public void contextStart(IMemento memento, IProgressMonitor monitor) {
-        text_search.setEnabled(true);
-        toolBar.setEnabled(true);
+        if(!text_search.isDisposed()){
+            text_search.setEnabled(true);
+        }
+        if(!toolBar.isDisposed()){
+            toolBar.setEnabled(true);
+        }
     }
 
     @Override
index f440f6e..73c5973 100644 (file)
@@ -65,9 +65,6 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
        private static Object[] EMPTY = new Object[0];
 
        private class ContextListener extends ContextListenerAdapter{
-               /* (non-Javadoc)
-                * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-                */
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask(Messages.SearchResultView_REMOVE_SEARCH_RESULTS);
@@ -93,14 +90,11 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
 
        private IContextListener contextListener;
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
 
-               conversation = CdmStore.createConversation();
+           conversation = getConversation_internal();
                contextListener = new ContextListener();
                CdmStore.getContextManager().addContextListener(contextListener);
 
@@ -230,21 +224,18 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                }
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
-        */
        /** {@inheritDoc} */
        @Override
        public void setFocus() {
                //logger.warn("Setting focus to search result viewer");
-               conversation.bind();
+               ConversationHolder conversation_internal = getConversation_internal();
+               if(conversation_internal!=null){
+                   conversation_internal.bind();
+               }
                // pass focus to resultViewer
                resultViewer.getControl().setFocus();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
        /**
         * <p>getConversationHolder</p>
         *
@@ -255,9 +246,6 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                return this.conversation;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-        */
        /** {@inheritDoc} */
        @Override
     public void update(CdmDataChangeMap changeEvents) {
@@ -265,20 +253,30 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
 
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.part.WorkbenchPart#dispose()
-        */
        /** {@inheritDoc} */
        @Override
        public void dispose() {
                super.dispose();
-               conversation.close();
+               if(conversation!=null){
+                   conversation.close();
+               }
                if(searchJob != null) {
             searchJob.cancel();
         }
                CdmStore.getContextManager().removeContextListener(contextListener);
        }
 
+       private ConversationHolder getConversation_internal(){
+           if(conversation==null && CdmStore.isActive()){
+               try {
+                   conversation = CdmStore.createConversation();
+            } catch (Exception e) {
+                //nothing
+            }
+           }
+           return conversation;
+       }
+
        /**
         *
         * @author n.hoffmann
@@ -300,9 +298,6 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                        this.configurator = configurator;
                }
 
-               /* (non-Javadoc)
-                * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
-                */
                @Override
                protected IStatus run(IProgressMonitor monitor) {
                        monitor.beginTask("", 100); //$NON-NLS-1$
index 351006c..7081a5d 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Printpublisher Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Require-Bundle: org.eclipse.osgi,
  org.eclipse.ui,
  eu.etaxonomy.taxeditor.cdmlib,
index bcaea1a..6c22dad 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <artifactId>taxeditor-parent</artifactId>
                <groupId>eu.etaxonomy</groupId>
-               <version>4.7.0-SNAPSHOT</version>
+               <version>4.8.0-SNAPSHOT</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index ceacc40..56a3265 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: DataStore Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 4.7.0.qualifier
+Bundle-Version: 4.8.0.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
 Bundle-Vendor: EDIT
 Bundle-Localization: OSGI-INF/l10n/bundle
@@ -72,7 +72,7 @@ Require-Bundle: org.eclipse.osgi,
  org.eclipse.core.databinding.observable,
  org.eclipse.core.databinding.property,
  org.eclipse.jface.databinding,
- org.eclipse.jdt.annotation;bundle-version="1.1.100",
  eu.etaxonomy.taxeditor.workbench,
  org.eclipse.e4.core.di.annotations;bundle-version="1.5.0",
  org.eclipse.e4.ui.di;bundle-version="1.1.100",
index a7560e5..dd326a2 100644 (file)
@@ -175,6 +175,7 @@ command.name.INSPECT_ACTIVE_SESSIONS = Inspect Active Session
 viewCommandMapping.viewerName.CLASSIFICATION_WIZARD = Classification Wizard\r
 viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxon node Wizard\r
 command.label.CHANGE_PASSWORD = Change password\r
-wizard.name.22 = Output Model\r
+wizard.name.22 = CDM light (csv)\r
 wizard.name.23 = Excel Distribution Data Update\r
+wizard.name.24 = RIS Reference\r
 command.label.25 = Import Preferences
\ No newline at end of file
index 8322930..8f2376c 100644 (file)
@@ -176,6 +176,7 @@ command.name.INSPECT_ACTIVE_SESSIONS = Aktive Session untersuchen
 viewCommandMapping.viewerName.CLASSIFICATION_WIZARD = Klassifikations-Wizard
 viewCommandMapping.viewerName.TAXON_NODE_WIZARD = Taxonknoten-Wizard
 command.label.CHANGE_PASSWORD = Kennwort ändern
-wizard.name.22 = Output Model
+wizard.name.22 = CDM light (csv)
 wizard.name.23 = Excel Verbreitungsdaten Update
+wizard.name.24 = RIS Referenzen
 command.label.25 = Import Präferenzen
\ No newline at end of file
index e55d3cb..8bb56ee 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ASCII"?>
 <fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/descriptor/basic" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_OhwnQCTfEeeiN5lBIuqN3g">
   <imports xsi:type="commands:Command" xmi:id="_bnVKsCZxEeeQLpuomSmVoQ" elementId="eu.etaxonomy.taxeditor.command.openPart"/>
-  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_xVa1wCXXEeex9MwMOgUeWw" featurename="descriptors" parentElementId="org.eclipse.e4.legacy.ide.application">
+  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_xVa1wCXXEeex9MwMOgUeWw" featurename="descriptors" parentElementId="xpath:/">
     <elements xsi:type="basic:PartDescriptor" xmi:id="_2xmxoCXXEeex9MwMOgUeWw" elementId="eu.etaxonomy.taxeditor.store.partdescriptor.sessionsView" label="%view.name.SESSIONS" closeable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_3rW8wCXaEeex9MwMOgUeWw" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:bulkeditor.menus.openmenu">
     <elements xsi:type="menu:HandledMenuItem" xmi:id="_1riRcCaHEeeTEd_pKXBflg" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.logView" toBeRendered="false" visible="false" label="%command.label.3" command="_bnVKsCZxEeeQLpuomSmVoQ">
       <parameters xmi:id="_9VpA8CaIEeeTEd_pKXBflg" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="org.eclipse.pde.runtime.LogView"/>
     </elements>
-    <elements xsi:type="menu:HandledMenuItem" xmi:id="_3DcfkCaHEeeTEd_pKXBflg" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.reporting" label="%command.label.4" command="_bnVKsCZxEeeQLpuomSmVoQ">
-      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_UrBzACaJEeeTEd_pKXBflg" coreExpressionId="isCdmStoreConnected"/>
-      <parameters xmi:id="_-z-nMCaIEeeTEd_pKXBflg" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.reporting.viewPart"/>
-    </elements>
     <elements xsi:type="menu:HandledMenuItem" xmi:id="_jFskQCZyEeeQLpuomSmVoQ" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.sessions" label="%view.name.SESSIONS" command="_bnVKsCZxEeeQLpuomSmVoQ">
       <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_W-C-gCaJEeeTEd_pKXBflg" coreExpressionId="isCdmStoreConnected"/>
       <parameters xmi:id="_BylIUCZzEeeQLpuomSmVoQ" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.store.partdescriptor.sessionsView"/>
index df19313..d8c95af 100755 (executable)
             class="eu.etaxonomy.taxeditor.io.wizard.ExcelDistributionUpdateWizard"
             id="eu.etaxonomy.taxeditor.io.import.excelDistribution"
             name="%wizard.name.23">
+          <enabledWhen>
+            <reference
+                  definitionId="isShowExperimentalFeatures">
+            </reference></enabledWhen>
+      </wizard>
+       <wizard
+            category="eu.etaxonomy.taxeditor.import.category.cdm"
+            class="eu.etaxonomy.taxeditor.io.wizard.RISImportWizard"
+            id="eu.etaxonomy.taxeditor.io.import.risImport"
+            name="%wizard.name.24">
+          
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
index 1e71164..7bc6938 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
        <groupId>eu.etaxonomy</groupId>
        <artifactId>taxeditor-parent</artifactId>
-       <version>4.7.0-SNAPSHOT</version>
+       <version>4.8.0-SNAPSHOT</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/AppModelId.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/AppModelId.java
new file mode 100644 (file)
index 0000000..ff08c36
--- /dev/null
@@ -0,0 +1,59 @@
+package eu.etaxonomy.taxeditor.editor;
+
+public class AppModelId {
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_COMMAND_OPENPART = "eu.etaxonomy.taxeditor.command.openPart";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_CONSENSUS_SEQUENCE = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_consensus_sequence";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_DNA_SAMPLE = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_dna_sample";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_EXISTING_MEDIA_SPECIMEN = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_existing_media_specimen";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_MEDIA_SPECIMEN = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_media_specimen";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_SINGLE_READ = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_single_read";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_SPECIMEN = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_specimen";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_ADD_DERIVATE_ADD_TISSUE_SAMPLE = "eu.etaxonomy.taxeditor.editor.command.add_derivate.add_tissue_sample";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_COMMAND_SPECIMENEDITOR_CREATE_FIELD_UNIT = "eu.etaxonomy.taxeditor.editor.command.specimeneditor.create_field_unit";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATE_DEEPDELETE = "eu.etaxonomy.taxeditor.editor.derivate.deepDelete";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATE_DELETE = "eu.etaxonomy.taxeditor.editor.derivate.delete";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATIVE_COPYSINGLEREADTOCLIPBOARD = "eu.etaxonomy.taxeditor.editor.derivative.copySingleReadToClipBoard";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATIVE_REMOVESINGLEREADFROMSEQUENCE = "eu.etaxonomy.taxeditor.editor.derivative.removeSingleReadFromSequence";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATIVE_REUSESINGLEREAD = "eu.etaxonomy.taxeditor.editor.derivative.reuseSingleRead";
+       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DERIVATIVE_TOGGLELINKWITHTAXONSELECTION = "eu.etaxonomy.taxeditor.editor.derivative.toggleLinkWithTaxonSelection";
+       public static final String COMMAND_ORG_ECLIPSE_UI_EDIT_DELETE = "org.eclipse.ui.edit.delete";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDLABEL52 = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel52";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDLABEL54 = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel54";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDLABELDERIVATIVE_EDITOR = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelderivative_editor";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDLABELLINK_WITH_TAXON_SELECTION = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabellink_with_taxon_selection";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDLABELREMOVE_SINGLE_READ_FROM_THIS_SEQUENCE = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelremove_single_read_from_this_sequence";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDLABELREUSE_SINGLE_READ_FOR_OTHER_SEQUENCE = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabelreuse_single_read_for_other_sequence";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_COMMANDNAMEREUSE_SINGLE_READ = "eu.etaxonomy.taxeditor.editor.handledmenuitem.commandnamereuse_single_read";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_CONSENSUSSEQUENCE = "eu.etaxonomy.taxeditor.editor.handledmenuitem.consensussequence";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_CREATEFIELDUNIT = "eu.etaxonomy.taxeditor.editor.handledmenuitem.createfieldunit";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_CREATE_FIELD_UNIT_FOR_TAXON = "eu.etaxonomy.taxeditor.editor.handledmenuitem.create_field_unit_for_taxon";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_DNASAMPLE = "eu.etaxonomy.taxeditor.editor.handledmenuitem.dnasample";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_EXISTINGMEDIA = "eu.etaxonomy.taxeditor.editor.handledmenuitem.existingmedia";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_MEDIASPECIMEN = "eu.etaxonomy.taxeditor.editor.handledmenuitem.mediaspecimen";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_SINGLEREAD = "eu.etaxonomy.taxeditor.editor.handledmenuitem.singleread";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_SPECIMEN = "eu.etaxonomy.taxeditor.editor.handledmenuitem.specimen";
+       public static final String HANDLEDMENUITEM_EU_ETAXONOMY_TAXEDITOR_EDITOR_HANDLEDMENUITEM_TISSUESAMPLE = "eu.etaxonomy.taxeditor.editor.handledmenuitem.tissuesample";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDSPECIMENHANDLER = "eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddSpecimenHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDCONSENSUSSEQUENCEHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddConsensusSequenceHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDDNASAMPLEHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddDnaSampleHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDEXISTINGMEDIAHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddExistingMediaHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDMEDIASPECIMENHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddMediaSpecimenHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDSINGLEREADHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddSingleReadHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_ADDTISSUESAMPLEHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.AddTissueSampleHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_CREATEFIELDUNITHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.CreateFieldUnitHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_DELETEDERIVATEHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_SINGLEREADHANDLER_COPYSINGLEREAD = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler.copySingleRead";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_SINGLEREADHANDLER_REMOVESINGLEREAD = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler.removeSingleRead";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_SINGLEREADHANDLER_REUSESINGLEREAD = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.SingleReadHandler.reuseSingleRead";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_HANDLER_TOGGLELINKWITHTAXONSELECTIONHANDLER = "eu.etaxonomy.taxeditor.editor.view.derivate.handler.ToggleLinkWithTaxonSelectionHandler";
+       public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENUSEPARATOR_0 = "eu.etaxonomy.taxeditor.editor.menuseparator.0";
+       public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENUSEPARATOR_1 = "eu.etaxonomy.taxeditor.editor.menuseparator.1";
+       public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENUSEPARATOR_2 = "eu.etaxonomy.taxeditor.editor.menuseparator.2";
+       public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENUSEPARATOR_3 = "eu.etaxonomy.taxeditor.editor.menuseparator.3";
+       public static final String MENUSEPARATOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENUSEPARATOR_4 = "eu.etaxonomy.taxeditor.editor.menuseparator.4";
+       public static final String MENU_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENU_ADD = "eu.etaxonomy.taxeditor.editor.menu.add";
+       public static final String MENU_EU_ETAXONOMY_TAXEDITOR_EDITOR_MENU_SPECIMEN_EDITOR_MEDIA = "eu.etaxonomy.taxeditor.editor.menu.specimen_editor.media";
+       public static final String PARAMETER_EU_ETAXONOMY_TAXEDITOR_EDITOR_OPENPART_PARAMETER_SPECIMENEDITOR = "eu.etaxonomy.taxeditor.editor.openPart.parameter.specimenEditor";
+       public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW = "eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView";
+       public static final String POPUPMENU_EU_ETAXONOMY_TAXEDITOR_EDITOR_POPUPMENU_SPECIMENEDITOR = "eu.etaxonomy.taxeditor.editor.popupmenu.specimeneditor";
+}
\ No newline at end of file
index 08bcce2..4c2a956 100644 (file)
@@ -138,6 +138,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
 \r
                Control control = viewer.getControl();\r
                Menu menu = menuManager.createContextMenu(control);\r
+               menuManager.setRemoveAllWhenShown(true);\r
                control.setMenu(menu);\r
        }\r
 \r
index 7e82287..ff305fe 100644 (file)
@@ -73,7 +73,7 @@ public class TermEditorInput extends AbstractDefinedTermEditorInput<DefinedTerm>
                if(vocabularies != null) {
                        vocabularies.clear();
                }
-               List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(termType);
+               List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(termType, null);
                vocabularies.addAll(vocs);
        }
 
index 523addd..506d96b 100644 (file)
@@ -29,7 +29,7 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
        protected ICdmRepository applicationConfiguration;
 
        public static enum TYPE {
-               Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution
+               Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution, Ris
        }
 
        /**
index 9918b79..be72cfc 100644 (file)
@@ -35,6 +35,7 @@ import eu.etaxonomy.cdm.io.common.ExportResultType;
 import eu.etaxonomy.cdm.io.common.IExportConfigurator;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.cdm.io.common.IoResultBase;
+import eu.etaxonomy.cdm.io.common.IoResultBase.IoInfo;
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.outputmodel.OutputModelConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
@@ -324,19 +325,19 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                      }
                      final StringBuilder reportText = new StringBuilder();
                      if(result!=null){
-                         List<IoResultBase.Error> reports = result.getErrors();
+                         List<IoInfo> reports = result.getErrors();
                          reportText.append("Errors:\\r");
-                         for (IoResultBase.Error bs : reports) {
+                         for (IoInfo bs : reports) {
                              reportText.append(bs.getMessage() + " - " +bs.getException().getStackTrace());
                          }
-                         List<String> warnings = result.getWarnings();
+                         List<IoResultBase.IoInfo> warnings = result.getWarnings();
                          reportText.append("Warnings:\\r");
-                         for (String bs : warnings) {
+                         for (IoResultBase.IoInfo bs : warnings) {
                              reportText.append(bs);
                          }
-                         List<IoResultBase.Error> exceptions = result.getExceptions();
+                         List<IoInfo> exceptions = result.getExceptions();
                          reportText.append("Exceptions:\\r");
-                         for (IoResultBase.Error bs : exceptions) {
+                         for (IoInfo bs : exceptions) {
                              reportText.append(bs.getMessage() + " - " +bs.getException().getStackTrace());
                          }
 
index ae75c28..0a8856e 100644 (file)
@@ -18,6 +18,7 @@ import java.util.List;
 import java.util.UUID;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -205,7 +206,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                 monitor.beginTask("Importing data", IProgressMonitor.UNKNOWN);
                 IIOService ioService = CdmApplicationState.getIOService();
 
-                ioService.importData(configurator, data, type);
+                ImportResult result = ioService.importData(configurator, data, type);
 
                 monitor.done();
 
@@ -216,7 +217,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                         CdmStore.getContextManager().notifyContextRefresh();
                     }
                 });
-
+