eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF -text
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties -text
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties -text
-eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties -text
eu.etaxonomy.taxeditor.application/about.mappings -text
eu.etaxonomy.taxeditor.application/build.properties -text
eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif -text
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF -text
eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle.properties -text
eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_de.properties -text
-eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/bundle_en.properties -text
+eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/messages.properties -text
+eu.etaxonomy.taxeditor.bulkeditor/OSGI-INF/l10n/messages_de.properties -text
eu.etaxonomy.taxeditor.bulkeditor/build.properties -text
eu.etaxonomy.taxeditor.bulkeditor/icons/merge_candidate.gif -text
eu.etaxonomy.taxeditor.bulkeditor/icons/merge_target.gif -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorViewerConfiguration.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/IBulkEditorConstants.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/IBulkEditorSortProvider.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/PropertyTester.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorMenuPropertyTester.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorPropertyTester.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DeleteObjectContributionItem.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicMarkerTypeEditingMenu.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertTeam2PersonHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/MergeGroupHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/OpenBulkEditorHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputType.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/GroupEditorInput.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/Messages.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameRelationshipEditorInput.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/OccurrenceEditorInput.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/CdmDataTransfer.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/ChooseFromMultipleTaxonNodesDialog.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorCdmViewer.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorStateManager.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/IDropTargetable.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteAllEmptyNamesHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/GroupBasionymContributionItem.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/MoveSynonymToAnotherAcceptedTaxonHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/RemoveBasionymHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/SetBasionymHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientReferenceService.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTaxonService.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTermService.java -text
-eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateContentProvider.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDragListener.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDropListener.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java -text
eu.etaxonomy.taxeditor.feature.platform/pom.xml -text
eu.etaxonomy.taxeditor.feature/.project -text
eu.etaxonomy.taxeditor.feature/LICENSE.TXT -text
+eu.etaxonomy.taxeditor.feature/README.txt -text
eu.etaxonomy.taxeditor.feature/build.properties -text
+eu.etaxonomy.taxeditor.feature/build.properties.with.jre -text
eu.etaxonomy.taxeditor.feature/feature.xml -text
eu.etaxonomy.taxeditor.feature/pom.xml -text
eu.etaxonomy.taxeditor.help/.classpath -text
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF -text
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties -text
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties -text
-eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_en.properties -text
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties -text
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties -text
-eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_en.properties -text
eu.etaxonomy.taxeditor.navigation/build.properties -text
eu.etaxonomy.taxeditor.navigation/icons/check.png -text
eu.etaxonomy.taxeditor.navigation/icons/edit_16x16.gif -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/dnd/TaxonNavigatorDragAdapterAssistant.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/ChangeAcceptedTaxonToSynonymHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CopyHandler.java -text
+eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CreateClassificationHierarchyHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveFactualDataHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/EditClassificationOperation.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/MoveTaxonOperation.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateClassification.java -text
+eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateNewTaxonHierarchyOperation.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreatePolytomousKey.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateTaxonNode.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/Messages.java -text
eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF -text
eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle.properties -text
eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_de.properties -text
-eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_en.properties -text
eu.etaxonomy.taxeditor.printpublisher/build.properties -text
eu.etaxonomy.taxeditor.printpublisher/p2.inf -text
eu.etaxonomy.taxeditor.printpublisher/plugin.xml -text
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF -text
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties -text
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties -text
-eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_en.properties -text
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties -text
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties -text
-eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_en.properties -text
eu.etaxonomy.taxeditor.store/build.properties -text
eu.etaxonomy.taxeditor.store/icons/256color_16x16.bmp -text
eu.etaxonomy.taxeditor.store/icons/256color_32x32.bmp -text
eu.etaxonomy.taxeditor.store/icons/amplification_derivate-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/applications-office.png -text
eu.etaxonomy.taxeditor.store/icons/artwork_derivate-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/artwork_derivate_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/autonym_no_bg.gif -text
eu.etaxonomy.taxeditor.store/icons/back.gif -text
eu.etaxonomy.taxeditor.store/icons/basionym.gif -text
eu.etaxonomy.taxeditor.store/icons/delete_edit.gif -text
eu.etaxonomy.taxeditor.store/icons/derivate_search_view-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/detail_image_derivate-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/detail_image_derivate_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/dna_derivate-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/dna_derivate_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/eclipse.gif -text
eu.etaxonomy.taxeditor.store/icons/edit_16x16.gif -text
eu.etaxonomy.taxeditor.store/icons/edit_16x16.ico -text
eu.etaxonomy.taxeditor.store/icons/expandAll.jpg -text
eu.etaxonomy.taxeditor.store/icons/export.gif -text
eu.etaxonomy.taxeditor.store/icons/fieldunit-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/fieldunit_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/file_obj.gif -text
eu.etaxonomy.taxeditor.store/icons/filter.gif -text
eu.etaxonomy.taxeditor.store/icons/flat.gif -text
eu.etaxonomy.taxeditor.store/icons/leaf_detail.png -text
eu.etaxonomy.taxeditor.store/icons/linkto_help.gif -text
eu.etaxonomy.taxeditor.store/icons/living_plant_photo_derivate-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/living_plant_photo_derivate_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/lock.png -text
eu.etaxonomy.taxeditor.store/icons/lock_open.png -text
eu.etaxonomy.taxeditor.store/icons/lockedstate.gif -text
eu.etaxonomy.taxeditor.store/icons/smartmode_co.gif -text
eu.etaxonomy.taxeditor.store/icons/sort.gif -text
eu.etaxonomy.taxeditor.store/icons/specimen_derivate-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/specimen_derivate_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/specimen_scan_derivate-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/specimen_scan_derivate_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/step_done.gif -text
eu.etaxonomy.taxeditor.store/icons/swap.gif -text
eu.etaxonomy.taxeditor.store/icons/swap2.gif -text
eu.etaxonomy.taxeditor.store/icons/thin_max_view.gif -text
eu.etaxonomy.taxeditor.store/icons/thin_restore_view.GIF -text
eu.etaxonomy.taxeditor.store/icons/tissue_sample-16x16-32.png -text
+eu.etaxonomy.taxeditor.store/icons/tissue_sample_data-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/trash.gif -text
eu.etaxonomy.taxeditor.store/icons/tree_icon_small.jpg -text
eu.etaxonomy.taxeditor.store/icons/undo.gif -text
eu.etaxonomy.taxeditor.store/p2.inf -text
eu.etaxonomy.taxeditor.store/plugin.xml -text
eu.etaxonomy.taxeditor.store/pom.xml -text
+eu.etaxonomy.taxeditor.store/schema/eu.etaxonomy.taxeditor.store.cdmViewer.exsd -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/CdmDataSourceRepository.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceCredentialsWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceH2WizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/CdmAuthorityTableDropTargetListener.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/transfer/TaxonNodeTransfer.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ISecuredEditor.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/UsageTermCollection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractImportWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ClassificationChooserWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvExportWizard.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvNameExportWizard.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvPrintExportWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/DarwinCoreArchiveExportWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPostOperationEnabled.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmPreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmStorePropertyTester.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DefaultFeatureTreePreferenecs.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DescriptionPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MediaPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MobotOpenUrlPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NomenclaturalCodePreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/OrderPreferences.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Resources.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/StoreUtil.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermManager.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermStore.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/UsageTermCollection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/UseObjectStore.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/internal/TaxeditorStorePlugin.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/VocabularyComboElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/DefaultLanguageDialog.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/DeleteConfiguratorComposite.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/DeleteConfiguratorDialog.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/DeleteTaxonConfiguratorDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/UriDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteConfiguratorComposite.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteConfiguratorDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteSpecimenConfiguratorComposite.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteTaxonConfiguratorComposite.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmEnumSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AgentSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationTypeSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonBaseSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionNaturalOrderDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TeamSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/UserSelectionDialog.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmEntityWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/AbstractCdmComposite.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/DerivedUnitGeneralDetailElementMVC.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/GeographicPointElement.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/combo/EnumTermCombo.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/combo/EnumTermComboController.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateModifierElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/AbstractDetailedDescriptionDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupSelectionElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/GeographicalScopeDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/identifier/IdentifierDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/identifier/IdentifierDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseWizardPage.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/IDerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/NamedAreaDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OriginalLabelDataSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenHierarchyDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenHierarchyDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenAbstractDeterminationEventDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/FeatureDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/MeasurementUnitCollectionElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/MeasurementUnitCollectionSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaLevelDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateModifierCollectionSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StatisticalMeasureCollectionElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StatisticalMeasureCollectionSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmViewPart.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractSplitableViewPart.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerChooser.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/ICdmViewer.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceContentProvider.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceLabelProvider.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewerComparator.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmMetaDataAwareDataSourceContainer.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/Messages.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/AbstractDataSourceHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/CloneDataSourceHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DeleteDataSourceHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/EditDataSourceHandler.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/UpdateDataSourceHandler.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateContentProvider.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateLabelProvider.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchComposite.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchCompositeController.java -text
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/ui/selection/TaxonSelectionElementTest.java -text
eu.etaxonomy.taxeditor/.classpath -text
eu.etaxonomy.taxeditor/.project -text
+eu.etaxonomy.taxeditor/README.txt -text
eu.etaxonomy.taxeditor/deploy_nightly.sh -text
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product -text
eu.etaxonomy.taxeditor/plugin_customization.ini -text
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/resources/"/>
+ <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Bundle-ManifestVersion: 2
Bundle-Name: Application
Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
Bundle-Vendor: EDIT
Bundle-Localization: OSGI-INF/l10n/plugin
perspective.name = Taxonomic\r
perspective.name.0 = Polytomous Key\r
perspective.name.1 = Uses\r
-perspective.name.2 = Derivates\r
+perspective.name.2 = Derivatives\r
menu.label = General\r
menu.label.0 = Edit\r
menu.label.1 = Window\r
the License.
extension.name = Taxonomischer Editor
perspective.name = Taxonomisch
-perspective.name.0 = Polytomer Key
-perspective.name.1 = Anwendungen
+perspective.name.0 = Polytomer Schlüssel
+perspective.name.1 = Nutzung
perspective.name.2 = Derivate
menu.label = Datei
menu.label.0 = Bearbeiten
+++ /dev/null
-productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: {0}\nBuild Date: {1} CET\n\n\\r
-Copyright (C) 2009-2014 EDIT\n\European Distributed Institute of Taxonomy \n\\r
-http://cybertaxonomy.eu/ \n\n\\r
-The contents of this product are subject to the Mozilla Public License Version 1.1 \n\\r
-you may not use this product except in compliance with the License. \n\\r
-You may obtain a copy of the License at http://www.mozilla.org/MPL/ \n\\r
-Software distributed under the License is distributed on an 'AS IS' basis, \n\\r
-WITHOUT WARRANTY OF ANY KIND, either express or implied. \n\\r
-See the License for the specific language governing rights and limitations under \n\\r
-the License.\r
-extension.name = Taxonomic Editor\r
-perspective.name = Taxonomic\r
-perspective.name.0 = Polytomous Key\r
-perspective.name.1 = Uses\r
-perspective.name.2 = Derivates\r
-menu.label = General\r
-menu.label.0 = Edit\r
-menu.label.1 = Window\r
-menu.label.2 = Help\r
-menu.label.3 = New\r
-command.label = Close\r
-command.label.0 = Close All\r
-command.label.1 = Save\r
-command.label.2 = Save All\r
-command.label.3 = Import...\r
-command.label.4 = Export...\r
-command.label.5 = Exit\r
-command.label.6 = Undo\r
-command.label.7 = Redo\r
-command.label.8 = Cut\r
-command.label.9 = Copy\r
-command.label.10 = Paste\r
-command.label.11 = Delete\r
-command.label.12 = Preferences\r
-command.label.13 = Help Contents\r
-command.label.14 = Search\r
-command.label.15 = Dynamic Help\r
-command.label.16 = Parser Help Website\r
-command.label.17 = Check for Updates\r
-command.label.18 = Install New Software...\r
-command.label.19 = About Taxonomic Editor\r
-command.label.20 = About the EDIT Platform\r
-command.label.21 = New\r
-command.label.22 = Save\r
-product.name = EDIT Taxonomic Editor\r
-command.name = Parser Help\r
-command.name.0 = About the EDIT Platform\r
-activity.description = Disable unwanted eclipse UI\r
-activity.name = Disable\r
-product.name.0 = EDIT Taxonomic Editor
\ No newline at end of file
icons/,\
OSGI-INF/l10n/plugin.properties,\
OSGI-INF/l10n/plugin_de.properties,\
- OSGI-INF/l10n/plugin_en.properties,\
splash.bmp,\
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
// this is a stable version
return version;
} else {
- return BETA_PREFIX + " " + version;
+ return BETA_PREFIX + " " + version + " UTC";
}
}
// leading to a recursive infinite loop of :
// initial exception thrown -> status handling -> dialog opening + logging of status ->
// status handling -> dialog opening + logging of status ... and so on
- if(t != null && t instanceof RuntimeException && !t.getMessage().equals("Widget is disposed")) {
+ if(t != null && t instanceof RuntimeException && ! "Widget is disposed".equals(t.getMessage())){
MessagingUtils.errorDialog("Unexpected error",
null,
MessagingUtils.UNEXPECTED_ERROR_MESSAGE,
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
Bundle-ManifestVersion: 2
Bundle-Name: Bulkeditor Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
menu.label.2 = Set Marker Type
view.name = Referencing Objects
page.name = Marker Types
-page.name.0 = Bulk Editor
\ No newline at end of file
+page.name.0 = Bulk Editor
+command.label = Open in taxon editor
+command.label.0 = Set Current Line as Target for Duplicate Removal
+command.label.1 = Set as Candidate(s) for Duplicate Removal
+command.label.2 = Remove as Candidate(s) for Duplicate Removal
+command.label.3 = De-Duplicate Group
+command.label.4 = Delete
+command.label.5 = Convert Team to Person
+command.name = Merge Group
+command.name.0 = Set as Target for Group Merge
+command.name.1 = Dynamic Open Bulk Editor
+commandParameter.name = Bulk Editor Class
+command.name.2 = Dynamic New Object
+command.name.3 = Dynamic Delete Object
+command.name.4 = Set as Candidate for Group Merge
+command.name.5 = Remove as Candidate for Group Merge
+command.name.6 = Set Marker Flag
+command.name.7 = delete
+command.name.8 = convert Team to Person
+command.name.9 = convert Person to Team
+specification.label = Merge Candidate Annotation
+specification.label.0 = Merge Target Annotation
+command.label.6 = Convert Person to Team
+command.name.10 = convert Person to Team
\ No newline at end of file
#Properties file for eu.etaxonomy.taxeditor.bulkeditor
editor.name = Bulk Editor
-editor.name.0 = Namen Editor
+editor.name.0 = Namens Editor
editor.name.1 = Daten-Import Editor
menu.label = Bulk Editor
menu.label.0 = Suche Specimen
menu.label.2 = W\u00e4hle Markertyp
view.name = Referenzierende Objekte
page.name = Markertyp
-page.name.0 = Bulk Editor
\ No newline at end of file
+page.name.0 = Bulk Editor
+command.label = Im Taxon-Editor \u00D6ffnen
+command.label.0 = Markiere Zeile als Ziel f\u00fcr Duplikatenentfernung
+command.label.1 = Markiere als Kandidat(en) f\u00fcr Duplikatenentfernung
+command.label.2 = Entferne Kandidat f\u00fcr Duplikatenentfernung
+command.label.3 = Dedupliziere Gruppe
+command.label.4 = L\u00f6schen
\ No newline at end of file
+++ /dev/null
-#Properties file for eu.etaxonomy.taxeditor.bulkeditor
-editor.name = Bulk Editor
-editor.name.0 = Name Editor
-editor.name.1 = Data Import Editor
-menu.label = Bulk Editor
-menu.label.0 = Search Specimen
-menu.label.1 = New
-menu.label.2 = Set Marker Type
-view.name = Referencing Objects
-page.name = Marker Types
-page.name.0 = Bulk Editor
\ No newline at end of file
--- /dev/null
+BulkEditorInputType_0=Person and Team\r
+BulkEditorInputType_1=Reference\r
+BulkEditorInputType_2=Name\r
+BulkEditorInputType_3=Name Relationship\r
+BulkEditorInputType_4=Specimen and Observation\r
+BulkEditorInputType_5=User\r
+BulkEditorInputType_6=Group\r
+BulkEditorInputType_7=Taxon\r
--- /dev/null
+BulkEditorInputType_0=Person und Team \r
+BulkEditorInputType_1=Referenz\r
+BulkEditorInputType_2=Name\r
+BulkEditorInputType_3=Namensbeziehung\r
+BulkEditorInputType_4=Beleg und Beobachtung\r
+BulkEditorInputType_5=Nutzer\r
+BulkEditorInputType_6=Nutzergruppe\r
+BulkEditorInputType_7=Taxon\r
icons/,\\r
plugin.xml,\\r
p2.inf,\\r
- OSGI-INF/l10n/bundle.properties\r
+ OSGI-INF/l10n/bundle.properties,\\r
+ OSGI-INF/l10n/bundle_de.properties,\\r
+ OSGI-INF/l10n/messages.properties,\\r
+ OSGI-INF/l10n/messages_de.properties\r
+
\ No newline at end of file
</menuContribution>\r
<menuContribution\r
locationURI="popup:#BulkEditorContext">\r
+ <command\r
+ commandId="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"\r
+ label="%command.label"\r
+ style="push">\r
+ <visibleWhen>\r
+ <reference\r
+ definitionId="isTaxonBulkEditorInput">\r
+ </reference>\r
+ </visibleWhen>\r
+ </command>\r
+ <separator\r
+ name="taxeditor-bulkeditor.separator1"\r
+ visible="true">\r
+ </separator>\r
<menu\r
label="%menu.label.1">\r
<dynamic\r
</visibleWhen>\r
</menu>\r
<separator\r
- name="taxeditor-bulkeditor.separator1"\r
- visible="true">\r
+ name="eu.etaxonomy.taxeditor.bulkeditor.separator1">\r
</separator>\r
<command\r
commandId="bulkeditor.commands.setmergetarget"\r
- label="Set Current Line as Target for Duplicate Removal"\r
+ label="%command.label.0"\r
style="push">\r
<visibleWhen>\r
<reference\r
</reference>\r
</visibleWhen>\r
</command>\r
+ \r
<command\r
commandId="bulkeditor.commands.setmergecandidate"\r
- label="Set as Candidate(s) for Duplicate Removal"\r
+ label="%command.label.1"\r
style="push">\r
<visibleWhen>\r
<reference\r
</command>\r
<command\r
commandId="bulkeditor.commands.removemergecandidate"\r
- label="Remove as Candidate(s) for Duplicate Removal"\r
+ label="%command.label.2"\r
style="push">\r
<visibleWhen>\r
<reference\r
locationURI="popup:org.eclipse.ui.popup.any"--> \r
<command\r
commandId="bulkeditor.commands.mergegroup"\r
- label="De-Duplicate Group"\r
+ label="%command.label.3"\r
style="push">\r
<visibleWhen>\r
<reference\r
</reference>\r
</visibleWhen>\r
</command>\r
+ <command\r
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person"\r
+ label="%command.label.5"\r
+ style="push">\r
+ <visibleWhen\r
+ checkEnabled="true">\r
+ <and>\r
+ <reference\r
+ definitionId="isConvertEnabled">\r
+ </reference>\r
+ <reference \r
+ definitionId="isTeam">\r
+ </reference>\r
+ </and>\r
+ </visibleWhen>\r
+ </command>\r
+ <command\r
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team"\r
+ label="%command.label.6"\r
+ style="push">\r
+ <visibleWhen \r
+ checkEnabled="true">>\r
+ <and>\r
+ <reference\r
+ definitionId="isConvertEnabled">\r
+ </reference>\r
+ <reference \r
+ definitionId="isPerson">\r
+ </reference>\r
+ </and>\r
+ </visibleWhen>\r
+ </command>\r
<separator\r
name="taxeditor-bulkeditor.separator2"\r
visible="true">\r
</separator>\r
<command\r
commandId="eu.etaxonomy.taxeditor.bulkeditor.delete"\r
- label="Delete"\r
+ label="%command.label.4"\r
style="push">\r
<visibleWhen\r
checkEnabled="true">\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.MergeGroupHandler"\r
id="bulkeditor.commands.mergegroup"\r
- name="Merge Group">\r
+ name="%command.name">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMergeTargetHandler"\r
id="bulkeditor.commands.setmergetarget"\r
- name="Set as Target for Group Merge">\r
+ name="%command.name.0">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.OpenBulkEditorHandler"\r
id="taxeditor-bulkeditor.dynamicopenmenu"\r
- name="Dynamic Open Bulk Editor">\r
+ name="%command.name.1">\r
<commandParameter\r
id="taxeditor-bulkeditor.commandParameter.inputType"\r
- name="Bulk Editor Class"\r
+ name="%commandParameter.name"\r
values="eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues">\r
</commandParameter>\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.annotatedlineeditor.handler.NewObjectHandler"\r
id="taxeditor-bulkeditor.dynamicnewobjectcommand"\r
- name="Dynamic New Object">\r
+ name="%command.name.2">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.annotatedlineeditor.handler.DeleteObjectHandler"\r
id="taxeditor-bulkeditor.dynamicdeleteobjectcommand"\r
- name="Dynamic Delete Object">\r
+ name="%command.name.3">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMergeCandidateHandler"\r
id="bulkeditor.commands.setmergecandidate"\r
- name="Set as Candidate for Group Merge">\r
+ name="%command.name.4">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.RemoveMergeCandidateHandler"\r
id="bulkeditor.commands.removemergecandidate"\r
- name="Remove as Candidate for Group Merge">\r
+ name="%command.name.5">\r
</command>\r
<command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"\r
id="taxeditor-bulkeditor.command.setMarkerFlag"\r
- name="Set Marker Flag">\r
+ name="%command.name.6">\r
</command>\r
<command\r
id="eu.etaxonomy.taxeditor.bulkeditor.delete"\r
- name="delete">\r
+ name="%command.name.7">\r
+ </command>\r
+ <command\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person"\r
+ name="%command.name.8">\r
+ </command>\r
+ <command\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team"\r
+ name="%command.name.10">\r
</command>\r
<!--command\r
defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler"\r
highlightPreferenceValue="true"\r
icon="icons/merge_candidate.gif"\r
includeOnPreferencePage="true"\r
- label="Merge Candidate Annotation"\r
+ label="%specification.label"\r
overviewRulerPreferenceKey="merge_candidate_annotation_overview"\r
overviewRulerPreferenceValue="true"\r
presentationLayer="0"\r
highlightPreferenceValue="true"\r
icon="icons/merge_target.gif"\r
includeOnPreferencePage="true"\r
- label="Merge Target Annotation"\r
+ label="%specification.label.0"\r
overviewRulerPreferenceKey="merge_target_annotation_overview"\r
overviewRulerPreferenceValue="true"\r
presentationLayer="1"\r
</test>\r
</with>\r
</definition>\r
+ <definition\r
+ id="isConvertEnabled">\r
+ <with\r
+ variable="activeEditor">\r
+ <test\r
+ property="taxeditor-bulkeditor.propertyTester.isConvertingEnabled">\r
+ </test>\r
+ </with>\r
+ </definition>\r
+ <definition\r
+ id="isTaxonBulkEditorInput">\r
+ <with\r
+ variable="activeEditor">\r
+ <test\r
+ property="taxeditor-bulkeditor.propertyTester.isTaxonEditor">\r
+ </test>\r
+ </with>\r
+ </definition>\r
+ <definition\r
+ id="isTeam">\r
+ <with\r
+ variable="selection">\r
+ <test\r
+ property="eu.etaxonomy.taxeditor.bulkeditor.command.isTeam">\r
+ </test>\r
+ </with>\r
+ </definition>\r
+ <definition\r
+ id="isPerson">\r
+ <with\r
+ variable="selection">\r
+ <test\r
+ property="eu.etaxonomy.taxeditor.bulkeditor.command.isPerson">\r
+ </test>\r
+ </with>\r
+ </definition>\r
</extension>\r
<extension\r
point="org.eclipse.core.expressions.propertyTesters">\r
class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"\r
id="taxeditor-bulkeditor.PropertyTester"\r
namespace="taxeditor-bulkeditor.propertyTester"\r
- properties="isMergingEnabled"\r
+ properties="isMergingEnabled, isDerivedUnitEditor, isTaxonEditor, isGroupEditor, isConvertingEnabled"\r
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
</propertyTester>\r
<propertyTester\r
- class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
- id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- properties="isDerivedUnitEditor"\r
- type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
+ class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorMenuPropertyTester"\r
+ id="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorMenuPropertyTester"\r
+ namespace="eu.etaxonomy.taxeditor.bulkeditor.command"\r
+ properties="isTeam, isPerson"\r
+ type="java.lang.Object">\r
</propertyTester>\r
</extension>\r
<extension\r
</with>\r
</activeWhen>\r
</handler>\r
+ <handler\r
+ class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertTeam2PersonHandler"\r
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.convertTeam2Person">\r
+ </handler>\r
+ <handler\r
+ class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertPerson2TeamHandler"\r
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team">\r
+ </handler>\r
+ \r
</extension>\r
<extension\r
point="org.eclipse.ui.preferencePages">\r
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@Override
public void doSave(IProgressMonitor progressMonitor) {
isDirty = false;
- IViewPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .findView("eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects");
- if (part != null){
- ((ReferencingObjectsView)part).dispose();
- }
+
super.doSave(progressMonitor);
selectFirstItem();
- if (part != null){
- ((ReferencingObjectsView)part).refresh();
-
- }
+
getSourceViewer().getTextWidget().setFocus();
}
+++ /dev/null
-
-package eu.etaxonomy.taxeditor.bulkeditor;
-
-import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
-
-public class PropertyTester extends org.eclipse.core.expressions.PropertyTester {
-
- public static final String IS_DERIVED_UNIT_EDITOR = "isDerivedUnitEditor";
-
- @Override
- public boolean test(Object receiver, String property, Object[] args,
- Object expectedValue) {
-
- BulkEditor editor = (BulkEditor) receiver;
-
- if(IS_DERIVED_UNIT_EDITOR.equals(property)){
- return editor.getEditorInput() instanceof OccurrenceEditorInput;
- }
-
- return false;
- }
-
-}
--- /dev/null
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.bulkeditor.command;\r
+\r
+import org.eclipse.core.expressions.PropertyTester;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+\r
+import eu.etaxonomy.cdm.model.agent.Person;\r
+import eu.etaxonomy.cdm.model.agent.Team;\r
+\r
+/**\r
+ * @author k.luther\r
+ * @date 13.05.2015\r
+ *\r
+ */\r
+public class BulkEditorMenuPropertyTester extends PropertyTester {\r
+\r
+\r
+ private static final String IS_TEAM = "isTeam";\r
+ private static final String IS_PERSON = "isPerson";\r
+ \r
+ public BulkEditorMenuPropertyTester(){\r
+ }\r
+ /**\r
+ * {@inheritDoc}\r
+ */\r
+ @Override\r
+ public boolean test(Object receiver, String property, Object[] args,\r
+ Object expectedValue) {\r
+ if(receiver instanceof IStructuredSelection){\r
+ IStructuredSelection selection = (IStructuredSelection) receiver;\r
+ Object selectedElement = selection.getFirstElement();\r
+ if (property.equals(IS_PERSON) && selectedElement instanceof Person){\r
+ return true;\r
+ } \r
+ if (property.equals(IS_TEAM) && selectedElement instanceof Team){\r
+ return true;\r
+ }\r
+ return false;\r
+ \r
+ }\r
+ return false;\r
+ }\r
+\r
+}\r
// $Id$
/**
* 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.
*/
import org.apache.log4j.Logger;
import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
-import eu.etaxonomy.cdm.model.common.Group;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
-import eu.etaxonomy.taxeditor.ui.section.description.DerivedUnitElement;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
/**
* <p>BulkEditorPropertyTester class.</p>
* @version 1.0
*/
public class BulkEditorPropertyTester extends PropertyTester {
- private static final Logger logger = Logger
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = Logger
.getLogger(BulkEditorPropertyTester.class);
- private static final String GROUP = "isGroup";
- private static final String DERIVEDUNIT = "isDerivedUnit";
+ private static final String IS_MERGING_ENABLED = "isMergingEnabled";
+
+ public static final String IS_GROUP_EDITOR = "isGroupEditor";
+ public static final String IS_DERIVED_UNIT_EDITOR = "isDerivedUnitEditor";
+ public static final String IS_TAXON_EDITOR = "isTaxonEditor";
+ public static final String IS_CONVERT_ENABLED = "isConvertingEnabled";
+ public static final String IS_PERSON = "isPerson";
+ public static final String IS_TEAM = "isTeam";
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean test(Object receiver, String property, Object[] args,
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
- BulkEditor bulkEditor = (BulkEditor) receiver;
-
- if ("isMergingEnabled".equals(property)) {
+ BulkEditor bulkEditor = null;
+
+
+ bulkEditor = (BulkEditor) receiver;
+ if (IS_MERGING_ENABLED.equals(property)) {
IEditorInput input = bulkEditor.getEditorInput();
if (input instanceof AbstractBulkEditorInput) {
- return ((AbstractBulkEditorInput) input).isMergingEnabled();
- }
+ return ((AbstractBulkEditorInput<?>) input).isMergingEnabled();
+ }
}
- if(GROUP.equals(property)){
- return isGroup(bulkEditor);
+ if (IS_CONVERT_ENABLED.equals(property)) {
+ IEditorInput input = bulkEditor.getEditorInput();
+ if (input instanceof AbstractBulkEditorInput) {
+ return ((AbstractBulkEditorInput<?>) input).isConvertingEnabled();
+ }
}
-
- if (DERIVEDUNIT.equals(property)){
-
- return isDerivedUnit(bulkEditor);
+ else if(IS_GROUP_EDITOR.equals(property)){
+ return bulkEditor.getEditorInput() instanceof GroupEditorInput;
}
+ else if (IS_DERIVED_UNIT_EDITOR.equals(property)){
+ return bulkEditor.getEditorInput() instanceof OccurrenceEditorInput;
+ }
+ else if(IS_TAXON_EDITOR.equals(property)){
+ return bulkEditor.getEditorInput() instanceof TaxonEditorInput;
+ }
+
// if (("isPublishFlagEditingEnabled").equals(property)) {
// IEditorInput input = bulkEditor.getEditorInput();
// if (input instanceof NameEditorInput) {
// }
return false;
}
-
- private boolean isDerivedUnit(BulkEditor bulkEditor) {
- IEditorInput input = bulkEditor.getEditorInput();
- return (input instanceof OccurrenceEditorInput) ? true : false;
- }
-
- private boolean isGroup(BulkEditor bulkEditor) {
- IEditorInput input = bulkEditor.getEditorInput();
- return (input instanceof GroupEditorInput) ? true : false;
- }
}
--- /dev/null
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.bulkeditor.handler;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.ui.IEditorInput;\r
+import org.eclipse.ui.IEditorPart;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+import org.eclipse.ui.texteditor.IDocumentProvider;\r
+\r
+import eu.etaxonomy.cdm.api.service.IAgentService;\r
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
+import eu.etaxonomy.cdm.model.agent.Person;\r
+import eu.etaxonomy.cdm.model.agent.Team;\r
+import eu.etaxonomy.cdm.strategy.merge.MergeException;\r
+import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;\r
+import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;\r
+import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;\r
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+/**\r
+ * @author k.luther\r
+ * @date 12.05.2015\r
+ *\r
+ */\r
+public class ConvertPerson2TeamHandler extends AbstractHandler {\r
+\r
+ /**\r
+ * {@inheritDoc}\r
+ */\r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ ISelection selection = HandlerUtil.getCurrentSelection(event);\r
+ \r
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);\r
+ \r
+ IEditorInput input = editor.getEditorInput();\r
+ if (editor.isDirty()){\r
+ boolean proceed = MessageDialog.openQuestion(null,\r
+ "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");\r
+ if (proceed) {\r
+ editor.doSave(null);\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+ if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){\r
+ \r
+ \r
+ IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();\r
+ LineAnnotationModel model = \r
+ (LineAnnotationModel) provider.getAnnotationModel(input);\r
+ \r
+ \r
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;\r
+ \r
+ IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;\r
+ \r
+ Team team ;\r
+ for(Object object : structuredSelection.toList()){\r
+ LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);\r
+ team = null;\r
+ if (object instanceof Person){\r
+ Person person = HibernateProxyHelper.deproxy(object, Person.class);\r
+ try {\r
+ team = CdmStore.getService(IAgentService.class).convertPerson2Team(person);\r
+ } catch (IllegalArgumentException e) {\r
+ MessagingUtils.informationDialog("Can not convert Team to Person", e.getMessage());\r
+ } catch (MergeException e) {\r
+ MessagingUtils.informationDialog("Can not convert Team to Person", e.getMessage());\r
+ }\r
+ }else{\r
+ MessagingUtils.informationDialog("Can not convert Team to Person", "convertTeam2Person can only be called on a team.");\r
+ }\r
+ \r
+ if (team != null){\r
+ ((BulkEditor) editor).removeAnnotatedLine(annotation);\r
+ ((BulkEditor) editor).createAnnotatedLine(team);\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.bulkeditor.handler;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.ui.IEditorInput;\r
+import org.eclipse.ui.IEditorPart;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+import org.eclipse.ui.texteditor.IDocumentProvider;\r
+\r
+import eu.etaxonomy.cdm.api.service.AgentServiceImpl;\r
+import eu.etaxonomy.cdm.api.service.IAgentService;\r
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
+import eu.etaxonomy.cdm.model.agent.AgentBase;\r
+import eu.etaxonomy.cdm.model.agent.Person;\r
+import eu.etaxonomy.cdm.model.agent.Team;\r
+import eu.etaxonomy.cdm.strategy.merge.MergeException;\r
+import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;\r
+import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;\r
+import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;\r
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+/**\r
+ * @author k.luther\r
+ * @date 12.05.2015\r
+ *\r
+ */\r
+public class ConvertTeam2PersonHandler extends AbstractHandler {\r
+\r
+ /**\r
+ * {@inheritDoc}\r
+ */\r
+ @Override\r
+ public Person execute(ExecutionEvent event) throws ExecutionException {\r
+ ISelection selection = HandlerUtil.getCurrentSelection(event);\r
+ \r
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);\r
+ \r
+ IEditorInput input = editor.getEditorInput();\r
+ if (editor.isDirty()){\r
+ boolean proceed = MessageDialog.openQuestion(null,\r
+ "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");\r
+ if (proceed) {\r
+ editor.doSave(null);\r
+ } else {\r
+ return null;\r
+ }\r
+ }\r
+ if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){\r
+ \r
+ \r
+ IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();\r
+ LineAnnotationModel model = \r
+ (LineAnnotationModel) provider.getAnnotationModel(input);\r
+ \r
+ \r
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;\r
+ \r
+ IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;\r
+ \r
+ Person person ;\r
+ for(Object object : structuredSelection.toList()){\r
+ LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);\r
+ person = null;\r
+ if (object instanceof Team){\r
+ Team team = HibernateProxyHelper.deproxy(object, Team.class);\r
+ try {\r
+ person = CdmStore.getService(IAgentService.class).convertTeam2Person(team);\r
+ } catch (IllegalArgumentException e) {\r
+ MessagingUtils.informationDialog("Can not convert Team to Person", e.getMessage());\r
+ } catch (MergeException e) {\r
+ MessagingUtils.informationDialog("Can not convert Team to Person", e.getMessage());\r
+ }\r
+ }else{\r
+ MessagingUtils.informationDialog("Can not convert Team to Person", "convertTeam2Person can only be called on a team.");\r
+ }\r
+ \r
+ if (person != null){\r
+ ((BulkEditor) editor).removeAnnotatedLine(annotation);\r
+ ((BulkEditor) editor).createAnnotatedLine(person);\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+\r
+}\r
package eu.etaxonomy.taxeditor.bulkeditor.handler;
+import java.util.Iterator;
+import java.util.Set;
import java.util.UUID;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.persistence.dao.hibernate.HibernateBeanInitializer;
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES)){
- ISelection selection = HandlerUtil.getCurrentSelection(event);
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);
+
+ IEditorInput input = editor.getEditorInput();
+
+ if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- IEditorInput input = editor.getEditorInput();
+ IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();
+ LineAnnotationModel model =
+ (LineAnnotationModel) provider.getAnnotationModel(input);
- if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){
-
-
- IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();
- LineAnnotationModel model =
- (LineAnnotationModel) provider.getAnnotationModel(input);
-
-
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-
- IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;
- IViewPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .findView("eu.etaxonomy.taxeditor.bulkeditor.view.referencingobjects");
- if (part != null){
- ((ReferencingObjectsView)part).dispose();
- }
+
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+
+ IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;
+
+
+ for(Object object : structuredSelection.toList()){
- for(Object object : structuredSelection.toList()){
-
- LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);
- DeleteResult result = new DeleteResult();
- //result.setError();
- try {
- ICdmApplicationConfiguration controller;
- controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
- //persistenceService.delete(object);
- if (object instanceof SpecimenOrObservationBase){
-
- IOccurrenceService service = controller.getOccurrenceService();
- service.load(((SpecimenOrObservationBase) object).getUuid());
- result = service.delete((SpecimenOrObservationBase)object);
- } else if (object instanceof Reference){
- IReferenceService service = controller.getReferenceService();
- service.load(((Reference) object).getUuid());
- result = service.delete((Reference)object);
- } else if (object instanceof Group){
- IGroupService service = controller.getGroupService();
- service.load(((Group) object).getUuid());
- result = service.delete((Group) object);
- }else if (object instanceof User){
- IUserService service = controller.getUserService();
- service.load(((User) object).getUuid());
- result = service.delete((User) object);
- } else if (object instanceof TaxonNameBase){
- INameService service = controller.getNameService();
- TaxonNameBase name = service.load(((TaxonNameBase) object).getUuid());
+ LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);
+ DeleteResult result = new DeleteResult();
+ //result.setError();
+ try {
+ ICdmApplicationConfiguration controller;
+ controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
+ //persistenceService.delete(object);
+ if (object instanceof SpecimenOrObservationBase){
+
+ IOccurrenceService service = controller.getOccurrenceService();
+ SpecimenOrObservationBase persistedObject = service.load(((SpecimenOrObservationBase) object).getUuid());
+ if (persistedObject != null){
+ result = service.delete(persistedObject);
+ }
+ } else if (object instanceof Reference){
+ IReferenceService service = controller.getReferenceService();
+
+ Reference persistedObject = service.load(((Reference) object).getUuid());
+ if (persistedObject != null){
+ result = service.delete(persistedObject);
+ }
+
+ } else if (object instanceof Group){
+ IGroupService service = controller.getGroupService();
+ Group persistedObject = service.load(((Group) object).getUuid());
+ if (persistedObject != null){
+ result = service.delete(persistedObject);
+ }
+ }else if (object instanceof User){
+ IUserService service = controller.getUserService();
+ User persistedObject = service.load(((User) object).getUuid());
+ if (persistedObject != null){
+ result = service.delete(persistedObject);
+ }
+ } else if (object instanceof TaxonNameBase){
+ INameService service = controller.getNameService();
+ TaxonNameBase name = service.load(((TaxonNameBase) object).getUuid());
+ if (name != null){
NameDeletionConfigurator config = new NameDeletionConfigurator();
result = service.delete(name, config);
- } else if (object instanceof TaxonBase){
- ITaxonService service = controller.getTaxonService();
- service.load(((TaxonBase) object).getUuid());
+ }
+ } else if (object instanceof TaxonBase){
+ ITaxonService service = controller.getTaxonService();
+ TaxonBase taxonBase = service.load(((TaxonBase) object).getUuid());
+ if (taxonBase != null){
if (object instanceof Taxon){
result = service.deleteTaxon((Taxon)object, null, null);
}else{
result = service.deleteSynonym((Synonym)object, null);
}
- } else if (object instanceof TeamOrPersonBase){
- IAgentService service = controller.getAgentService();
- object = service.load(((TeamOrPersonBase) object).getUuid());
- result = service.delete((TeamOrPersonBase)object);
- }
- } catch (Exception e){
- MessagingUtils.messageDialog("Exception occured. Could not delete", getClass(), e.getMessage(), null);
- }
- if (result.isError() || result.isAbort()|| !result.getExceptions().isEmpty()){
- if (!result.getExceptions().isEmpty()) {
- MessagingUtils.messageDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null);
- }else{
- MessagingUtils.messageDialog("Could not delete", getClass(), "The object could not be deleted. An exception occured.", null);
-
}
+ } else if (object instanceof TeamOrPersonBase){
+ IAgentService service = controller.getAgentService();
+ TeamOrPersonBase teamOrPerson = (TeamOrPersonBase)service.load(((TeamOrPersonBase) object).getUuid());
+ result = service.delete((TeamOrPersonBase)object);
}
- if (result.isOk() && result.getExceptions().isEmpty()){
- ((BulkEditor) editor).removeAnnotatedLine(annotation);
+ } catch (Exception e){
+ MessagingUtils.messageDialog("Exception occured. Could not delete", getClass(), e.getMessage(), null);
+ }
+ if (result.isError() || result.isAbort()){
+ if (!result.getExceptions().isEmpty()) {
+ MessagingUtils.messageDialog("Could not delete", getClass(), result.getExceptions().toString(), null);
+ }else{
+ MessagingUtils.messageDialog("Could not delete", getClass(), "The object could not be deleted. An exception occured.", null);
-
- }
- if (part != null){
- ((ReferencingObjectsView)part).refresh();
}
- part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .findView("eu.etaxonomy.taxeditor.editor.view.descriptive");
- if (part != null){
- //((DescriptiveViewPart)part).dispose();
+ }
+ if (result.isOk() ){
+ ((BulkEditor) editor).removeAnnotatedLine(annotation);
+ if(result.getUpdatedObjects().size() != 0 && !result.getExceptions().isEmpty()){
+ MessagingUtils.informationDialog("Delete successfull", "The object is deleted but there are updated objects: " + result.toString());
}
- }
- }
- }else{
- MessagingUtils.warningDialog("Feature not enabled", getClass(), "Deletion is currently an experimental feature." +
- "Enable it via Preferences at your own risk.");
+
+ }
+
+ }
}
-
+
return null;
}
package eu.etaxonomy.taxeditor.bulkeditor.input;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
-import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.strategy.merge.IMergable;
import eu.etaxonomy.cdm.strategy.merge.MergeException;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
*/
public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEditorInput, IEntityPersistenceService<T> {
- /**
- *
- */
- private static final long serialVersionUID = 416414530232743735L;
-
private UUID entityUuid;
private List<T> model;
private IEntityCreator<T> entityCreator;
+
+ private static Class serviceClass;
/**
* <p>NewInstance</p>
* @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
*/
static public AbstractBulkEditorInput NewInstance(BulkEditorInputType inputType) {
+
return BulkEditorInputType.getInput(inputType);
}
* @param entityUuid a {@link java.util.UUID} object.
* @return a T object.
*/
- protected abstract T loadEntity(UUID entityUuid);
+ protected T loadEntity(UUID entityUuid) {
+ List<String> propertyPaths = Arrays.asList(new String[]{});
+ return (T) CdmStore.getService(serviceClass).load(entityUuid, propertyPaths);
+ }
private void setEntityUuid(UUID entityUuid){
this.entityUuid = entityUuid;
if(getEntityUuid() != null){
- T entity = loadEntity(getEntityUuid());
+ T entity = (T) loadEntity(getEntityUuid());
entityList.add(entity);
model = entityList;
}
entityList = listEntities(configurator);
Collections.sort(entityList, queryComparator);
+
}
return false;
}
+ /**
+ * <p>isMergingEnabled</p>
+ *
+ * @return a boolean.
+ */
+ public boolean isConvertingEnabled() {
+ return false;
+ }
/**
* <p>isMarkerTypeEditingEnabled</p>
*
return false;
}
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#merge(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
- */
+
/** {@inheritDoc} */
@Override
public boolean merge(T entity, T mergeTarget) {
if (entity instanceof IMergable) {
try {
- CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);
+ CdmStore.getCommonService().merge((IMergable)mergeTarget, (IMergable)entity, null);
} catch (MergeException e) {
MessagingUtils.errorDialog("Bulk Editor Merge Error",
this,
return true;
}
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#create(eu.etaxonomy.cdm.model.common.IdentifiableEntity)
- */
+
/** {@inheritDoc} */
@Override
public boolean create(T entity) {
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.strategy.merge.DefaultMergeStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergable;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+import eu.etaxonomy.cdm.strategy.merge.MergeException;
+import eu.etaxonomy.cdm.strategy.merge.MergeMode;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
+import eu.etaxonomy.taxeditor.bulkeditor.handler.MergeGroupHandler;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.AgentCreator;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
+import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
* @created 25.06.2009
* @version 1.0
*/
-public class AgentEditorInput extends AbstractBulkEditorInput<AgentBase> {
+public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase> {
/**
*
/** {@inheritDoc} */
@Override
public boolean isMergingEnabled() {
- return false;
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public boolean isConvertingEnabled() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean merge(TeamOrPersonBase entity, TeamOrPersonBase mergeTarget) {
+ if (entity instanceof IMergable) {
+ try {
+ IMergeStrategy strategy = DefaultMergeStrategy.NewInstance(Person.class);
+ strategy.setMergeMode("institutionalMemberships", MergeMode.FIRST);
+ CdmStore.getCommonService().merge((IMergable)mergeTarget, (IMergable)entity, strategy);
+ } catch (MergeException e) {
+ MessagingUtils.errorDialog("Bulk Editor Merge Error",
+ this,
+ "Could not merge chosen objects of type " + entity.getClass().getName(),
+ TaxeditorBulkeditorPlugin.PLUGIN_ID,
+ e,
+ true);
+ }
+ }
+ return true;
}
/** {@inheritDoc} */
@Override
- public List<AgentBase> listEntities(IIdentifiableEntityServiceConfigurator configurator) {
+ public List<TeamOrPersonBase> listEntities(IIdentifiableEntityServiceConfigurator configurator) {
return CdmStore.getSearchManager().findTeamOrPersons(configurator);
}
- /** {@inheritDoc} */
+ /** {@inheritDoc}
@Override
public AgentBase loadEntity(UUID uuid) {
List<String> propertyPaths = Arrays.asList(new String[]{});
return CdmStore.getService(IAgentService.class).load(uuid, propertyPaths);
- }
+ }*/
public boolean delete(AgentBase entity) throws ReferencedObjectUndeletableException {
/** {@inheritDoc} */
public boolean save(AgentBase entity) {
+
return CdmStore.getService(IAgentService.class).saveOrUpdate(entity) != null;
}
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getSortProviders()
*/
@Override
- public List<IBulkEditorSortProvider<AgentBase>> getSortProviders() {
- List<IBulkEditorSortProvider<AgentBase>> sortProviders = super.getSortProviders();
+ public List<IBulkEditorSortProvider<TeamOrPersonBase>> getSortProviders() {
+ List<IBulkEditorSortProvider<TeamOrPersonBase>> sortProviders = super.getSortProviders();
- sortProviders.add(0, new IdentifiableEntitySortProvider<AgentBase>());
+ sortProviders.add(0, new IdentifiableEntitySortProvider<TeamOrPersonBase>());
return sortProviders;
}
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
*/
@Override
- protected IEntityCreator<AgentBase> createEntityCreator() {
+ protected IEntityCreator<TeamOrPersonBase> createEntityCreator() {
return new AgentCreator();
}
+ @Override
+ public boolean save(TeamOrPersonBase entity) {
+ return CdmStore.getService(IAgentService.class).saveOrUpdate(entity) != null;
+ }
+
+ @Override
+ public boolean delete(TeamOrPersonBase entity)
+ throws ReferencedObjectUndeletableException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
package eu.etaxonomy.taxeditor.bulkeditor.input;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
+import java.util.ResourceBundle;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.swt.SWT;
import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
+import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.IReferenceService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
public enum BulkEditorInputType {
- AGENT("Authors and Author Teams", AgentEditorInput.ID),
- REFERENCE("Reference", ReferenceEditorInput.ID),
- NAME("Name", NameEditorInput.ID),
- NAME_RELATIONSHIP("Name Relationship", NameRelationshipEditorInput.ID),
- OCCURRENCE("Specimens and Observations", OccurrenceEditorInput.ID),
- USER("User", UserEditorInput.ID),
- GROUP("Group", GroupEditorInput.ID),
- TAXON("Taxon", TaxonEditorInput.ID);
+ AGENT(Messages.BulkEditorInputType_0, AgentEditorInput.ID),
+ REFERENCE(Messages.BulkEditorInputType_1, ReferenceEditorInput.ID),
+ NAME(Messages.BulkEditorInputType_2, NameEditorInput.ID),
+ NAME_RELATIONSHIP(Messages.BulkEditorInputType_3, NameRelationshipEditorInput.ID),
+ OCCURRENCE(Messages.BulkEditorInputType_4, OccurrenceEditorInput.ID),
+ USER(Messages.BulkEditorInputType_5, UserEditorInput.ID),
+ GROUP(Messages.BulkEditorInputType_6, GroupEditorInput.ID),
+ TAXON(Messages.BulkEditorInputType_7, TaxonEditorInput.ID);
public String id;
public String label;
+ public ResourceBundle resourceBundle;
BulkEditorInputType(String label, String id) {
this.id = id;
return new TaxonEditorInput();
default:
throw new IllegalStateException(
- "No input class for the given input type defined.");
+ "No input class for the given input type defined."); //$NON-NLS-1$
+ }
+ }
+
+ public static Class getServiceClass(
+ BulkEditorInputType inputType) {
+ switch (inputType) {
+ case REFERENCE:
+ return IReferenceService.class;
+ case NAME:
+ return INameService.class;
+ case AGENT:
+ return IAgentService.class;
+ case OCCURRENCE:
+ return IOccurrenceService.class;
+ case NAME_RELATIONSHIP:
+ return INameService.class;
+ case USER:
+ return IUserService.class;
+ case GROUP:
+ return IGroupService.class;
+ case TAXON:
+ return ITaxonService.class;
+ default:
+ throw new IllegalStateException(
+ "No input class for the given input type defined."); //$NON-NLS-1$
}
}
}
\ No newline at end of file
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
- */
+
@Override
protected Group loadEntity(UUID entityUuid) {
List<String> propertyPaths = Arrays.asList(new String[]{});
return CdmStore.getService(IGroupService.class).load(entityUuid, propertyPaths);
}
-
+*/
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
*/
--- /dev/null
+package eu.etaxonomy.taxeditor.bulkeditor.input;\r
+\r
+import org.eclipse.osgi.util.NLS;\r
+\r
+public class Messages extends NLS {\r
+ private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$\r
+ public static String BulkEditorInputType_0;\r
+ public static String BulkEditorInputType_1;\r
+ public static String BulkEditorInputType_2;\r
+ public static String BulkEditorInputType_3;\r
+ public static String BulkEditorInputType_4;\r
+ public static String BulkEditorInputType_5;\r
+ public static String BulkEditorInputType_6;\r
+ public static String BulkEditorInputType_7;\r
+ static {\r
+ // initialize resource bundle\r
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);\r
+ }\r
+\r
+ private Messages() {\r
+ }\r
+}\r
return CdmStore.getSearchManager().findNames(configurator);
}
- /** {@inheritDoc} */
+ /** {@inheritDoc}
@Override
public TaxonNameBase loadEntity(UUID uuid) {
List<String> propertyPaths = Arrays.asList(new String[]{});
return CdmStore.getService(INameService.class).load(uuid, propertyPaths);
}
-
+*/
/** {@inheritDoc}
**/
public boolean delete(TaxonNameBase entity) {
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
*/
- /** {@inheritDoc} */
+ /** {@inheritDoc}
@Override
protected SpecimenOrObservationBase loadEntity(UUID entityUuid) {
List<String> propertyPaths = Arrays.asList(new String[]{});
return CdmStore.getService(IOccurrenceService.class).load(entityUuid, propertyPaths);
- }
+ }*/
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getName()
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
- */
+
@Override
protected User loadEntity(UUID entityUuid) {
List<String> propertyPaths = Arrays.asList(new String[]{});
return CdmStore.getService(IUserService.class).load(entityUuid, propertyPaths);
}
-
+ */
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
*/
* @created 18.09.2009
* @version 1.0
*/
-public class AgentCreator implements IEntityCreator<AgentBase> {
- private static final Logger logger = Logger
- .getLogger(AgentCreator.class);
+public class AgentCreator implements IEntityCreator<TeamOrPersonBase> {
+ private static final Logger logger = Logger.getLogger(AgentCreator.class);
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.String)
*/
/** {@inheritDoc} */
- public AgentBase createEntity(String text) {
+ public TeamOrPersonBase createEntity(String text) {
// FIXME
logger.error("FIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXMEFIXME");
logger.error("We can only create Persons at the moment. See #1820");
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
*/
/** {@inheritDoc} */
- public AgentBase createEntity(Object key, String text) {
+ public TeamOrPersonBase createEntity(Object key, String text) {
TeamOrPersonBase teamOrPerson = null;
if (Team.class.equals((key))) {
teamOrPerson = Team.NewInstance();
/** {@inheritDoc} */
public TaxonNameBase createEntity(String text) {
TaxonNameBase name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
- name.setTitleCache(text);
+ name.setTitleCache(text, true);
+ //name.setTitleCache(text);
return name;
}
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.INullSelectionListener;
+import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.reference.Reference;
* @created 08.07.2009
* @version 1.0
*/
-public class ReferencingObjectsView extends AbstractCdmViewPart implements INullSelectionListener{
+public class ReferencingObjectsView extends AbstractCdmViewPart{
private static final Logger logger = Logger
.getLogger(ReferencingObjectsView.class);
private TableViewer viewer;
private String referencedObjectTitleCache;
+ private ConversationHolder conversation;
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
@Override
public void createViewer(Composite parent) {
selectionService.addSelectionListener(this);
-
+ conversation = CdmStore.createConversation();
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION);
createColumns(viewer);
@Override
public void run() {
if (entityUUID != null){
- ConversationHolder conversation = CdmStore.createConversation();
+
List<CdmBase> referencingObjects = getReferencingObjects(entityUUID, objectClass);
- conversation.close();
+
updateView(referencingObjects);
+
+
}
}
});
try {
if (objectClass.getSuperclass().equals(TeamOrPersonBase.class) ){
referencedObject = CdmStore.getService(IAgentService.class).load(entity);
- } else if (objectClass.getSuperclass().equals(TaxonNameBase.class)){
+ } else if (objectClass.getSuperclass().equals(NonViralName.class)){
referencedObject = CdmStore.getService(INameService.class).load(entity);
} else if (objectClass.getSuperclass().equals(TaxonBase.class)){
referencedObject = CdmStore.getService(ITaxonService.class).load(entity);
- } else if (objectClass.getSuperclass().equals(Reference.class)){
+ } else if (objectClass.equals(Reference.class)){
referencedObject = CdmStore.getService(IReferenceService.class).load(entity);
} else if (objectClass.getSuperclass().equals(SpecimenOrObservationBase.class)){
referencedObject = CdmStore.getService(IOccurrenceService.class).load(entity);
if (referencedObject != null){
referencedObjectTitleCache = ((IdentifiableEntity)referencedObject).getTitleCache();
- setOfReferencingObjects = CdmStore.getService(ICommonService.class).getReferencingObjects(referencedObject);
+ setOfReferencingObjects = CdmStore.getCommonService().getReferencingObjects(referencedObject);
}
if (setOfReferencingObjects != null){
List<CdmBase> referencingObjects = new ArrayList<CdmBase>(setOfReferencingObjects);
private void updateView(List<CdmBase> referencingObjects) {
if (viewer != null && !viewer.getControl().isDisposed()){
viewer.setInput(referencingObjects);
- /*if (referencedObjectTitleCache != null){
+ if (referencedObjectTitleCache != null){
setContentDescription("'" + referencedObjectTitleCache + "' is referenced by:");
} else {
setContentDescription("");
- }*/
+ }
showViewer();
}
}
/** {@inheritDoc} */
@Override
public void showViewer(IWorkbenchPart part, IStructuredSelection selection) {
- this.part = part;
+ // this.part = part;
updateReferencingObjects(((IdentifiableEntity) selection.getFirstElement()).getUuid(),selection.getFirstElement().getClass() );
}
/** {@inheritDoc} */
@Override
public void dispose() {
+ conversation.close();
selectionService.removePostSelectionListener(this);
selectionService.removeSelectionListener(this);
super.dispose();
}
public void refresh(){
+
selectionService.removePostSelectionListener(this);
selectionService.removeSelectionListener(this);
selectionService.addPostSelectionListener(this);
<classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jena-core-2.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jena-iri-1.0.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.4.1-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.5.2-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.5.2-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.5.2-SNAPSHOT.jar" sourcepath="lib/cdmlib-io-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.5.2-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.5.2-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.5.2-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.5.2-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.5.2-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.5.2-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.5.2-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/poi-3.10-FINAL.jar"/>
<classpathentry exported="true" kind="lib" path="lib/poi-ooxml-3.10-FINAL.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
Bundle-ManifestVersion: 2
Bundle-Name: CDM Library Dependencies Plugin
Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Eclipse-BundleShape: dir
Export-Package: com.google.api,
com.google.api.detect,
eu.etaxonomy.cdm.api.service.statistics,
eu.etaxonomy.cdm.api.service.util,
eu.etaxonomy.cdm.api.utility,
+ eu.etaxonomy.cdm.api.validation,
+ eu.etaxonomy.cdm.api.validation.batch,
eu.etaxonomy.cdm.aspectj,
eu.etaxonomy.cdm.common,
eu.etaxonomy.cdm.common.media,
eu.etaxonomy.cdm.io.common.events,
eu.etaxonomy.cdm.io.common.mapping,
eu.etaxonomy.cdm.io.common.mapping.out,
+ eu.etaxonomy.cdm.io.csv.caryophyllales.out,
eu.etaxonomy.cdm.io.csv.redlist.demo,
eu.etaxonomy.cdm.io.csv.redlist.out,
eu.etaxonomy.cdm.io.dwca,
eu.etaxonomy.cdm.persistence.dao.occurrence,
eu.etaxonomy.cdm.persistence.dao.reference,
eu.etaxonomy.cdm.persistence.dao.taxon,
+ eu.etaxonomy.cdm.persistence.dao.validation,
+ eu.etaxonomy.cdm.persistence.dto,
eu.etaxonomy.cdm.persistence.fetch,
eu.etaxonomy.cdm.persistence.hibernate,
eu.etaxonomy.cdm.persistence.hibernate.permission,
org.apache.lucene.util,
org.apache.sanselan;uses:="org.apache.sanselan.common,org.apache.sanselan.common.byteSources",
org.apache.xerces.dom,
+ org.eclipse.osgi.internal.loader,
org.eclipse.osgi.util,
org.h2.jdbc,
org.hamcrest,
lib/spring-security-remoting-3.1.3.RELEASE.jar,
lib/jena-core-2.11.2.jar,
lib/jena-iri-1.0.2.jar,
- lib/cdmlib-commons-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-ext-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-io-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-model-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-persistence-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-print-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-remote-3.4.1-SNAPSHOT.jar,
- lib/cdmlib-services-3.4.1-SNAPSHOT.jar,
+ lib/cdmlib-commons-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-commons-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-ext-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-ext-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-io-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-io-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-model-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-model-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-persistence-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-persistence-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-print-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-print-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-remote-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-remote-3.5.2-SNAPSHOT.jar,
+ lib/cdmlib-services-3.5.2-SNAPSHOT-sources.jar,
+ lib/cdmlib-services-3.5.2-SNAPSHOT.jar,
lib/poi-3.10-FINAL.jar,
lib/poi-ooxml-3.10-FINAL.jar,
lib/xmlbeans-2.3.0.jar,
lib/poi-3.10-FINAL.jar,\\r
lib/poi-ooxml-3.10-FINAL.jar,\\r
lib/poi-ooxml-schemas-3.10-FINAL.jar,\\r
- lib/xmlbeans-2.3.0.jar,\\r
- lib/cdmlib-commons-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-ext-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-io-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-model-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-persistence-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-print-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-remote-3.4.1-SNAPSHOT.jar,\\r
- lib/cdmlib-services-3.4.1-SNAPSHOT.jar,\\r
- lib/swagger-annotations-1.3.5.jar,\\r
- lib/unitils-core-3.4.2.jar,\\r
- lib/unitils-database-3.4.2.jar,\\r
- lib/unitils-dbmaintainer-3.4.2.jar,\\r
- lib/unitils-dbunit-3.4.2.jar,\\r
- lib/unitils-spring-3.4.2.jar,\\r
- lib/cdm-server-3.5.2-SNAPSHOT.jar\r
+ lib/xmlbeans-2.3.0.jar,\
+ lib/cdmlib-commons-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-commons-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-ext-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-ext-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-io-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-io-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-model-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-model-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-persistence-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-persistence-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-print-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-print-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-remote-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-remote-3.5.2-SNAPSHOT.jar,\\r
+ lib/cdmlib-services-3.5.2-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-services-3.5.2-SNAPSHOT.jar,\\r
+ lib/swagger-annotations-1.3.5.jar
\r
jars.compile.order = .\r
output.. = bin/\r
<parent>\r
<groupId>eu.etaxonomy</groupId>\r
<artifactId>taxeditor-parent</artifactId>\r
- <version>3.4.1-SNAPSHOT</version>\r
+ <version>3.5.2-SNAPSHOT</version>\r
</parent>\r
<modelVersion>4.0.0</modelVersion>\r
<artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>\r
</plugins>\r
</pluginManagement>\r
<plugins>\r
- <plugin>\r
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>\r
<artifactId>maven-dependency-plugin</artifactId>\r
<version>2.4</version>\r
<excludeTransitive>true</excludeTransitive>\r
</configuration>\r
</execution>\r
- </executions>\r
+ </executions>
</plugin>\r
<plugin>\r
<groupId>org.apache.maven.plugins</groupId>\r
</dependency>\r
<!-- For Hibernate Mapping End -->\r
</dependencies>\r
-</project>
\ No newline at end of file
+</project>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<!-- Default application context and term initializer -->
<beans xmlns="http://www.springframework.org/schema/beans"\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \r
xmlns:context="http://www.springframework.org/schema/context"\r
- xmlns:tx="http://www.springframework.org/schema/tx"\r
+ xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">\r
</context:component-scan>\r
\r
<context:component-scan base-package="eu.etaxonomy.taxeditor.service"/>\r
-\r
+
\r
<!-- EditGeoService was moved to ext. Therefore it will not be found by \r
the default component scan. We added it here because the Editor needs it. \r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"\r
xsi:schemaLocation="http://www.springframework.org/schema/beans\r
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\r
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd\r
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd\r
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd\r
+ http://www.springframework.org/schema/beans/spring-beans-3.2.xsd\r
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd\r
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd\r
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd\r
">\r
\r
\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
xmlns:context="http://www.springframework.org/schema/context"\r
xmlns:security="http://www.springframework.org/schema/security"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\r
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd\r
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd\r
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd\r
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd\r
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"\r
>\r
\r
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
- <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
Bundle-ManifestVersion: 2
Bundle-Name: Editor Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: OSGI-INF/l10n/plugin
org.eclipse.zest.core,
org.eclipse.zest.layouts,
eu.etaxonomy.taxeditor.cdmlib,
- org.eclipse.ui.ide;bundle-version="3.7.0"
+ org.eclipse.ui.ide
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.core.databinding.beans,
editor.name.2 = Polytomous Key Graph Editor\r
editor.name.3 = Polytomous Key List Editor\r
editor.name.4 = Cdm Authority Editor\r
-editor.name.5 = Derivate View\r
+editor.name.5 = Derivative View\r
view.name = Factual Data\r
view.name.0 = Uses\r
view.name.1 = Media\r
command.label.29 = Move Elements to Taxon\r
command.label.30 = Delete\r
command.label.31 = Save\r
-menu.label.2 = New Derivate\r
+menu.label.2 = New Derivative\r
command.label.32 = New Use\r
command.label.33 = New Use Summary\r
command.label.34 = New Use Record\r
command.name.4 = Change To Accepted Taxon\r
command.name.5 = Change To Misapplication\r
command.name.6 = Swap Synonym With Accepted\r
+\r
command.name.7 = Set Basionym / Original Combination\r
command.name.8 = Remove Basionym / Original Combination\r
command.name.9 = Delete All Empty Names\r
command.name.33 = Open Related Concept\r
category.name.7 = -- Group\r
command.name.34 = Edit CDM Authorities\r
-command.name.35 = Open Derivate View\r
+command.name.35 = Open Derivative View\r
scheme.description = The default key binding scheme for the Taxonomic Editor\r
scheme.name = Taxonomic Editor Default Key Bindings\r
editor.name.6 = Specimen Import Editor\r
marker.field.4 = Problem description\r
marker.field.5 = Validator\r
marker.field.6 = Entity Class\r
-marker.field.7 = Entity Id
\ No newline at end of file
+marker.field.7 = Entity Id\r
+extension.name.0 = Validation Error\r
+command.label.51 = Open in Specimen Editor\r
+command.label.52 = Delete\r
+command.label.53 = Create Field Unit\r
+command.label.54 = Delete (with children)\r
+command.tooltip = Show Only Individuals Associations\r
+command.label.55 = Open Associated Specimens\r
+command.name.41 = Show Only Individual Associations\r
+command.name.42 = Open Taxon Editor\r
+command.name.43 = Create Field Unit\r
+command.name.44 = Deep Delete\r
+command.name.46 = Move Synonym (Homotypical Group) to another Accepted Taxon\r
+command.label.56 = Move Synonym (Homotypical Group) to another Accepted Taxon\r
+markerContentGenerator.name = Validation Problems Marker Generator\r
+command.name.45 = Delete\r
+command.name.47 = Delete\r
+commandParameter.name = taxonUUID\r
+Bundle-Name = Editor Bundle\r
+command.name.48 = delete\r
+command.name.49 = delete\r
+command.name.50 = delete
\ No newline at end of file
command.label.3 = Beleg
command.label.4 = Faktendaten
command.label.5 = Medien
-command.label.6 = Konzept
+command.label.6 = Konzeptrelationen
command.label.7 = Konzeptgraph
command.label.8 = \u00d6ffne Parent
menu.label = Neue
command.label.26 = L\u00f6schen
command.label.27 = Neue Faktendaten
menu.label.1 = Neue
-command.label.28 = Bewege Eigenschaften zu Taxon
-command.label.29 = Bewege Elemente zu Taxon
+command.label.28 = Verschiebe Eigenschaften zu Taxon
+command.label.29 = Verschiebe Elemente zu Taxon
command.label.30 = L\u00f6schen
command.label.31 = Speichern
menu.label.2 = Neue Derivate
command.label.36 = Speichern
command.label.37 = Neue Bildergalerie
command.label.38 = Neues Bild
-command.label.39 = Bewege Bild nach oben
-command.label.40 = Bewege Bild nach unten
+command.label.39 = Bild nach oben
+command.label.40 = Bild nach unten
command.label.41 = L\u00f6schen
command.label.42 = Speichern
menu.label.3 = Neue
extension.name = Namensbefehle
category.name.0 = -- Namenseditor
command.name = \u00d6ffne Elter
-command.name.0 = Erstelle Homotypisches Synonym
-command.name.1 = Erstelle Heterotypisches Synonym
-command.name.2 = Erstelle Synonym in Homotypischer Gruppe
+command.name.0 = Erstelle homotypisches Synonym
+command.name.1 = Erstelle heterotypisches Synonym
+command.name.2 = Erstelle Synonym in homotypischer Gruppe
command.name.3 = \u00c4ndere zu Synonym
command.name.4 = \u00c4ndere zu akzeptiertem Taxon
command.name.5 = \u00c4ndere zu Misapplication
-command.name.6 = Tausche Synonym mit Akzeptiertem Namen
+command.name.6 = Tausche Synonym mit akzeptiertem Namen
+
command.name.7 = Setze Basionym / Originalkombination
command.name.8 = Entferne Basionym / Originalkombination
command.name.9 = L\u00f6sche alle leeren Namen
category.name.1 = -- Fakten
-command.name.10 = erstelle Beschreibungselement
+command.name.10 = Erstelle Beschreibungselement
command.name.11 = Neue Beschreibung
command.name.12 = Bewege Beschreibungselement zu Taxon
command.name.13 = Bewege Beschreibung zu Taxon
category.name.5 = -- Polytomer Bestimmungsschl\u00fcssel
command.name.28 = Neue Kinderknoten
command.name.29 = Neuer Geschwisterknoten
-command.name.30 = Refreshknoten Numbering
-command.name.31 = Wende Layout an
+command.name.30 = Knotennummerierung aktualisieren
+command.name.31 = Layout anwenden
category.name.6 = -- Konzeptbeziehungen
command.name.32 = Erstelle Konzeptrelationen
command.name.33 = \u00d6ffne verbundenes Konzept
category.name.7 = -- Gruppe
command.name.34 = Bearbeite CDM Rechte
command.name.35 = \u00d6ffne Derivate Ansicht
-scheme.description = Die Standard Tastenbindungsschema f\u00fcr den Taxonomischen Editor
-scheme.name = Taxonomic Editor Standard Tastenbindung
-editor.name.7 = Gbif Import Editor
+scheme.description = Die Standard Tastenkombinationsschema f\u00fcr den Taxonomischen Editor
+scheme.name = Taxonomic Editor Standard Tastenkombinationen
+editor.name.6 = Specimen Import Editor
+editor.name.7 = GBIF Import Editor
editor.name.8 = Checklist Editor
view.name.4 = Specimen Import
view.name.5 = GBIF Specimen Import
wizard.description = Sendet eine Anfrage mit den eingegebenen Parametern an den Datenprovider.\nHinweis: Die Anzahl der Anfrageergebnisse sind auf 100 begrenzt.
command.name.40 = Validierung
view.name.6 = Validierung
-marker.field.0 = Objekt Typ
+marker.field.0 = Objekttyp
marker.field.1 = Objekt
marker.field.2 = Attribut
marker.field.3 = Problematischer Wert
-marker.field.4 = Problem Beschreibung
+marker.field.4 = Problembeschreibung
marker.field.5 = Validierer
-marker.field.6 = Entitäts Klasse
-marker.field.7 = Entitäts ID
\ No newline at end of file
+marker.field.6 = Entit�tsklasse
+marker.field.7 = Entit�ts ID
+extension.name.0 = Validierungs-Fehler
+command.label.51 = \u00d6ffne Specimen-Editor
+command.label.52 = L\u00f6schen
+command.label.53 = Neue Field Unit
+command.label.54 = L\u00f6schen (mit Kindern)
+command.tooltip = Nur Individuals Associations anzeigen
+command.label.55 = \u00d6ffne zugeh�rige Specimens
+command.name.41 = Nur Individuals Associations anzeigen
+command.name.42 = \u00d6ffne Taxon Editor
+command.name.43 = Neue Field Unit
+command.name.44 = L\u00f6schen (mit Kindern)
+command.name.46 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
+command.label.56 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
\ No newline at end of file
icons/,\
p2.inf,\
OSGI-INF/l10n/plugin.properties,\
- OSGI-INF/l10n/plugin_de.properties,\
- OSGI-INF/l10n/plugin_en.properties
+ OSGI-INF/l10n/plugin_de.properties
</extension>
<!-- VALIDATION RELATED STUFF -->
- <extension point="org.eclipse.core.resources.markers" name="Validation Error" id="eu.etaxonomy.taxeditor.markers.validationerror">
+ <extension point="org.eclipse.core.resources.markers" name="%extension.name.0" id="eu.etaxonomy.taxeditor.markers.validationerror">
<super type="org.eclipse.core.resources.problemmarker"/>
<attribute name="databaseId"/>
<attribute name="userFriendlyTypeName"/>
<extension point="org.eclipse.ui.ide.markerSupport">
<markerContentGenerator
id="eu.etaxonomy.taxeditor.editor.validation.ValidationProblemsMarkerGenerator"
- name="Validation Problems Marker Generator">
+ name="%markerContentGenerator.name">
<markerTypeReference id="eu.etaxonomy.taxeditor.markers.validationerror" />
<markerFieldReference id="eu.etaxonomy.taxeditor.markers.validation.userFriendlyTypeName" visible="true" />
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.editor.name.delete"
label="%command.label.15"
style="push">
<visibleWhen>
</reference>
</visibleWhen>
</command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.name.moveSynonymToAnotherAcceptedTaxon"
+ label="%command.label.56"
+ style="push">
+ <visibleWhen>
+ <reference
+ definitionId="isSynonym">
+ </reference>
+ </visibleWhen>
+ </command>
<separator
name="taxeditor-editor.separator3"
visible="true">
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.key.polytomous.delete"
label="%command.label.21"
style="push">
</command>
style="push">
</command>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.key.polytomous.command.delete"
label="%command.label.26"
style="push">
</command>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.descriptive">
<command
- commandId="eu.etaxonomy.taxeditor.description.commands.adddescription"
+ commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.adddescription"
label="%command.label.27"
style="push">
</command>
visible="true">
</separator>
<command
- commandId="eu.etaxonomy.taxeditor.editor.commands.description.moveDescriptionToTaxon"
+ commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
+ label="%command.label.51"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <and>
+ <with
+ variable="selection">
+ <count
+ value="+">
+ </count>
+ </with>
+ <reference
+ definitionId="isIndividualsAssociation">
+ </reference>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionToTaxon"
label="%command.label.28"
style="push">
<visibleWhen
</visibleWhen>
</command>
<command
- commandId="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
+ commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionElements"
label="%command.label.29"
style="push">
<visibleWhen
name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator.afterNew"
visible="true">
</separator>
- <command
- commandId="org.eclipse.ui.edit.delete"
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.delete"
label="%command.label.30"
style="push">
</command>
label="%command.label.31"
style="push">
</command>
+ <separator
+ name="eu.etaxonomy.taxeditor.editor.separator1">
+ </separator>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
- <dynamic
- class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
- id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
- </dynamic>
<command
- commandId="org.eclipse.ui.edit.delete"
- label="Delete"
+ commandId="eu.etaxonomy.taxeditor.editor.derivate.delete"
+ label="%command.label.52"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.derivate.createFieldUnit"
- label="Create Field Unit"
+ label="%command.label.53"
style="push">
</command>
<command
commandId="eu.etaxonomy.taxeditor.editor.derivate.deepDelete"
icon="icons/deep-delete-16x16-32.png"
- label="Delete (with children)"
+ label="%command.label.54"
style="push">
</command>
+ <dynamic
+ class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
+ id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
+ </dynamic>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor">
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.editor.use.command.delete"
label="%command.label.35"
style="push">
</command>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">
<command
- commandId="taxeditor-editor.command.newimagegallery"
+ commandId="eu.etaxonomy.taxeditor.editor.media.command.newimagegallery"
label="%command.label.37"
style="push">
<visibleWhen>
visible="true">
</separator>
<command
- commandId="taxeditor-editor.newimage"
+ commandId="eu.etaxonomy.taxeditor.editor.media.command.newimage"
label="%command.label.38"
style="push">
<visibleWhen>
</visibleWhen>
</command>
<command
- commandId="taxeditor-editor.useExistingImage"
+ commandId="eu.etaxonomy.taxeditor.editor.media.command.useExistingImage"
label="%command.label.50"
style="push">
<visibleWhen>
</visibleWhen>
</command>
<command
- commandId="taxeditor-editor.command.moveimgdown"
+ commandId="eu.etaxonomy.taxeditor.editor.media.command.moveimgdown"
label="%command.label.39"
style="push">
<visibleWhen>
</visibleWhen>
</command>
<command
- commandId="taxeditor-editor.command.moveimgup"
+ commandId="eu.etaxonomy.taxeditor.editor.media.command.moveimgup"
label="%command.label.40"
style="push">
<visibleWhen>
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.editor.media.command.delete"
label="%command.label.41"
style="push">
</command>
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.editor.view.concept.command.delete"
label="%command.label.44"
style="push">
</command>
style="push">
<visibleWhen>
<reference
- definitionId="isGroup">
+ definitionId="isGroupEditor">
</reference>
</visibleWhen>
</command>
commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations"
icon="icons/link_obj.gif"
style="toggle"
- tooltip="Show Only Individuals Associations">
+ tooltip="%command.tooltip">
</command>
</menuContribution>
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.navigation.navigatorpopup?after=taxeditor-navigation.separator2">
<command
commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
- label="Open Associated Derivates"
+ label="%command.label.55"
style="push">
<visibleWhen
checkEnabled="false">
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.name.handler.DeleteTaxonBaseHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.editor.name.command.delete">
<activeWhen>
<and>
<reference
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.delete">
<activeWhen>
<with
variable="activePartId">
<equals
value="eu.etaxonomy.taxeditor.editor.view.media">
</equals>
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.view.uses">
+ </equals>
</or>
- </with>
- </activeWhen>
+ </with>
+ </activeWhen>
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.DeleteNodeHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.editor.key.polytomous.command.delete">
<activeWhen>
<with
variable="activePartId">
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.view.concept.handler.DeleteConceptRelationHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.editor.view.concept.command.delete">
<activeWhen>
<with
variable="activePartId">
</with>
</activeWhen>
</handler>
- <handler
- class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
- commandId="org.eclipse.ui.edit.delete">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="eu.etaxonomy.taxeditor.editor.view.uses">
- </equals>
- </with>
- </activeWhen>
- </handler>
<handler
class="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler">
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.editor.view.derivate.command.delete">
<activeWhen>
<with
variable="activePartId">
id="eu.etaxonomy.taxeditor.editor.name.swapSynonymAndAccepted"
name="%command.name.6">
</command>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.MoveSynonymToAnotherAcceptedTaxonHandler"
+ id="eu.etaxonomy.taxeditor.editor.name.moveSynonymToAnotherAcceptedTaxon"
+ name="%command.name.46">
+ </command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.SetBasionymHandler"
id="eu.etaxonomy.taxeditor.editor.name.changeAcceptedToSynonym"
name="Change Accepted Taxon to Synonym">
</command>-->
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.DeleteTaxonBaseHandler"
+ id="eu.etaxonomy.taxeditor.editor.name.delete"
+ name="%command.name.45">
+ </command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.DeleteAllEmptyNamesHandler"
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler"
- id="eu.etaxonomy.taxeditor.editor.description.createDescriptionElement"
+ id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.createDescriptionElement"
name="%command.name.10">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler"
- id="eu.etaxonomy.taxeditor.description.commands.adddescription"
+ id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.adddescription"
name="%command.name.11">
</command>
- <command
- categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
- defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionElementsHandler"
- id="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
- name="%command.name.12">
- </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.commands.description.moveDescriptionToTaxon"
- name="%command.name.13">
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
+ id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.delete"
+ name="%command.name.48">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
id="eu.etaxonomy.taxeditor.use.commands.adduse"
name="%command.name.14">
</command>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseRecordHandler"
+ id="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
+ name="%command.name.16">
+ </command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseSummaryHandler"
name="%command.name.15">
</command>
<command
- categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
- defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseRecordHandler"
- id="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
- name="%command.name.16">
+ id="eu.etaxonomy.taxeditor.editor.use.command.delete"
+ name="%command.name.47">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.media.category"
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.MoveImageDownInListHandler"
- id="taxeditor-editor.command.moveimgdown"
+ id="eu.etaxonomy.taxeditor.editor.media.command.moveimgdown"
name="%command.name.19">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.AddImageGalleryHandler"
- id="taxeditor-editor.command.newimagegallery"
+ id="eu.etaxonomy.taxeditor.editor.media.command.newimagegallery"
name="%command.name.20">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.CreateMediaHandler"
- id="taxeditor-editor.newimage"
+ id="eu.etaxonomy.taxeditor.editor.media.command.newimage"
name="%command.name.21">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.AddExistingMediaHandler"
- id="taxeditor-editor.useExistingImage"
+ id="eu.etaxonomy.taxeditor.editor.media.command.useExistingImage"
name="%command.name.37">
</command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.media.category"
defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.MoveImageUpInListHandler"
- id="taxeditor-editor.command.moveimgup"
+ id="eu.etaxonomy.taxeditor.editor.media.command.moveimgup"
name="%command.name.22">
+ </command>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.media.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
+ id="eu.etaxonomy.taxeditor.editor.media.command.delete"
+ name="%command.name.49">
</command>
<category
id="eu.etaxonomy.taxeditor.editor.new.category"
id="eu.etaxonomy.taxeditor.key.command.applyLayout"
name="%command.name.31">
</command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.DeleteNodeHandler"
+ id="eu.etaxonomy.taxeditor.key.polytomous.command.delete"
+ name="%command.name.50">
+ </command>
<category
id="eu.etaxonomy.taxeditor.editor.view.concept.category"
name="%category.name.6">
</command>
<command
id="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations"
- name="Show Only Individual Associations">
+ name="%command.name.41">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenTaxonEditorHandler"
id="eu.etaxonomy.taxeditor.editor.openTaxonEditor"
- name="Open Taxon Editor">
+ name="%command.name.42">
<commandParameter
id="eu.etaxonomy.taxeditor.editor.taxonParameter"
- name="taxonUUID"
+ name="%commandParameter.name"
optional="false"
typeId="eu.etaxonomy.taxeditor.editor.taxonParameterType">
</commandParameter>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.CreateFieldUnitHandler"
id="eu.etaxonomy.taxeditor.editor.derivate.createFieldUnit"
- name="Create Field Unit">
+ name="%command.name.43">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
id="eu.etaxonomy.taxeditor.editor.derivate.deepDelete"
- name="Deep Delete">
+ 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.commands.description.moveDescriptionToTaxon"
+ name="%command.name.13">
+ </command>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionElementsHandler"
+ id="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
+ name="%command.name.12">
</command>
+
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
</with>
</definition>
<definition
- id="isGroup">
+ id="isGroupEditor">
<with
variable="activeEditor">
<test
- property="taxeditor-bulkeditor.propertyTester.isGroup">
+ property="taxeditor-bulkeditor.propertyTester.isGroupEditor">
+ </test>
+ </with>
+ </definition>
+ <definition
+ id="isIndividualsAssociation">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isIndividualsAssociation">
</test>
</with>
</definition>
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
- properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor"
+ properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor, isIndividualsAssociation"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
<propertyTester
class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"
id="taxeditor-bulkeditor.PropertyTester"
namespace="taxeditor-bulkeditor.propertyTester"
- properties="isGroup"
+ properties="isGroupEditor"
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
</propertyTester>
</extension>
</description>
</wizard>
</extension>
+ <extension
+ point="eu.etaxonomy.taxeditor.store.cdmViewer">
+ <cdmViewer
+ class="eu.etaxonomy.taxeditor.editor.EditorCdmViewer">
+ </cdmViewer>
+ </extension>
</plugin>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.editor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.view.ICdmViewer;
+
+/**
+ * @author pplitzner
+ * @date Feb 23, 2015
+ *
+ */
+public class EditorCdmViewer implements ICdmViewer {
+
+ private final Logger logger = Logger.getLogger(EditorCdmViewer.class);
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.view.ICdmViewer#show(java.lang.Object)
+ */
+ @Override
+ public void show(Object input, Class<?> viewerClass) {
+ try {
+ if(viewerClass.equals(MultiPageTaxonEditor.class)){
+ if(input instanceof TaxonBase){
+ TaxonEditorInput editorInput = TaxonEditorInput.NewInstanceFromTaxonBase(((TaxonBase<?>) input).getUuid());
+ EditorUtil.open(editorInput);
+ }
+ }
+ else if(viewerClass.equals(DerivateView.class)){
+ if(input instanceof SpecimenOrObservationBase){
+ }
+ }
+ } catch (PartInitException e) {
+ String errorMessage = "Could not open editor";
+ logger.error(errorMessage, e);
+ MessagingUtils.error(EditorCdmViewer.class, errorMessage, e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.view.ICdmViewer#getViewerClasses(java.lang.Object)
+ */
+ @Override
+ public Map<Class<?>, String> getViewerClasses(Object input) {
+ Map<Class<?>, String> viewerNameMap = new HashMap<Class<?>, String>();
+ if(input instanceof TaxonBase){
+ viewerNameMap.put(MultiPageTaxonEditor.class, "Taxon Editor");
+ }
+ return viewerNameMap;
+ }
+
+}
container.refresh();
}
}
+ //refresh part title
+ //TODO: refresh taxon node in taxon navigator
+ setPartName();
}
/* (non-Javadoc)
/** {@inheritDoc} */
@Override
public boolean postOperation(CdmBase objectAffectedByOperation) {
- setDirty(true);
+ setDirty(true);
for (IEditorPart editor : this.getPages()) {
if (editor instanceof IPostOperationEnabled) {
*/\r
package eu.etaxonomy.taxeditor.editor;\r
\r
-import java.net.URI;\r
-import java.net.URISyntaxException;\r
-\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.ui.IMemento;\r
\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
-import eu.etaxonomy.cdm.api.service.ITermService;\r
-import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
-import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
-import eu.etaxonomy.cdm.model.common.MarkerType;\r
-import eu.etaxonomy.cdm.model.common.TermType;\r
-import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
-import eu.etaxonomy.cdm.model.description.Feature;\r
-import eu.etaxonomy.cdm.model.description.FeatureNode;\r
-import eu.etaxonomy.cdm.model.description.FeatureTree;\r
-import eu.etaxonomy.cdm.model.description.State;\r
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;\r
import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.UseObjectStore;\r
\r
/**\r
- * The context listener will call this class when the uses view is being loaded.\r
- * It checks if the uses view's necessary terms are present in the database.\r
- * It will persist the terms that aren't present, using the CDMLib's services classes.\r
+ * The context listener will call this class when a new context is started.\r
+ * It will reset the UseObjectStore to guarantee the static\r
+ * content of the store will be refreshed each time we load a new context. \r
* @author a.theys\r
+ * @author a.mueller\r
* @created mar 13, 2012\r
*/\r
public class UseObjectManager extends ContextListenerAdapter{\r
\r
@Override\r
public void contextRefresh(IProgressMonitor monitor) {\r
- monitor.subTask("Refreshing the Uses View");\r
- MessagingUtils.warn(getClass(), "Refreshing Uses View warn");\r
- setupNecessaryItems(monitor);\r
+ monitor.subTask("Reset usage data");\r
+ MessagingUtils.warn(getClass(), "Reset usage data");\r
+ UseObjectStore.reset();\r
}\r
\r
\r
@Override\r
public void contextStart(IMemento memento, IProgressMonitor monitor) {\r
- monitor.subTask("Starting the Uses View");\r
- MessagingUtils.warn(getClass(), "Starting Uses View warn");\r
- setupNecessaryItems(monitor);\r
- }\r
-\r
- private void setupNecessaryItems(IProgressMonitor monitor) {\r
-\r
- //retrieve terms and vocabularies from db\r
- Feature featureUseRecord = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);\r
- Feature featureUseSummary = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
-\r
- ConversationHolder conversation = CdmStore.createConversation();\r
-\r
-\r
- //create use marker type if not exists\r
- createUseMarkerType(conversation);\r
-\r
- //create state vocabulary if not exists\r
- createStateVocabulary(monitor, conversation);\r
-\r
- //create state vocabulary if not exists\r
- createCountryVocabulary(monitor, conversation);\r
-\r
- //create plant part vocabulary\r
- createPlantVocabulary(monitor, conversation);\r
-\r
- //create human group vocabulary\r
- createHumanGroupVocabulary(monitor, conversation);\r
-\r
- if(featureUseRecord == null || featureUseSummary == null) {\r
- TermVocabulary<Feature> featureVocabulary = CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary));\r
-// FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree);\r
-\r
- if (featureUseRecord == null ) {\r
- featureUseRecord = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null);\r
- featureUseRecord.setUuid(UsageTermCollection.uuidUseRecordFeature);\r
- featureUseRecord.setSupportsCategoricalData(true);\r
- featureVocabulary.addTerm(featureUseRecord);\r
- \r
-// if (palmWebFeatureTree != null){\r
-// FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord);\r
-// palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);\r
-// }else{\r
-// StoreUtil.warn(getClass(), "No current feature tree available to add useRecord feature");\r
-// }\r
- }\r
- if (featureUseSummary == null) {\r
- featureUseSummary = Feature.NewInstance(UsageTermCollection.useSummaryFeatureLabel, UsageTermCollection.useSummaryFeatureLabel, null);\r
- featureUseSummary.setUuid(UsageTermCollection.uuidUseSummaryFeature);\r
- featureUseSummary.setSupportsTextData(true);\r
- featureVocabulary.addTerm(featureUseSummary);\r
-// if (palmWebFeatureTree != null){\r
-// FeatureNode useSumFeatureNode = FeatureNode.NewInstance(featureUseSummary);\r
-// palmWebFeatureTree.getRoot().addChild(useSumFeatureNode);\r
-// }else{\r
-// StoreUtil.warn(getClass(), "No current feature tree available to add use summary feature");\r
-// }\r
- }\r
-\r
- CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary);\r
-// if (palmWebFeatureTree != null){\r
-// CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree);\r
-// }\r
- conversation.commit(true);\r
-\r
- }\r
- conversation.close();\r
- }\r
-\r
-\r
- private void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) {\r
- TermVocabulary<DefinedTerm> humanGroupVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
- if (humanGroupVocabulary == null){\r
- monitor.subTask("create human group vocabulary");\r
- URI termSourceUri = null;\r
- try {\r
- termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
- } catch (URISyntaxException e) {\r
- e.printStackTrace();\r
- }\r
-\r
- humanGroupVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
- humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
-\r
- DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
- newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
-\r
- DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
- newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
- newDummyModifier.addIncludes(newSubDummyModifier);\r
- humanGroupVocabulary.addTerm(newDummyModifier);\r
-\r
- CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
- conversation.commit(true);\r
- }\r
- }\r
-\r
-\r
- private void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
- TermVocabulary<DefinedTerm> plantPartVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
- if (plantPartVocabulary == null){\r
- monitor.subTask("create plant part vocabulary");\r
- URI termSourceUri = null;\r
- try {\r
- termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
- } catch (URISyntaxException e) {\r
- e.printStackTrace();\r
- }\r
- plantPartVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
- plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
-\r
- DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
- newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
- plantPartVocabulary.addTerm(newDummyModifier);\r
-\r
- CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
- conversation.commit(true);\r
- }\r
- }\r
-\r
-\r
- private void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
- TermVocabulary<DefinedTerm> countryVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
- if (countryVocabulary == null){\r
- monitor.subTask("create country vocabulary");\r
- URI termSourceUri = null;\r
- try {\r
- termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
- } catch (URISyntaxException e) {\r
- e.printStackTrace();\r
- }\r
- countryVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
- countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
-\r
- DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
- newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
- countryVocabulary.addTerm(newDummyModifier);\r
-\r
- CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
- conversation.commit(true);\r
- }\r
- }\r
-\r
-\r
- private void createStateVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
- TermVocabulary<State> stateVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
- if (stateVocabulary == null){\r
- monitor.subTask("create state vocabulary");\r
- URI termSourceUri = null;\r
- try {\r
- termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State");\r
- } catch (URISyntaxException e) {\r
- e.printStackTrace();\r
- }\r
-\r
- stateVocabulary = TermVocabulary.NewInstance(TermType.State, UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
- stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
-\r
- State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
- newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
- State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
- newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy);\r
- newDummyState.addIncludes(newDummySubCat);\r
-\r
- stateVocabulary.addTerm(newDummyState);\r
-\r
- CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary);\r
- conversation.commit(true);\r
- }\r
+// monitor.subTask("Starting the Uses View");\r
+// MessagingUtils.warn(getClass(), "Starting Uses View warn");\r
+ UseObjectStore.reset();\r
}\r
\r
\r
- private void createUseMarkerType(ConversationHolder conversation) {\r
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
- if (useMarkertype == null){\r
- useMarkertype = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null);\r
- useMarkertype.setUuid( UsageTermCollection.uuidUseMarkerType);\r
- TermVocabulary<MarkerType> markerTypeVocabulary = CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary));\r
- markerTypeVocabulary.addTerm(useMarkertype);\r
- CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary);\r
- conversation.commit(true);\r
- }\r
- }\r
}\r
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
+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.view.derivate.DerivateViewEditorInput;
if(object instanceof SpecimenOrObservationBase<?>){
selectedElementUUIDs.add(((SpecimenOrObservationBase<?>) object).getUuid());
}
+ else if(object instanceof IndividualsAssociation){
+ SpecimenOrObservationBase specimen = ((IndividualsAssociation) object).getAssociatedSpecimenOrObservation();
+ if(specimen!=null){
+ selectedElementUUIDs.add(specimen.getUuid());
+ }
+ }
+ }
+ if(!selectedElementUUIDs.isEmpty()){
+ DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
+ try {
+ EditorUtil.open(input);
+ } catch (PartInitException e) {
+ MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
+ } catch (NullPointerException npe){
+ MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivate hierarchy is corrupted!", npe);
+ }
}
- DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
- try {
- EditorUtil.open(input);
- } catch (PartInitException e) {
- MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivate Editor", e);
- } catch (NullPointerException npe){
- MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivate Editor. The derivate hierarchy is corrupted!", npe);
+ else{
+ MessagingUtils.informationDialog("Empty selection", "No Specimen selected.");
}
}
return null;
public TaxeditorEditorPlugin() {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
/** {@inheritDoc} */
public void start(BundleContext context) throws Exception {
super.start(context);
EditorStateManager stateManager = new EditorStateManager();
CdmStore.getContextManager().addContextListener(stateManager);
+ UseObjectManager useManager = new UseObjectManager();
+ CdmStore.getContextManager().addContextListener(useManager);
+
ValidationContextListener vcl = new ValidationContextListener();
- CdmStore.getContextManager().addContextListener(vcl);
+// CdmStore.getContextManager().addContextListener(vcl);
plugin = this;
logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
+
/** {@inheritDoc} */
public void stop(BundleContext context) throws Exception {
plugin = null;
package eu.etaxonomy.taxeditor.editor.name;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Menu;
+import java.awt.dnd.DropTarget;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.apache.commons.lang.StringUtils;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.ManagedForm;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-import org.eclipse.ui.part.EditorPart;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
import eu.etaxonomy.taxeditor.editor.IDropTargetable;
import eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage;
import eu.etaxonomy.taxeditor.model.TaxeditorPartService;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.security.RequiredPermissions;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* </p>
*/
public void createOrUpdateNameComposites() {
-// this.taxon = (Taxon)CdmStore.getService(ITaxonService.class).load(this.getTaxon().getUuid());
+
+ //this.taxon = (Taxon)CdmStore.getService(ITaxonService.class).load(this.getTaxon().getUuid());
+ //this.taxon = HibernateProxyHelper.deproxy(this.taxon, Taxon.class);
ContainerFactory.createOrUpdateAcceptedTaxonsHomotypicGroup(this);
ContainerFactory.createOrUpdateHeterotypicSynonymyGroups(this);
ContainerFactory.createOrUpdateMisapplicationsGroup(this);
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.MouseAdapter;
public void handleSplitText(String text) {
AbstractGroupedContainer.this.handleSplitText(text);
}
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // TODO Auto-generated method stub
+
+ }
};
getNameViewer().getTextWidget().addVerifyListener(lineBreakListener);
+ getNameViewer().getTextWidget().addKeyListener(lineBreakListener);
}
abstract class LabelEllipsisListener extends ControlAdapter {
import java.util.Scanner;
import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
* @created 19.05.2008
* @version 1.0
*/
-public abstract class LineBreakListener implements VerifyListener{
+public abstract class LineBreakListener implements VerifyListener, KeyListener {
private static String LINE_BREAK = System.getProperty("line.separator");
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.name.handler;\r
+\r
+import java.util.UUID;\r
+\r
+import org.apache.log4j.Logger;\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.core.commands.common.NotDefinedException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.viewers.StructuredSelection;\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.eclipse.ui.IEditorInput;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+\r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
+import eu.etaxonomy.cdm.model.taxon.Synonym;\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;\r
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
+import eu.etaxonomy.taxeditor.editor.name.operation.MoveSynonymToAnotherAcceptedTaxonOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;\r
+\r
+public class MoveSynonymToAnotherAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled {\r
+ private static final Logger logger = Logger\r
+ .getLogger(MoveSynonymToAnotherAcceptedTaxonHandler.class);\r
+ private MultiPageTaxonEditor editor;\r
+ \r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ editor = (MultiPageTaxonEditor) HandlerUtil.getActiveEditor(event);\r
+ Shell shell = HandlerUtil.getActiveShell(event);\r
+ IEditorInput input = editor.getEditorInput();\r
+ if (!EditorUtil.forceUserSave(editor, shell)) {\r
+ return null;\r
+ }\r
+ \r
+ if (!(input instanceof TaxonEditorInput)) {\r
+ logger.error("Editor input is not TaxonEditorInput");\r
+ return null;\r
+ }\r
+\r
+ // Get synonym from selection\r
+ StructuredSelection selection = (StructuredSelection) HandlerUtil.getCurrentSelection(event);\r
+ if (!(selection.getFirstElement() instanceof Synonym)) {\r
+ logger.error("Selection does not contain a Synonym");\r
+ return null;\r
+ }\r
+\r
+ Synonym synonym = (Synonym) selection.getFirstElement();\r
+ TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Select new accepted taxon", null, null, null);\r
+ Taxon oldParent = ((TaxonEditorInput)input).getTaxon();\r
+ \r
+ MoveSynonymToAnotherAcceptedTaxonOperation operation = new MoveSynonymToAnotherAcceptedTaxonOperation("Change accepted Taxon of Synonym", EditorUtil.getUndoContext(),\r
+ oldParent.getUuid(), synonym.getUuid(), newParentNode.getTaxon(), editor);\r
+ \r
+ EditorUtil.executeOperation(operation);\r
+ \r
+\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ public boolean postOperation(CdmBase objectAffectedByOperation) {\r
+ // TODO Auto-generated method stub\r
+ return false;\r
+ }\r
+\r
+ @Override\r
+ public boolean onComplete() {\r
+ // TODO Auto-generated method stub\r
+ return false;\r
+ }\r
+ \r
+ \r
+\r
+}\r
// $Id$
/**
* 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.
*/
private static final String CONCEPT = "isConceptRelation";
private static final String EMPTY_NAMES = "hasEmptyNames";
private static final String ACCEPTED_AND_NO_HOMOTYPIC_SYNONYMS = "isAcceptedAndHasNoHomotypicSynonyms";
-
+
/**
* <p>Constructor for NameEditorMenuPropertyTester.</p>
*/
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean test(Object receiver, String property, Object[] args,
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
-
+
if(receiver instanceof IStructuredSelection){
-
+
IStructuredSelection selection = (IStructuredSelection) receiver;
-
+
Object selectedElement = selection.getFirstElement();
-
+
if(ACCEPTED.equals(property)){
return isAccepted(selectedElement);
}
return isAcceptedAndHasNoHomotypicSynonyms(selectedElement);
}
}
-
+
return false;
-
+
}
private boolean isAcceptedAndHasNoHomotypicSynonyms(Object selectedElement) {
// TODO pass in homotypical group's taxon in case we are dragging from one editor to another
// Switch groups
- oldHomotypicalGroup.removeTypifiedName(synonymName);
+ oldHomotypicalGroup.removeTypifiedName(synonymName, false);
monitor.worked(40);
newHomotypicalGroup = HibernateProxyHelper.deproxy(newHomotypicalGroup, HomotypicalGroup.class);
newHomotypicalGroup.addTypifiedName(synonymName);
// TODO pass in homotypical group's taxon in case we are dragging from one editor to another
// Switch groups
- newHomotypicalGroup.removeTypifiedName(synonymName);
+ newHomotypicalGroup.removeTypifiedName(synonymName, false);
oldHomotypicalGroup.addTypifiedName(synonymName);
// Redraw editor if it exists
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
// Add name to new homotypic group
HomotypicalGroup.NewInstance().addTypifiedName(newSynonymName);
monitor.worked(20);
-
+ HibernateProxyHelper.deproxy(element);
// Create a new synonym for the taxon
newSynonymRelationship = element.addHeterotypicSynonymName(newSynonymName);
monitor.worked(40);
-
+
return postExecute(newSynonymRelationship.getSynonym());
}
DeleteResult result = service.deleteSynonym(synonym.getUuid(), element.getUuid(), null);
if (result.isError()){
- MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());
+ MessageDialog.openError(null, "Delete failed", result.toString());
+ } else if (!result.getUpdatedObjects().isEmpty()){
+ MessageDialog.openInformation(null, "Delete successfull", "The Synonym could be deleted, but there is an updated object: " + result.toString());
}
}
// taxon.removeSynonym(synonym);
import eu.etaxonomy.cdm.model.taxon.Classification;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
\r
DeleteResult result = service.deleteTaxon(element.getUuid(), configurator, classification.getUuid());\r
if (result.isError()){\r
- MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());\r
+ MessageDialog.openError(null, "Delete failed", result.toString());\r
+ } else if (!result.getUpdatedObjects().isEmpty()){\r
+ MessagingUtils.informationDialog("Delete successfull", result.toString());\r
}\r
\r
monitor.worked(40);\r
package eu.etaxonomy.taxeditor.editor.validation;\r
\r
-import java.util.HashMap;\r
+import java.util.ArrayList;\r
import java.util.List;\r
import java.util.Set;\r
\r
import org.eclipse.core.runtime.CoreException;\r
\r
import eu.etaxonomy.cdm.model.validation.EntityConstraintViolation;\r
-import eu.etaxonomy.cdm.model.validation.EntityValidationResult;\r
+import eu.etaxonomy.cdm.model.validation.EntityValidation;\r
import eu.etaxonomy.cdm.model.validation.Severity;\r
\r
/**\r
* A class responsible for refreshing problem markers coming from the CVI\r
* (Cdmlib Validation Infrastructure).\r
- * \r
+ *\r
* @author ayco_holleman\r
- * \r
+ *\r
*/\r
+\r
/*\r
* See following for problems with icons in Problems view\r
* http://stackoverflow.com\r
* http\r
* ://cubussapiens.hu/2010/11/markers-and-annotations-in-eclipse-for-error-feedback\r
* /\r
- * \r
+ *\r
* See here for difficulty of attaching markers to non-resources (files,\r
* folders):\r
* http://stackoverflow.com/questions/12493179/eclipse-virtual-resources\r
*/\r
public class MarkerManager {\r
\r
- public static final String MARKER_TYPE_ID = "eu.etaxonomy.taxeditor.markers.validationerror";\r
-\r
- /**\r
- * The primary key (id) of the EntityValidationResult record\r
- */\r
- public static final String ATTRIB_DATABASE_ID = "databaseId";\r
-\r
- // The values of the following constants must correspond to the attributes\r
- // defined for the org.eclipse.core.resources.markers extension point in\r
- // plugin.xml\r
-\r
- /**\r
- * A user-friendly description of the type of the entity\r
- */\r
- public static final String ATTRIB_USER_FRIENDLY_TYPE_NAME = "userFriendlyTypeName";\r
- /**\r
- * A user-friendly description of the entity\r
- */\r
- public static final String ATTRIB_USER_FRIENDLY_DESCRIPTION = "userFriendlyDescription";\r
- /**\r
- * The field whose value violated a constraint\r
- */\r
- public static final String ATTRIB_USER_FRIENDLY_FIELD_NAME = "userFriendlyFieldName";\r
- /**\r
- * The value violating a constraint\r
- */\r
- public static final String ATTRIB_INVALID_VALUE = "invalidValue";\r
- /**\r
- * The message from the {@link Validator} about what was wrong.\r
- */\r
- public static final String ATTRIB_VALIDATOR_MESSAGE = "validatorMessage";\r
- /**\r
- * The class of the {@link Validator} coding for the constraint\r
- */\r
- public static final String ATTRIB_VALIDATOR_CLASS = "validatorClass";\r
- /**\r
- * The class of the validated entity\r
- */\r
- public static final String ATTRIB_ENTITY_CLASS = "entityClass";\r
- /**\r
- * The id of the validated entity\r
- */\r
- public static final String ATTRIB_ENTITY_ID = "entityId";\r
-\r
- private final IWorkspaceRoot root;\r
- private final IMarker[] markers;\r
- private final List<EntityValidationResult> results;\r
- private final HashMap<Integer, EntityValidationResult> resultMap;\r
- private final HashMap<Integer, IMarker> markerMap;\r
-\r
-\r
- MarkerManager(List<EntityValidationResult> results) throws CoreException\r
- {\r
- this.root = ResourcesPlugin.getWorkspace().getRoot();\r
- this.markers = root.findMarkers(MARKER_TYPE_ID, true, IResource.DEPTH_INFINITE);\r
- this.markerMap = new HashMap<Integer, IMarker>();\r
- for (IMarker marker : markers) {\r
- markerMap.put(getDatabaseId(marker), marker);\r
- }\r
- this.results = results;\r
- this.resultMap = new HashMap<Integer, EntityValidationResult>();\r
- for (EntityValidationResult result : results) {\r
- resultMap.put(result.getId(), result);\r
- }\r
- }\r
-\r
-\r
- /**\r
- * Delete all markers that refer to errors that do not exist any longer\r
- * (i.e. the corresponding database record has been deleted).\r
- * \r
- * @return The number of deleted markers\r
- * \r
- * @throws CoreException\r
- */\r
- int deleteObsoleteMarkers() throws CoreException\r
- {\r
- int i = 0;\r
- IMarker[] markers = root.findMarkers(MARKER_TYPE_ID, true, IResource.DEPTH_INFINITE);\r
- for (IMarker marker : markers) {\r
- if (isObsoleteMarker(marker)) {\r
- ++i;\r
- marker.delete();\r
- }\r
- }\r
- return i;\r
- }\r
-\r
-\r
- /**\r
- * Create markers for new errors (i.e. no marker has been created for them\r
- * yet).\r
- * \r
- * @return The number of new markers\r
- * \r
- * @throws CoreException\r
- */\r
- int createMarkers() throws CoreException\r
- {\r
- int i = 0;\r
- IMarker[] markers = root.findMarkers(MARKER_TYPE_ID, true, IResource.DEPTH_INFINITE);\r
- for (EntityValidationResult result : results) {\r
- if (!isNewResult(result)) {\r
- continue;\r
- }\r
- Set<EntityConstraintViolation> problems = result.getEntityConstraintViolations();\r
- for (EntityConstraintViolation problem : problems) {\r
- if (markerExistsForProblem(problem, markers)) {\r
- continue;\r
- }\r
- IMarker marker = root.createMarker(MARKER_TYPE_ID);\r
- ++i;\r
- if (problem.getSeverity() == Severity.ERROR) {\r
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);\r
- }\r
- else if (problem.getSeverity() == Severity.WARNING) {\r
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);\r
- }\r
- else {\r
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);\r
- }\r
- marker.setAttribute(IMarker.MESSAGE, problem.getMessage());\r
- marker.setAttribute(ATTRIB_DATABASE_ID, result.getId());\r
- marker.setAttribute(ATTRIB_USER_FRIENDLY_TYPE_NAME, result.getUserFriendlyTypeName());\r
- marker.setAttribute(ATTRIB_USER_FRIENDLY_DESCRIPTION, result.getUserFriendlyDescription());\r
- marker.setAttribute(ATTRIB_USER_FRIENDLY_FIELD_NAME, problem.getUserFriendlyFieldName());\r
- marker.setAttribute(ATTRIB_VALIDATOR_MESSAGE, problem.getMessage());\r
- marker.setAttribute(ATTRIB_INVALID_VALUE, problem.getInvalidValue());\r
- marker.setAttribute(ATTRIB_VALIDATOR_CLASS, problem.getValidator());\r
- marker.setAttribute(ATTRIB_ENTITY_CLASS, result.getValidatedEntityClass());\r
- marker.setAttribute(ATTRIB_ENTITY_ID, result.getValidatedEntityId());\r
- }\r
- }\r
- return i;\r
- }\r
-\r
-\r
- /**\r
- * Is there a problem marker that captures the specified\r
- * {@link EntityConstraintViolation}? See\r
- * {@link #markerCapturesProblem(IMarker, EntityConstraintViolation)}.\r
- * \r
- * @param problem\r
- * @param markers\r
- * @return\r
- * @throws CoreException\r
- */\r
- private boolean markerExistsForProblem(EntityConstraintViolation problem, IMarker[] markers) throws CoreException\r
- {\r
- for (IMarker marker : markers) {\r
- if (markerCapturesProblem(marker, problem)) {\r
- return true;\r
- }\r
- }\r
- return false;\r
- }\r
-\r
-\r
- /**\r
- * <p>\r
- * This method determines whether the problem exposed by the specified\r
- * marker is <b>de facto</b> equivalent to the specified\r
- * {@code EntityConstraintViolation}. When the CVI validates an entity, it\r
- * first deletes previous validation results for that entity and only then\r
- * saves the new validation result. Thus you cannot rely on the database id\r
- * of the {@code EntityConstraintViolation} to determine equivalence. Maybe\r
- * later we can make the CVI more sophisticated in this respect. Or maybe\r
- * see if solving it through the equals() method of\r
- * {@code EntityValidationResult} and/or {@code EntityConstraintViolation}\r
- * is possible. But for now this is the easiest solution.\r
- * </p>\r
- * <p>\r
- * The reason we check for equivalence, is that we don't want to\r
- * unnecessarily update the Problems view. If a marker is there, we don't\r
- * want to replace it with an equivalent marker, because that might lead to\r
- * strange click behaviour for end users (e.g. selected problems will\r
- * disappear and re-appear unselected).\r
- * </p>\r
- * \r
- * @param marker\r
- * @param problem\r
- * @return\r
- * @throws CoreException\r
- */\r
- private static boolean markerCapturesProblem(IMarker marker, EntityConstraintViolation problem) throws CoreException\r
- {\r
- EntityValidationResult result = problem.getEntityValidationResult();\r
- if (!marker.getAttribute(ATTRIB_ENTITY_CLASS).equals(result.getValidatedEntityClass())) {\r
- return false;\r
- }\r
- if (!marker.getAttribute(ATTRIB_ENTITY_ID).equals(result.getValidatedEntityId())) {\r
- return false;\r
- }\r
- if (!marker.getAttribute(ATTRIB_USER_FRIENDLY_FIELD_NAME).equals(problem.getPropertyPath())) {\r
- return false;\r
- }\r
- if (!marker.getAttribute(ATTRIB_INVALID_VALUE).equals(problem.getInvalidValue())) {\r
- return false;\r
- }\r
- if (!marker.getAttribute(ATTRIB_VALIDATOR_CLASS).equals(problem.getValidator())) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-\r
-\r
- /**\r
- * Is this a marker without a corresponding database record (\r
- * {@link EntityValidationResult})?\r
- * \r
- * @param marker\r
- * @return\r
- * @throws CoreException\r
- */\r
- private boolean isObsoleteMarker(IMarker marker) throws CoreException\r
- {\r
- return resultMap.get(getDatabaseId(marker)) == null;\r
- }\r
-\r
-\r
- /**\r
- * Is this an {@link EntityValidationResult} for which no marker has been\r
- * created yet?\r
- * \r
- * @param result\r
- * @return\r
- */\r
- private boolean isNewResult(EntityValidationResult result)\r
- {\r
- return markerMap.get(result.getId()) == null;\r
- }\r
-\r
-\r
- /**\r
- * Get the id of the {@link EntityValidationResult} that was stored as one\r
- * of the marker's attributes.\r
- * \r
- * @param marker\r
- * @return\r
- * @throws CoreException\r
- */\r
- private static Integer getDatabaseId(IMarker marker) throws CoreException\r
- {\r
- return (Integer) marker.getAttribute(ATTRIB_DATABASE_ID);\r
- }\r
+ public static final String MARKER_TYPE_ID = "eu.etaxonomy.taxeditor.markers.validationerror";\r
+\r
+ /**\r
+ * The primary key (id) of the EntityConstraintViolation record\r
+ */\r
+ public static final String ATTRIB_DATABASE_ID = "databaseId";\r
+\r
+ // The values of the following constants must correspond to the attributes\r
+ // defined for the org.eclipse.core.resources.markers extension point in\r
+ // plugin.xml\r
+\r
+ /**\r
+ * A user-friendly description of the type of the entity\r
+ */\r
+ public static final String ATTRIB_USER_FRIENDLY_TYPE_NAME = "userFriendlyTypeName";\r
+ /**\r
+ * A user-friendly description of the entity\r
+ */\r
+ public static final String ATTRIB_USER_FRIENDLY_DESCRIPTION = "userFriendlyDescription";\r
+ /**\r
+ * The field whose value violated a constraint\r
+ */\r
+ public static final String ATTRIB_USER_FRIENDLY_FIELD_NAME = "userFriendlyFieldName";\r
+ /**\r
+ * The value violating a constraint\r
+ */\r
+ public static final String ATTRIB_INVALID_VALUE = "invalidValue";\r
+ /**\r
+ * The message from the {@link Validator} about what was wrong.\r
+ */\r
+ public static final String ATTRIB_VALIDATOR_MESSAGE = "validatorMessage";\r
+ /**\r
+ * The class of the {@link Validator} coding for the constraint\r
+ */\r
+ public static final String ATTRIB_VALIDATOR_CLASS = "validatorClass";\r
+ /**\r
+ * The class of the validated entity\r
+ */\r
+ public static final String ATTRIB_ENTITY_CLASS = "entityClass";\r
+ /**\r
+ * The id of the validated entity\r
+ */\r
+ public static final String ATTRIB_ENTITY_ID = "entityId";\r
+\r
+ private final List<EntityConstraintViolation> problems;\r
+\r
+ MarkerManager(List<EntityValidation> results) {\r
+ this.problems = new ArrayList<EntityConstraintViolation>();\r
+ for (EntityValidation result : results) {\r
+ Set<EntityConstraintViolation> problemsPerEntity = result.getEntityConstraintViolations();\r
+ for (EntityConstraintViolation problem : problemsPerEntity) {\r
+ problem.setEntityValidation(result);\r
+ problems.add(problem);\r
+ }\r
+ }\r
+ //MessagingUtils.info("Number of validation errors: " + problems.size());\r
+ }\r
+\r
+ /**\r
+ * Delete all markers that refer to errors that do not exist any longer\r
+ * (i.e. the corresponding database record has been deleted).\r
+ *\r
+ * @return The number of deleted markers\r
+ *\r
+ * @throws CoreException\r
+ */\r
+ int deleteObsoleteMarkers() throws CoreException {\r
+ int i = 0;\r
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();\r
+ IMarker[] markers = root.findMarkers(MARKER_TYPE_ID, true, IResource.DEPTH_INFINITE);\r
+ for (IMarker marker : markers) {\r
+ if (isObsoleteMarker(marker)) {\r
+ ++i;\r
+ marker.delete();\r
+ }\r
+ }\r
+ //MessagingUtils.info("Obsolete markers: " + i);\r
+ return i;\r
+ }\r
+\r
+ /**\r
+ * Create markers for new errors (i.e. no marker has been created for them\r
+ * yet).\r
+ *\r
+ * @return The number of new markers\r
+ *\r
+ * @throws CoreException\r
+ */\r
+ int createMarkers() throws CoreException {\r
+ int i = 0;\r
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();\r
+ IMarker[] markers = root.findMarkers(MARKER_TYPE_ID, true, IResource.DEPTH_INFINITE);\r
+ for (EntityConstraintViolation problem : problems) {\r
+ if (isNewProblem(problem, markers)) {\r
+ ++i;\r
+ IMarker marker = root.createMarker(MARKER_TYPE_ID);\r
+ if (problem.getSeverity() == Severity.ERROR) {\r
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);\r
+ } else if (problem.getSeverity() == Severity.WARNING) {\r
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);\r
+ } else {\r
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);\r
+ }\r
+ EntityValidation result = problem.getEntityValidation();\r
+ marker.setAttribute(IMarker.MESSAGE, problem.getMessage());\r
+ marker.setAttribute(ATTRIB_DATABASE_ID, new Integer(problem.getId()));\r
+ marker.setAttribute(ATTRIB_USER_FRIENDLY_TYPE_NAME, result.getUserFriendlyTypeName());\r
+ marker.setAttribute(ATTRIB_USER_FRIENDLY_DESCRIPTION, result.getUserFriendlyDescription());\r
+ marker.setAttribute(ATTRIB_USER_FRIENDLY_FIELD_NAME, problem.getUserFriendlyFieldName());\r
+ marker.setAttribute(ATTRIB_VALIDATOR_MESSAGE, problem.getMessage());\r
+ marker.setAttribute(ATTRIB_INVALID_VALUE, problem.getInvalidValue());\r
+ marker.setAttribute(ATTRIB_VALIDATOR_CLASS, problem.getValidator());\r
+ marker.setAttribute(ATTRIB_ENTITY_CLASS, result.getValidatedEntityClass());\r
+ marker.setAttribute(ATTRIB_ENTITY_ID, result.getValidatedEntityId());\r
+ }\r
+ }\r
+ //MessagingUtils.info("New problems: " + i);\r
+ return i;\r
+ }\r
+\r
+ private boolean isObsoleteMarker(IMarker marker) throws CoreException {\r
+ for (EntityConstraintViolation problem : problems) {\r
+ if (isMarkerForProblem(marker, problem)) {\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private static boolean isNewProblem(EntityConstraintViolation problem, IMarker[] markers) throws CoreException {\r
+ for (IMarker marker : markers) {\r
+ if (isMarkerForProblem(marker, problem)) {\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private static boolean isMarkerForProblem(IMarker marker, EntityConstraintViolation problem) throws CoreException {\r
+ if (isEqual(marker, ATTRIB_DATABASE_ID, new Integer(problem.getId()))) {\r
+ return true;\r
+ }\r
+ EntityValidation result = problem.getEntityValidation();\r
+ if (!isEqual(marker, ATTRIB_ENTITY_ID, result.getValidatedEntityId())) {\r
+ return false;\r
+ }\r
+ if (!isEqual(marker, ATTRIB_INVALID_VALUE, problem.getInvalidValue())) {\r
+ return false;\r
+ }\r
+ if (!isEqual(marker, ATTRIB_ENTITY_CLASS, result.getValidatedEntityClass())) {\r
+ return false;\r
+ }\r
+ if (!isEqual(marker, ATTRIB_USER_FRIENDLY_FIELD_NAME, problem.getUserFriendlyFieldName())) {\r
+ return false;\r
+ }\r
+ if (!isEqual(marker, ATTRIB_VALIDATOR_CLASS, problem.getValidator())) {\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private static boolean isEqual(IMarker marker, String attribute, Object value) throws CoreException {\r
+ Object val = marker.getAttribute(attribute);\r
+ boolean equal;\r
+ if (val == null) {\r
+ equal = value == null;\r
+ } else {\r
+ equal = value != null && val.equals(value);\r
+ }\r
+ return equal;\r
+ }\r
\r
}\r
import org.eclipse.core.runtime.Status;\r
import org.eclipse.core.runtime.jobs.Job;\r
\r
-import eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService;\r
-import eu.etaxonomy.cdm.api.service.IEntityValidationResultService;\r
-import eu.etaxonomy.cdm.model.validation.EntityValidationResult;\r
+import eu.etaxonomy.cdm.api.service.IEntityValidationService;\r
+import eu.etaxonomy.cdm.model.validation.EntityValidation;\r
import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
\r
/**\r
* A job that repeatedly checks the error tables and refreshes the problem\r
* markers created from them.\r
- * \r
+ *\r
* @author ayco_holleman\r
- * \r
+ *\r
*/\r
public class ValidationDaemon extends Job {\r
-\r
@SuppressWarnings("unused")\r
private static final Logger logger = Logger.getLogger(ValidationDaemon.class);\r
\r
- private final IEntityValidationResultService validationResultService;\r
- \r
- @SuppressWarnings("unused")\r
- /* Not currently needed but present for future use if/when required */\r
- private final IEntityConstraintViolationService constraintViolationService;\r
+ private final IEntityValidationService entityValidationService;\r
\r
+ // Might want to make this configurable:\r
+ private int SLEEP_TIME = 5000;\r
+ \r
private boolean cancelRequested = false;\r
\r
+\r
+\r
public ValidationDaemon(){\r
- super("Initializing validation module");\r
-// StoreUtil.info("Initializing validation module");\r
- MessagingUtils.info("Initializing validation module");\r
- constraintViolationService = CdmStore.getService(IEntityConstraintViolationService.class);\r
- validationResultService = CdmStore.getService(IEntityValidationResultService.class);\r
+ super("Running validation daemon");\r
+ entityValidationService = CdmStore.getService(IEntityValidationService.class);\r
}\r
\r
- \r
+\r
@Override\r
protected void canceling(){\r
cancelRequested = true;\r
@Override\r
protected IStatus run(IProgressMonitor monitor){\r
MarkerManager markerManager;\r
- List<EntityValidationResult> results;\r
+ List<EntityValidation> results;\r
try {\r
while (!cancelRequested) {\r
- results = validationResultService.getValidationResults();\r
+ results = entityValidationService.getValidationResults();\r
markerManager = new MarkerManager(results);\r
markerManager.deleteObsoleteMarkers();\r
markerManager.createMarkers();\r
- // Might want to make this configurable:\r
- Thread.sleep(5000);\r
+ Thread.sleep(SLEEP_TIME);\r
}\r
-// StoreUtil.info("Validation module stopped");\r
MessagingUtils.info("Validation module stopped");\r
return Status.OK_STATUS;\r
}\r
catch (Throwable t) {\r
-// StoreUtil.info("Validation module terminated unexpectedly: " + t.getMessage());\r
MessagingUtils.info("Validation module terminated unexpectedly: " + t.getMessage());\r
return Status.CANCEL_STATUS;\r
}\r
private void createTable() {
Table table = viewer.getTable();//new Table(parent, viewer.getTable().getStyle());
List<String> titles = new ArrayList<String>();
- Collections.addAll(titles, "Taxon", "Author", "Reference", "Rank");
+ Collections.addAll(titles, "Taxon", "Author", "Rank");
List<Integer> bounds = new ArrayList<Integer>();
- Collections.addAll(bounds, 300, 200, 200, 200);
+ Collections.addAll(bounds, 300, 200, 200);
Map<Integer, Boolean> restoreValuesForColumnWidth = restoreValuesForColumnWidth(titles, bounds);
createInitalDistributionColumns(table, titles, bounds, restoreValuesForColumnWidth);
table.setSortDirection(SWT.DOWN);
}
/**
* This method creates initially the distribution columns for a table. It should only be called for creation.<br>
- *<p>
+ *<p>
*
*<b>Notice:</b> If you want to add additional columns later please use <b>addTableViewerColumn()</b>
*
if (columnIndex == 1) {
table.setSortColumn(column.getColumn());
}
- if (columnIndex == 3) {
+ if (columnIndex == 2) {
/** uncommented it for now because no rank editing is wanted **/
// column.setEditingSupport(new RankEditingSupport(viewer, this));
}
- if (columnIndex >= 4) {
+ if (columnIndex >= 3) {
//read PrefrenceStore to setWidth according to last saved state
if(restoreValuesForColumnWidth.get(columnIndex)){
column.getColumn().setWidth(100);
/**
* This methods loads the last opened distribution columns for the table viewer from the prefrence store.<br>
- *<p>
+ *<p>
* <b>Notice:</b> It adds also the TitleCache to the titles list for the header of each column.<p>
- *
+ *
* @param titles
* @param bounds
* @return Map<Integer, Boolean>
}
/**
- * This method adds new DistributionColumns to an existing table.
- *
+ * This method adds new DistributionColumns to an existing table.
+ *
* @param title
* @param bound
* @param colNumber
column.setMoveable(true);
return viewerColumn;
}
-
-
-
+
+
+
/**
*
* pull data from database and set input for view
* It will hide the old distribution column and load the newly added columns.<br>
* <p>
* <b>Notice:</b> for data update please use <b>refresh()</b>
- *
+ *
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public void reload(){
}
}
}
-
+
/**
* <p>
* Getter for the field <code>service</code>.
import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
namedAreas = loadNamedAreas();
this.viewer = viewer;
}
-
+
/*
* (non-Javadoc)
*
String authorship = null;
authorship = (nonVirlaName != null) ? nonVirlaName.getAuthorshipCache() : null;
return (authorship != null) ? authorship : DEFAULT_ENTRY;
+// case 2:
+// String ref = null;
+// if (taxon.getName() != null) {
+// INomenclaturalReference nomenclaturalReference = HibernateProxyHelper.deproxy(
+// nonVirlaName.getNomenclaturalReference(), Reference.class);
+// ref = (nomenclaturalReference != null) ? nomenclaturalReference.getAbbrevTitleCache() : null;
+// }
+// return (ref != null) ? ref : DEFAULT_ENTRY;
case 2:
- String ref = null;
- if (taxon.getName() != null) {
- INomenclaturalReference nomenclaturalReference = HibernateProxyHelper.deproxy(
- nonVirlaName.getNomenclaturalReference(), Reference.class);
- ref = (nomenclaturalReference != null) ? nomenclaturalReference.getAbbrevTitleCache() : null;
- }
- return (ref != null) ? ref : DEFAULT_ENTRY;
- case 3:
String rank = null;
if (taxon.getName().getRank() != null) {
rank = taxon.getName().getRank().toString();
return (rank != null) ? rank : DEFAULT_ENTRY;
}
- if(columnIndex >3){
+ if(columnIndex >2){
for (TaxonDescription td : listTaxonDescriptions) {
for (DescriptionElementBase deb : td.getElements()) {
import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
/**
* @created Jan 24, 2011
* @version 1.0
*/
-public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails{
+public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData{
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept";
new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
configurator.setCdmAppController(repo);
configurator.setAddMediaAsMediaSpecimen(true);
- configurator.setDeterminationOnFieldUnitLevel(true);
CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
importer.invoke(configurator);
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+import eu.etaxonomy.cdm.strategy.merge.MergeException;
/**
* @author pplitzner
return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
- */
- @Override
- public DeleteResult delete(UUID uuid) {
- return defaultService.delete(uuid);
- }
+ @Override
+ public Team convertPerson2Team(Person arg0) throws MergeException,
+ IllegalArgumentException {
+ return defaultService.convertPerson2Team(arg0);
+ }
+
+ @Override
+ public Person convertTeam2Person(Team arg0) throws MergeException,
+ IllegalArgumentException {
+ return defaultService.convertTeam2Person(arg0);
+ }
}
import eu.etaxonomy.cdm.api.service.IDatabaseService;
import eu.etaxonomy.cdm.api.service.IDescriptionService;
import eu.etaxonomy.cdm.api.service.IEntityConstraintViolationService;
-import eu.etaxonomy.cdm.api.service.IEntityValidationResultService;
+import eu.etaxonomy.cdm.api.service.IEntityValidationService;
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
}
@Override
- public IEntityValidationResultService getEntityValidationResultService() {
- return defaultApplicationConfiguration.getEntityValidationResultService();
+ public IEntityValidationService getEntityValidationService() {
+ return defaultApplicationConfiguration.getEntityValidationService();
}
}
import eu.etaxonomy.cdm.api.service.DeleteResult;
import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.api.service.config.CreateHierarchyForClassificationConfigurator;
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IClassificationService#createHierarchyInClassification(java.util.Map, eu.etaxonomy.cdm.model.taxon.Classification)
- */
@Override
- public Classification createHierarchyInClassification(Classification arg1, CreateHierarchyForClassificationConfigurator arg2) {
+ public UpdateResult createHierarchyInClassification(Classification arg1, CreateHierarchyForClassificationConfigurator arg2) {
return defaultService.createHierarchyInClassification(arg1, arg2);
}
import java.util.Set;
import java.util.UUID;
-import org.hibernate.LockOptions;
-import org.hibernate.Session;
-import org.hibernate.criterion.Criterion;
-import org.hibernate.envers.query.criteria.AuditCriterion;
-
-import eu.etaxonomy.cdm.api.service.DeleteResult;
-import eu.etaxonomy.cdm.api.service.DistributionTree;
-import eu.etaxonomy.cdm.api.service.IDescriptionService;
-import eu.etaxonomy.cdm.api.service.UpdateResult;
-import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
-import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
-import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO;
-import eu.etaxonomy.cdm.api.service.pager.Pager;
-import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
-import eu.etaxonomy.cdm.model.common.Annotation;
-import eu.etaxonomy.cdm.model.common.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.ISourceable;
-import eu.etaxonomy.cdm.model.common.IdentifiableSource;
-import eu.etaxonomy.cdm.model.common.LSID;
-import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.common.Marker;
-import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
-import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
-import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
-import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
-import eu.etaxonomy.cdm.model.media.Media;
-import eu.etaxonomy.cdm.model.media.Rights;
-import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.view.AuditEvent;
-import eu.etaxonomy.cdm.model.view.AuditEventRecord;
-import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
-import eu.etaxonomy.cdm.persistence.query.Grouping;
-import eu.etaxonomy.cdm.persistence.query.MatchMode;
-import eu.etaxonomy.cdm.persistence.query.OrderHint;
-import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
-import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
-import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+import javax.print.attribute.standard.Media;
/**
* @author pplitzner
defaultService.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isPaste);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageNamedAreasInUse(java.lang.Integer, java.lang.Integer, java.util.List)
- */
- @Override
- public Pager<NamedArea> pageNamedAreasInUse(Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
- return defaultService.pageNamedAreasInUse(pageSize, pageNumber, propertyPaths);
- }
-
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.service.IDescriptionService#getOrderedDistributions(java.util.Set, boolean, boolean, java.util.Set, java.util.Set, java.util.List)
*/
return defaultService.deleteDescription(descriptionUuid);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
- */
- @Override
- public DeleteResult delete(UUID uuid) {
- return defaultService.delete(uuid);
- }
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageNamedAreasInUse(boolean, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize, Integer pageNumber) {
+ return defaultService.pageNamedAreasInUse(includeAllParents, pageSize, pageNumber);
+ }
}
import java.io.IOException;
import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
- */
- @Override
- public DeleteResult delete(UUID uuid) {
- return defaultService.delete(uuid);
- }
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.service.INameService#setAsGroupsBasionym(java.util.UUID)
}
+ @Override
+ public List<HashMap<String, String>> getNameRecords() {
+
+ return defaultService.getNameRecords();
+ }
+
+
+
}
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.dto.DerivateHierarchyDTO;
+import eu.etaxonomy.cdm.api.service.dto.FieldUnitDTO;
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO;
+import eu.etaxonomy.cdm.api.service.dto.PreservedSpecimenDTO;
import eu.etaxonomy.cdm.api.service.pager.Pager;
import eu.etaxonomy.cdm.api.service.search.SearchResult;
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.location.Country;
import eu.etaxonomy.cdm.model.media.Media;
return defaultService.findWithoutFlush(uuid);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listFieldUnitsByAssociatedTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List, java.util.List)
- */
@Override
public Collection<SpecimenOrObservationBase> listFieldUnitsByAssociatedTaxon(Taxon associatedTaxon,
List<OrderHint> orderHints, List<String> propertyPaths) {
return defaultService.listFieldUnitsByAssociatedTaxon(associatedTaxon, orderHints, propertyPaths);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#pageFieldUnitsByAssociatedTaxon(java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
- */
@Override
public Pager<SpecimenOrObservationBase> pageFieldUnitsByAssociatedTaxon(
Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize,
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#assembleDerivateHierarchyDTO(eu.etaxonomy.cdm.model.occurrence.FieldUnit, java.util.UUID)
- */
- @Override
- public DerivateHierarchyDTO assembleDerivateHierarchyDTO(FieldUnit fieldUnit, UUID associatedTaxonUuid) {
- return defaultService.assembleDerivateHierarchyDTO(fieldUnit, associatedTaxonUuid);
- }
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#assembleFieldUnitDTO(eu.etaxonomy.cdm.model.occurrence.FieldUnit, java.util.UUID)
+ */
+ @Override
+ public FieldUnitDTO assembleFieldUnitDTO(FieldUnit fieldUnit, UUID associatedTaxonUuid) {
+ return defaultService.assembleFieldUnitDTO(fieldUnit, associatedTaxonUuid);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#assemblePreservedSpecimenDTO(eu.etaxonomy.cdm.model.occurrence.DerivedUnit)
+ */
+ @Override
+ public PreservedSpecimenDTO assemblePreservedSpecimenDTO(DerivedUnit derivedUnit) {
+ return defaultService.assemblePreservedSpecimenDTO(derivedUnit);
+ }
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getNonCascadedAssociatedElements(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.api.conversation.ConversationHolder)
- */
@Override
public Collection<ICdmBase> getNonCascadedAssociatedElements(SpecimenOrObservationBase<?> specimen) {
return defaultService.getNonCascadedAssociatedElements(specimen);
return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
- */
- @Override
- public DeleteResult delete(UUID uuid) {
- return defaultService.delete(uuid);
- }
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCharacterDataForSpecimen(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase)
+ */
+ @Override
+ public Collection<DescriptionElementBase> getCharacterDataForSpecimen(SpecimenOrObservationBase<?> arg0) {
+ return defaultService.getCharacterDataForSpecimen(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCharacterDataForSpecimen(java.util.UUID)
+ */
+ @Override
+ public Collection<DescriptionElementBase> getCharacterDataForSpecimen(UUID arg0) {
+ return getCharacterDataForSpecimen(arg0);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getMostSignificantIdentifier(eu.etaxonomy.cdm.model.occurrence.DerivedUnit)
+ */
+ @Override
+ public String getMostSignificantIdentifier(DerivedUnit derivedUnit) {
+ return defaultService.getMostSignificantIdentifier(derivedUnit);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#countOccurrences(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public int countOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> config) {
+ return defaultService.countOccurrences(config);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<DerivedUnit> getAllChildDerivatives(SpecimenOrObservationBase<?> specimen) {
+ return defaultService.getAllChildDerivatives(specimen);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<SpecimenOrObservationBase<?>> getAllHierarchyDerivatives(SpecimenOrObservationBase<?> specimen) {
+ return defaultService.getAllHierarchyDerivatives(specimen);
+ }
+
}
return defaultService.findByIdentifier(clazz, identifier, identifierType, subtreeFilter, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
}
+
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(java.util.UUID, java.util.UUID, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
*/
return defaultService.deleteSynonym(synonymUuid, taxonUuid, config);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IService#delete(java.util.UUID)
- */
- @Override
- public DeleteResult delete(UUID uuid) {
- return defaultService.delete(uuid);
- }
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.service.ITaxonService#swapSynonymAndAcceptedTaxon(java.util.UUID, java.util.UUID)
return defaultService.deleteTaxon(taxonUuid, config, classificationUuid);
}
-
-
+ @Override
+ public SynonymRelationship moveSynonymToAnotherTaxon(
+ SynonymRelationship oldSynonymRelation, UUID newTaxonUUID,
+ boolean moveHomotypicGroup,
+ SynonymRelationshipType newSynonymRelationshipType,
+ Reference reference, String referenceDetail, boolean keepReference)
+ throws HomotypicalGroupChangeException {
+
+ return defaultService.moveSynonymToAnotherTaxon(oldSynonymRelation, newTaxonUUID, moveHomotypicGroup, newSynonymRelationshipType, reference, referenceDetail, keepReference);
+ }
}
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateContentProvider;
import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
/**
generateMultiLinkSingleReads();
labelProvider.setMultiLinkSingleReads(multiLinkSingleReads);
IEditorInput editorInput = getEditorInput();
- viewer.setInput(editorInput);
+ viewer.setInput(((DerivateViewEditorInput) editorInput).getRootUUIDs());
//set selection to selected derivate if only one was selected
if(editorInput instanceof DerivateViewEditorInput){
Set<UUID> derivateUUIDs = ((DerivateViewEditorInput) editorInput).getDerivateUUIDs();
DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
return derivateViewEditorInput.getName();
}
- return "Derivate View";
+ return "Derivative View";
}
/* (non-Javadoc)
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
/**
* Context menu for the creation of derivates in the derivate hierarchy.
return contributionItems;
}
- private void createMenuItem(Menu menu, String menuLabel, TreeNode selectedNode, Class<?> childClass, SpecimenOrObservationType specimenType, DerivationEventType derivationEventType) {
- MenuItem menuItem = new MenuItem(menu, SWT.NONE);
- menuItem.setText(menuLabel);
- menuItem.addSelectionListener(new WidgetSelectionListener(selectedNode, childClass, specimenType, derivationEventType));
+ private void createMenuItem(Menu menu, String menuLabel, final TreeNode selectedNode, Class<?> childClass, final SpecimenOrObservationType specimenType, final DerivationEventType derivationEventType) {
+ if(specimenType!=null && specimenType.equals(SpecimenOrObservationType.Media)){
+ //media submenu
+ MenuItem mediaItem = new MenuItem(menu, SWT.CASCADE);
+ mediaItem.setText("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("Media Specimen with existing media");
+ existingMediaItem.addSelectionListener(new SelectionAdapter() {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ //select media
+ Media media = MediaSelectionDialog.select(AbstractUtility.getShell(), null, 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
+ }
+
+ //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{
}
}
if(derivateUuids.isEmpty()){
- MessagingUtils.warningDialog("Could not open Derivate Editor", this, "No Derivates found");
+ MessagingUtils.warningDialog("Could not open Derivative Editor", this, "No Derivatives found");
return null;
}
DerivateViewEditorInput input = new DerivateViewEditorInput(derivateUuids);
try {
EditorUtil.open(input);
} catch (PartInitException e) {
- MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivate Editor", e);
+ MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
} catch (NullPointerException npe){
- MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivate Editor. The derivate hierarchy is corrupted!", npe);
+ MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivative hierarchy is corrupted!", npe);
}
}
return null;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator.DeleteConfiguratorDialog;
/**
*
confirmationQuestion += " and its children";
}
confirmationQuestion += "?";
- if(!MessagingUtils.confirmDialog("Confirm deletion", confirmationQuestion)){
+ if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfigurator, null, "Confirm Deletion", confirmationQuestion)){
return Status.CANCEL_STATUS;
}
if(((ISaveablePart) getPostOperationEnabled()).isDirty()){
derivateView = (DerivateView) getPostOperationEnabled();
}
if(derivateView==null){
- MessagingUtils.operationDialog(this, new NullPointerException("DerivateView was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel());
+ MessagingUtils.operationDialog(this, new NullPointerException("DerivativeView was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel());
return Status.CANCEL_STATUS;
}
if(derivateView.isDirty()){
return postExecute(null);
}
else{
- MessagingUtils.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+derivateView.getLabelProvider().getDerivateText(draggedNode)+"\" to \""+derivateView.getLabelProvider().getDerivateText(targetNode)+"\" is not possible!");
+ MessagingUtils.warningDialog("Moving derivatives not possible!", derivateView, "Moving \""+derivateView.getLabelProvider().getDerivateText(draggedNode)+"\" to \""+derivateView.getLabelProvider().getDerivateText(targetNode)+"\" is not possible!");
}
return Status.CANCEL_STATUS;
}
package eu.etaxonomy.taxeditor.editor.view.descriptive;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.model.common.Marker;
-import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.FeatureTree;
import eu.etaxonomy.cdm.model.description.IDescribable;
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.TermStore;
+import eu.etaxonomy.taxeditor.store.UsageTermCollection;
/**
* <p>DescriptiveContentProvider class.</p>
FeatureNodeContainer container = (FeatureNodeContainer) parentElement;
if(container.isLeaf()){
List<DescriptionElementBase> descriptionElements = container.getDescriptionElements();
- if(showOnlyIndividualAssociations){
- List<DescriptionElementBase> filteredDescriptionElements = new ArrayList<DescriptionElementBase>();
- for (DescriptionElementBase descriptionElement : descriptionElements) {
- if(descriptionElement instanceof IndividualsAssociation){
- filteredDescriptionElements.add(descriptionElement);
- }
+ List<IndividualsAssociation> individualAssociations = new ArrayList<IndividualsAssociation>();
+ for (DescriptionElementBase descriptionElement : descriptionElements) {
+ if(descriptionElement instanceof IndividualsAssociation){
+ individualAssociations.add((IndividualsAssociation) descriptionElement);
}
- descriptionElements = filteredDescriptionElements;
+ }
+ //sort individual associations by title cache of associated specimens
+ Collections.sort(individualAssociations, new Comparator<IndividualsAssociation>() {
+
+ @Override
+ public int compare(IndividualsAssociation o1, IndividualsAssociation o2) {
+ if(o1==null || o1.getAssociatedSpecimenOrObservation()==null){
+ return -1;
+ }
+ if(o2==null || o2.getAssociatedSpecimenOrObservation()==null){
+ return 1;
+ }
+ return o1.getAssociatedSpecimenOrObservation().compareTo(o2.getAssociatedSpecimenOrObservation());
+ }
+ });
+ if(showOnlyIndividualAssociations){
+ descriptionElements = new ArrayList<DescriptionElementBase>(individualAssociations);
}
return descriptionElements.toArray();
}else{
List<DescriptionBase<?>> resultDescriptions = new ArrayList<DescriptionBase<?>>();
for(DescriptionBase<?> description : elementDescriptions){
if(! description.isImageGallery()){
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
Set<Marker> descriptionMarkers = description.getMarkers();
if(descriptionMarkers != null && !descriptionMarkers.isEmpty()) {
for (Marker marker: descriptionMarkers) {
- if(!(marker.getMarkerType().equals(useMarkertype))) {
+ if(marker.getMarkerType() != null && !(marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType))) {
resultDescriptions.add(description);
}
}
return resultDescriptions;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public Object getParent(Object element) {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
/**
* <p>dispose</p>
*/
featureNodeContainerCache.clear();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
/**
* 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.
*/
* @version $Id: $
*/
public class DescriptiveLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider {
-
+
/** {@inheritDoc} */
- public String getText(Object element) {
+ @Override
+ public String getText(Object element) {
return DescriptionHelper.getLabel(element);
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
*/
/** {@inheritDoc} */
- public StyledString getStyledText(Object element) {
+ @Override
+ public StyledString getStyledText(Object element) {
return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);
}
}
package eu.etaxonomy.taxeditor.editor.view.descriptive;
-import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.GroupMarker;
public void doubleClick(DoubleClickEvent event) {
//Open derivate editor when specimen description element is double clicked
TreeSelection selection = (TreeSelection) viewer.getSelection();
- if(selection.getFirstElement() instanceof IndividualsAssociation){
- SpecimenOrObservationBase specimen = ((IndividualsAssociation)selection.getFirstElement()).getAssociatedSpecimenOrObservation();
- if(specimen!=null){
- try {
- EditorUtil.open(new DerivateViewEditorInput(Collections.singleton(specimen.getUuid())));
- } catch (PartInitException e) {
- MessagingUtils.error(DescriptiveViewPart.class, "Could not open Derivate Editor", e);
- }
+ Iterator iterator = selection.iterator();
+ Set<UUID> specimenUuids = new HashSet<UUID>();
+ while(iterator.hasNext()){
+ Object next = iterator.next();
+ if(next instanceof IndividualsAssociation){
+ SpecimenOrObservationBase<?> specimen = ((IndividualsAssociation)next).getAssociatedSpecimenOrObservation();
+ if(specimen!=null){
+ specimenUuids.add(specimen.getUuid());
+ }
+ }
+ }
+ try {
+ if(!specimenUuids.isEmpty()){
+ EditorUtil.open(new DerivateViewEditorInput(specimenUuids));
}
+ } catch (PartInitException e) {
+ MessagingUtils.error(DescriptiveViewPart.class, "Could not open Derivative Editor", e);
+ }
//TODO: extend command to accept parameter to open editor
// } catch (NotHandledException e) {
// MessagingUtils.error(DerivateSearchCompositeController.class, e);
// }
- }
}
});
@Override
protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection) {
if(AbstractUtility.getActiveEditor() == null){
+ setPartName(createPartTitle(null));
showEmptyPage();
return;
}
&& ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
&& part instanceof IPartContentHasFactualData && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){
featureNodeContainerCache.clear();
+ setPartName(createPartTitle(((IStructuredSelection) selection).getFirstElement()));
showViewer(part, (IStructuredSelection) selection);
return;
}
else{
+ setPartName(createPartTitle(null));
showEmptyPage();
}
}
+ protected String getViewName(){
+ return "Factual Data";
+ }
+
+ private String createPartTitle(Object selectedObject){
+ if(selectedObject!=null){
+ return getViewName()+": "+selectedObject;
+ }
+ return getViewName();
+ }
+
/**
*
* @author n.hoffmann
for(FeatureNodeContainerTree containerTree : featureNodeContainerCache.values()){
containerTree.buildTree();
}
+ viewer.expandToLevel(2);
viewer.refresh();
if(object instanceof DescriptionElementBase){
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
private static final String MEDIA = "isMedia";
private static final String FEATURE_NODE_CONTAINER = "isFeatureNodeContainer";
private static final String DESCRIPTION = "isDescription";
+ private static final String INDIVIDUALS_ASSOCIATION = "isIndividualsAssociation";
private static final String DESCRIPTION_ELEMENT = "isDescriptionElement";
private static final String DELETABLE = "isDeletable";
private static final String IMAGE_GALLERY = "isImageGallery";
else if(DESCRIPTION.equals(property)){
return isDescription(selectedElements);
}
+ else if(INDIVIDUALS_ASSOCIATION.equals(property)){
+ return isIndividualsAssociation(selectedElements);
+ }
else if(DESCRIPTION_ELEMENT.equals(property)){
return isDescriptionElement(selectedElements);
}
private boolean isImageGallery(Object[] selectedElements) {
for (Object object : selectedElements){
- if(!(object instanceof DescriptionBase) || !((DescriptionBase) object).isImageGallery()){
+ if(!(object instanceof DescriptionBase) || !((DescriptionBase<?>) object).isImageGallery()){
return false;
}
}
return true;
}
+ private boolean isIndividualsAssociation(Object[] selectedElements) {
+ for (Object object : selectedElements){
+ if(!(object instanceof IndividualsAssociation)){
+ return false;
+ }
+ }
+ return true;
+ }
+
private boolean isMedia(Object[] selectedElements) {
for (Object object : selectedElements){
if(!(object instanceof Media)){
public class CreateDescriptionElementOperation extends AbstractPostTaxonOperation {
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.descripti"{trunked}</code> */
- public static final String ID = "eu.etaxonomy.taxeditor.editor.description.createDescriptionElement";
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive.command.createDescriptionElement";
private final DescriptionBase<?> description;
private final Feature feature;
package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.operations.IUndoContext;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import eu.etaxonomy.cdm.api.service.DeleteResult;
import eu.etaxonomy.cdm.api.service.IDescriptionService;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
monitor.worked(20);
if (description != null){
- DeleteResult deleteResult = CdmStore.getService(IDescriptionService.class).deleteDescription(description.getUuid());
+ List<String> propertyPaths = new ArrayList<String>();
+ propertyPaths.add("taxon");
+ TaxonDescription loadedDescription = (TaxonDescription) CdmStore.getService(IDescriptionService.class).load(description.getUuid(), propertyPaths);
+ CdmStore.getService(IDescriptionService.class).deleteDescription(loadedDescription);
return postExecute(description);
}
return null;
}
else if (parentElement instanceof DescriptionBase) {
if (((DescriptionBase) parentElement).isImageGallery()) {
- return getImages((DescriptionBase) parentElement).toArray();
+ List<Media> images = getImages((DescriptionBase) parentElement);
+ if (images != null){
+ return images.toArray();
+ }
+ return null;
+
}
}
else if (parentElement instanceof DerivedUnit){
/** {@inheritDoc} */
@Override
public boolean hasChildren(Object element) {
+ if (getChildren(element)== null) {
+ return false;
+ }
return (getChildren(element).length > 0);
}
if(elements.size() > 1){
MessagingUtils.error(this.getClass(), "There should be one and only one description element to hold the images. Found: " + elements.size() + " InDescription ID: " + description.getUuid(), null);
}
+ if (!elements.isEmpty()){
+ DescriptionElementBase element = elements.iterator().next();
+ return element.getMedia();
+ }
- DescriptionElementBase element = elements.iterator().next();
-
- return element.getMedia();
+
}
return null;
}
package eu.etaxonomy.taxeditor.editor.view.media;
-import java.util.HashMap;
-import java.util.Map;
-
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.IDescribable;
-import eu.etaxonomy.cdm.model.media.IMediaDocumented;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveContentProvider;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
-import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
private TreeViewer viewer;
-
+
/*
* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION));
-
+
viewer.setContentProvider(new MediaContentProvider());
viewer.setLabelProvider(new MediaLabelProvider());
viewer.setAutoExpandLevel(2);
IEditorInput input = ((IEditorPart) part).getEditorInput();
showViewer(part, new StructuredSelection(input));
}
- else if(selection instanceof IStructuredSelection
- && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
- && part instanceof IPartContentHasFactualData && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){
+ else if(selection instanceof IStructuredSelection){
Object firstElement = ((IStructuredSelection) selection).getFirstElement();
if(firstElement instanceof TreeNode){
showViewer(part, new StructuredSelection(((TreeNode) firstElement).getValue()));
/** {@inheritDoc} */
@Override
public void changed(Object object) {
- viewer.refresh();
- //TODO: should be replaced with the possibility to set views dirty
- // when we move to Eclipse 4
- // take a look at ISaveblePart
- if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
- ((BulkEditor) part).forceDirty();
- }
- super.changed(object);
+ viewer.expandToLevel(2);
+ viewer.refresh();
+ if(object != null){
+ StructuredSelection selection = new StructuredSelection(object);
+ viewer.setSelection(selection, true);
+ }
+ //TODO: should be replaced with the possibility to set views dirty
+ // when we move to Eclipse 4
+ // take a look at ISaveblePart
+ if(part instanceof BulkEditor && !(object instanceof SpecimenOrObservationBase<?>)){
+ ((BulkEditor) part).forceDirty();
+ }
+ super.changed(object);
}
/** {@inheritDoc} */
import java.util.Map;\r
import java.util.Set;\r
\r
-import eu.etaxonomy.cdm.api.service.ITermService;\r
import eu.etaxonomy.cdm.model.common.Marker;\r
import eu.etaxonomy.cdm.model.common.MarkerType;\r
import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
import eu.etaxonomy.cdm.model.description.IDescribable;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveContentProvider;\r
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.UsageTermCollection;\r
\r
/**\r
* The class provides the required content to the Uses View\r
if(parentElement instanceof Taxon){\r
Taxon taxon = (Taxon) parentElement;\r
this.markerTypes.addAll(CdmStore.getTermManager().getPreferredTerms(MarkerType.class));\r
- for(DescriptionBase description : taxon.getDescriptions()){\r
+ for(DescriptionBase<?> description : taxon.getDescriptions()){\r
if(! description.isImageGallery()){\r
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
- Set<Marker> descriptionMarkers = description.getMarkers();\r
+ Set<Marker> descriptionMarkers = description.getMarkers();\r
if(descriptionMarkers != null) {\r
for (Marker marker: descriptionMarkers) {\r
- if(marker.getMarkerType().equals(useMarkertype)) {\r
+ if(marker.getMarkerType() != null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {\r
descriptions.add(description);\r
}\r
}\r
import eu.etaxonomy.cdm.model.description.TextData;\r
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
+import eu.etaxonomy.taxeditor.store.UsageTermCollection;\r
\r
/**\r
* UsesLabelProvider Class\r
import org.eclipse.swt.widgets.Tree;\r
\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
-import eu.etaxonomy.taxeditor.editor.UseObjectManager;\r
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;\r
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;\r
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer;\r
*/\r
public class UsesViewPart extends DescriptiveViewPart {\r
\r
- \r
- \r
public UsesViewPart() {\r
super();\r
- UseObjectManager useManager = new UseObjectManager();\r
}\r
\r
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.uses"</code> */\r
\r
}\r
\r
+ @Override\r
+ protected String getViewName(){\r
+ return "Uses";\r
+ }\r
+\r
/** {@inheritDoc} */\r
@Override\r
public boolean postOperation(CdmBase objectAffectedByOperation) {\r
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;
import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseRecordOperation;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.UsageTermCollection;
+import eu.etaxonomy.taxeditor.store.UseObjectStore;
/**
* CreateUseRecordHandler Class
@Override
protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
//Use Record Feature retrieval below
- Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);
+ Feature feature = UseObjectStore.getUseRecordFeature();
feature.setSupportsCategoricalData(true);
return new CreateUseRecordOperation(label,
EditorUtil.getUndoContext(),
\r
import org.eclipse.core.commands.ExecutionEvent;\r
\r
-import eu.etaxonomy.cdm.api.service.ITermService;\r
import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
import eu.etaxonomy.cdm.model.description.Feature;\r
import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;\r
import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseSummaryOperation;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.UseObjectStore;\r
\r
/**\r
* CreateUseSummaryHandler Class\r
@Override\r
protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {\r
//Use Record Feature retrieval below\r
- Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
+ Feature feature = UseObjectStore.getUseSummaryFeature();\r
+ \r
feature.setSupportsTextData(true);\r
return new CreateUseSummaryOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled);\r
}\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.IStatus;\r
\r
-import eu.etaxonomy.cdm.api.service.ITermService;\r
import eu.etaxonomy.cdm.model.common.Marker;\r
import eu.etaxonomy.cdm.model.common.MarkerType;\r
import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.UseObjectStore;\r
\r
/**\r
* CreateTaxonUseOperation Class\r
super(label, undoContext, taxon, postOperationEnabled);\r
}\r
\r
- /* (non-Javadoc)\r
- * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)\r
- */\r
+\r
/** {@inheritDoc} */\r
@Override\r
public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
\r
description = TaxonDescription.NewInstance(element);\r
monitor.worked(20);\r
- MarkerType useMarkerType = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
+ MarkerType useMarkerType = UseObjectStore.getUseMarkerType();\r
marker = Marker.NewInstance(useMarkerType, true);\r
description.addMarker(marker);\r
monitor.worked(40);\r
<feature
id="eu.etaxonomy.taxeditor.feature.platform"
label="Taxeditor Dependencies"
- version="3.4.1.qualifier"
+ version="3.5.2.qualifier"
os="linux,macosx,win32"
ws="cocoa,gtk,win32"
arch="x86,x86_64">
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.equinox.p2.publisher.eclipse"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.update.configurator"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eu.etaxonomy.taxeditor.feature.platform</artifactId>
--- /dev/null
+when updating the build.properties file make sure to apply the updates on both
+build.properties.with.jre and
+build.properties.wo.jre
--- /dev/null
+
+root.linux.gtk.x86_64=linux-64
+root.linux.gtk.x86_64.permissions.755=jre/bin/**
+root.linux.gtk.x86=linux-32
+root.linux.gtk.x86.permissions.755=jre/bin/**
+root.win32.win32.x86_64=win-64
+root.win32.win32.x86_64.permissions.755=jre/bin/**
+root.win32.win32.x86=win-32
+root.win32.win32.x86.permissions.755=jre/bin/**
+root.macosx.cocoa.x86_64=mac-64
+root.macosx.cocoa.x86_64.permissions.755=jre/bin/**
\ No newline at end of file
<feature
id="eu.etaxonomy.taxeditor.feature"
label="Taxonomic Editor"
- version="3.4.1.qualifier"
+ version="3.5.2.qualifier"
provider-name="EDIT"
plugin="eu.etaxonomy.taxeditor.application"
os="linux,macosx,win32"
<import plugin="org.eclipse.jface"/>
<import plugin="org.eclipse.swt"/>
<import plugin="org.eclipse.equinox.common" version="3.6.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.update.configurator"/>
+ <import plugin="org.eclipse.equinox.p2.publisher.eclipse"/>
</requires>
<plugin
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
- <packaging>eclipse-feature</packaging>
-
- <name>Taxonomic Editor Feature</name>
- <description/>
- <url>http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditorEditorBundle</url>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>taxeditor-parent</artifactId>
+ <version>3.5.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+
+ <name>Taxonomic Editor Feature</name>
+ <description />
+ <url>http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditorEditorBundle</url>
</project>
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="target"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="src" path="src"/>\r
+ <classpathentry kind="output" path="target"/>\r
+</classpath>\r
Bundle-ManifestVersion: 2
Bundle-Name: Help
Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator
Bundle-Vendor: EDIT
Require-Bundle: org.eclipse.ui,
<p><img src="../img/2_6a.jpg" alt="" /></p>
-<p><strong>Tip!</strong> A CDM datasource will have a user named admin with password '00000', so you can login immediately. The default password should the be changed.</p>
+<p><strong>Tip!</strong> A CDM datasource will have a user named <b>admin</b> with password <b>'00000'</b>, so you can login immediately. The default password should the be changed.</p>
\ No newline at end of file
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
Bundle-ManifestVersion: 2
Bundle-Name: Navigation Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.cdm,
eu.etaxonomy.taxeditor.navigation,
command.label.3 = Classification\r
command.label.4 = Open in Checklist Editor\r
command.label.5 = Edit\r
-command.label.6 = Change Accepted Taxon to Synonym\r
-command.label.7 = Move Taxon (with child taxa)\r
+command.label.6 = Change accepted taxon to synonym\r
+command.label.7 = Move taxon (with child taxa)\r
command.label.8 = Import...\r
command.label.9 = Export...\r
command.label.10 = Delete\r
command.label.17 = List\r
command.label.18 = Key Nodes\r
command.label.19 = Delete\r
+command.label.fixClassificationHierarchy = Create taxon hierarchy\r
command.name = New Taxon Node\r
-command.name.0 = New Classification\r
+command.name.0 = New classification\r
command.name.1 = Edit\r
-command.name.2 = Move Taxon\r
+command.name.2 = Move taxon\r
command.name.3 = Refresh\r
command.name.4 = Copy\r
-command.name.5 = Change Accepted Taxon to Synonym\r
+command.name.5 = Change accepted taxon to synonym\r
command.name.6 = New Polytomous Key\r
-command.name.7 = Edit Polytomous Key Nodes\r
-command.name.8 = Refresh Polytomous Key List\r
-command.name.9 = Refresh Polytomous Key Nodes\r
+command.name.7 = Edit Polytomous Key nodes\r
+command.name.8 = Refresh Polytomous Key list\r
+command.name.9 = Refresh Polytomous Key nodes\r
+command.name.10 = Fix Classification Hierarchy\r
+\r
view.name.2 = Taxonomic Tree\r
navigatorContent.name = Classification\r
navigatorContent.name.0 = TaxonNode\r
-navigatorContent.name.1 = Synonyms (experimental)
\ No newline at end of file
+navigatorContent.name.1 = Synonyms (experimental)\r
+command.label.moveFactualData = Move factual data to another taxon\r
+command.name.moveFactualData = Move factual data
\ No newline at end of file
view.name.1 = Polytomous Keys\r
command.label = Taxon Navigator\r
command.label.0 = Polytomous Keys\r
-command.label.1 = Edit\r
+command.label.1 = Bearbeiten\r
menu.label = Neu\r
command.label.2 = Taxon\r
command.label.3 = Klassifikation\r
command.label.4 = \u00D6ffne im Checklisten Editor\r
command.label.5 = Bearbeiten\r
command.label.6 = Akzeptiertes Taxon zum Synonym umwandeln\r
-command.label.7 = Verschiebe Taxon (with child taxa)\r
+command.label.7 = Verschiebe Taxon (mit Kindern)\r
command.label.8 = Importieren\r
command.label.9 = Exportieren\r
command.label.10 = L\u00F6schen\r
command.label.14 = Klassifikation\r
command.label.15 = Neu\r
command.label.16 = Bearbeiten\r
+command.label.fixClassificationHierarchy = Erzeuge Taxon-Hierarchie\r
+\r
menu.label.0 = Aktualisieren\r
command.label.17 = Liste\r
-command.label.18 = Key Nodes\r
+command.label.18 = Schl�sselknoten\r
command.label.19 = L\u00F6schen\r
command.name = Neuer Taxonknoten\r
command.name.0 = Neue Klassifikation\r
command.name.1 = Bearbeiten\r
command.name.2 = Verschiebe Taxon\r
-command.name.3 = Refresh\r
-command.name.4 = Copy\r
-command.name.5 = Change Accepted Taxon to Synonym\r
-command.name.6 = New Polytomous Key\r
-command.name.7 = Edit Polytomous Key Nodes\r
-command.name.8 = Aktualisieren Polytomous Key List\r
-command.name.9 = Aktualisieren Polytomous Key Knoten\r
+command.name.3 = Aktualisieren\r
+command.name.4 = Kopieren\r
+command.name.5 = Verschiebe akzeptiertes Taxon in Synonymie\r
+command.name.6 = Neuer Polytomer Schl�ssel\r
+command.name.7 = Bearbeite Schl�ssel-Knoten\r
+command.name.8 = Aktualisiere Schl�ssel-Liste\r
+command.name.9 = Aktualisiere Schl�ssel-Knoten\r
+command.name.10 = Erzeuge Taxon-Hierarchie\r
view.name.2 = Taxonomiebaum\r
navigatorContent.name = Klassifikation\r
navigatorContent.name.0 = Taxonknoten\r
-navigatorContent.name.1 = Synonyme (experimental)
\ No newline at end of file
+navigatorContent.name.1 = Synonyme (experimentell)\r
+command.label.moveFactualData = Verschiebe Faktendaten zu Taxon\r
+command.name.moveFactualData = Verschiebe Faktendaten
\ No newline at end of file
+++ /dev/null
-#Properties file for eu.etaxonomy.taxeditor.navigation\r
-view.name = Search Result\r
-view.name.0 = Taxon Navigator\r
-view.name.1 = Polytomous Keys\r
-command.label = Taxon Navigator\r
-command.label.0 = Polytomous Keys\r
-command.label.1 = Edit\r
-menu.label = New\r
-command.label.2 = Taxon\r
-command.label.3 = Classification\r
-command.label.4 = Open in Checklist Editor\r
-command.label.5 = Edit\r
-command.label.6 = Change Accepted Taxon to Synonym\r
-command.label.7 = Move Taxon (with child taxa)\r
-command.label.8 = Import...\r
-command.label.9 = Export...\r
-command.label.10 = Delete\r
-command.label.11 = Refresh\r
-command.label.12 = Copy\r
-command.label.13 = Taxon\r
-command.label.14 = Classification\r
-command.label.15 = New\r
-command.label.16 = Edit\r
-menu.label.0 = Refresh\r
-command.label.17 = List\r
-command.label.18 = Key Nodes\r
-command.label.19 = Delete\r
-command.name = New Taxon Node\r
-command.name.0 = New Classification\r
-command.name.1 = Edit\r
-command.name.2 = Move Taxon\r
-command.name.3 = Refresh\r
-command.name.4 = Copy\r
-command.name.5 = Change Accepted Taxon to Synonym\r
-command.name.6 = New Polytomous Key\r
-command.name.7 = Edit Polytomous Key Nodes\r
-command.name.8 = Refresh Polytomous Key List\r
-command.name.9 = Refresh Polytomous Key Nodes\r
-view.name.2 = Taxonomic Tree\r
-navigatorContent.name = Classification\r
-navigatorContent.name.0 = TaxonNode\r
-navigatorContent.name.1 = Synonyms (experimental)
\ No newline at end of file
SearchBar_2=Could not execute search\r
SearchBar_3=Please type at least one character when using the "*" wildcard.\r
SearchBar_4=Error opening search result.\r
-SearchBar_5=configuration menu clicked\r
SearchBar_6=Taxa\r
SearchBar_7=Synonyms\r
SearchBar_8=Names (without taxa)\r
SearchBar_0=Benutze "*" f\u00FCr Platzhalter-Suche\r
SearchBar_1=Suche\r
SearchBar_2=Suche konnte nicht ausgef\u00FChrt werden\r
-SearchBar_3=Bitte geben Sie mindestens ein Zeichen, wenn Sie die "*" Platzhalter benutzen wollen\r
+SearchBar_3=Bitte geben Sie mindestens ein Zeichen ein, wenn Sie den "*" Platzhalter benutzen wollen\r
SearchBar_4=Fehler beim f\u00fcffnen des Suchergebnisses\r
-SearchBar_5=Konfigurationsmenü angeklickt\r
SearchBar_6=Taxa\r
SearchBar_7=Synonyme\r
SearchBar_8=Namen (ohne Taxa)\r
+++ /dev/null
-SearchBar_0=Use "*" for wildcard searching\r
-SearchBar_1=Search\r
-SearchBar_2=Could not execute search\r
-SearchBar_3=Please type at least one character when using the "*" wildcard.\r
-SearchBar_4=Error opening search result.\r
-SearchBar_5=configuration menu clicked\r
-SearchBar_6=Taxa\r
-SearchBar_7=Synonyms\r
-SearchBar_8=Names (without taxa)\r
-SearchBar_9=Common Names\r
icons/,\
p2.inf,\
OSGI-INF/l10n/bundle.properties,\
- OSGI-INF/l10n/bundle_en.properties,\
OSGI-INF/l10n/bundle_de.properties,\
OSGI-INF/l10n/messages.properties,\
- OSGI-INF/l10n/messages_en.properties,\
OSGI-INF/l10n/messages_de.properties
</and>
</visibleWhen>
</command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.navigation.navigator.handler.OpenFixClassificationHierarchyHandler"
+ label="%command.label.fixClassificationHierarchy"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <and>
+ <reference
+ definitionId="isShowExperimentalFeatures">
+ </reference>
+ <reference
+ definitionId="isClassification">
+ </reference>
+ </and>
+ </visibleWhen>
+ </command>
<separator
name="taxeditor-navigation.separator1"
visible="true">
</command>
<command
commandId="eu.etaxonomy.taxeditor.navigation.moveFactualData"
- label="Move factual data to another taxon"
+ label="%command.label.moveFactualData"
style="push">
<visibleWhen
checkEnabled="true">
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.navigation.command.delete"
label="%command.label.10"
style="push">
<visibleWhen
style="push">
<visibleWhen
checkEnabled="true">
- <reference
- definitionId="isCdmStoreConnected">
- </reference>
+ <and>
+ <reference
+ definitionId="isCdmStoreConnected">
+ </reference>
+ <reference
+ definitionId="isTaxonNode">
+ </reference></and>
</visibleWhen>
</command>
</menuContribution>
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.command.delete"
label="%command.label.19"
style="push">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.MoveFactualDataHandler"
id="eu.etaxonomy.taxeditor.navigation.moveFactualData"
- name="Move Factual Data">
+ name="%command.name.moveFactualData">
+ </command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.CreateClassificationHierarchyHandler"
+ id="eu.etaxonomy.taxeditor.navigation.navigator.handler.OpenFixClassificationHierarchyHandler"
+ name="%command.name.10">
+ </command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.DeleteHandler"
+ id="eu.etaxonomy.taxeditor.navigation.command.delete"
+ name="delete">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="eu.etaxonomy.taxeditor.navigation.navigator.handler.DeleteHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.navigation.navigator.command.delete">
<activeWhen>
<with
variable="activePartId">
</handler>
<handler
class="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.DeleteHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.command.delete">
<activeWhen>
<with
variable="activePartId">
class="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
id="eu.etaxonomy.taxeditor.preferences.propertyTester"
namespace="eu.etaxonomy.taxeditor.preferences.propertyTester"
- properties="isChecklistEditorEnabled"
+ properties="isShowExperimentalFeatures, isChecklistEditorEnabled"
type="org.eclipse.jface.viewers.IStructuredSelection">
</propertyTester>
<propertyTester
- class="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
- id="eu.etaxonomy.taxeditor.preferences.propertyTester"
- namespace="eu.etaxonomy.taxeditor.preferences.propertyTester"
+ class="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
+ id="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
+ namespace="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
properties="isCdmStoreConnected"
- type="org.eclipse.jface.viewers.IStructuredSelection">
+ type="java.lang.Object">
</propertyTester>
</extension>
<extension
</definition>
<definition
id="isCdmStoreConnected">
+ <test
+ property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isCdmStoreConnected">
+ </test>
+ </definition>
+ <definition
+ id="isShowExperimentalFeatures">
<with
variable="selection">
<test
- property="eu.etaxonomy.taxeditor.preferences.propertyTester.isCdmStoreConnected">
+ property="eu.etaxonomy.taxeditor.preferences.propertyTester.isShowExperimentalFeatures">
</test>
</with>
</definition>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
package eu.etaxonomy.taxeditor.navigation.navigator;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Observable;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonComparatorSearch;
+import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.DataChangeBridge;
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
/** {@inheritDoc} */
@Override
protected IAdaptable getInitialInput() {
-
- TaxonComparatorSearch comparator = new TaxonComparatorSearch();
+ Comparator comparator;
+ if (PreferencesUtil.getSortNodesNaturally()){
+ comparator = new TaxonNaturalComparator();
+ } else{
+ comparator = new TaxonComparatorSearch();
+ }
TaxonNodeComparator viewerComparator = new TaxonNodeComparator(comparator);
this.getCommonViewer().setComparator(viewerComparator);
setLinkingEnabled(true);
import eu.etaxonomy.cdm.model.taxon.Classification;\r
import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
import eu.etaxonomy.cdm.model.taxon.TaxonComparatorSearch;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator;\r
import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
import eu.etaxonomy.taxeditor.ui.section.supplemental.IdentifiableSourceElement;\r
\r
public class TaxonNodeComparator extends ViewerComparator{\r
\r
\r
- public TaxonNodeComparator(TaxonComparatorSearch comparator) {\r
+ public TaxonNodeComparator(Comparator<TaxonBase> comparator){\r
super(comparator);\r
}\r
\r
if (e1 instanceof Classification && e2 instanceof Classification){\r
return ((Classification)e1).getTitleCache().compareTo(((Classification)e2).getTitleCache());\r
} else{\r
- return this.getComparator().compare(((TaxonNode)e1).getTaxon(),((TaxonNode)e2).getTaxon());\r
+ if (this.getComparator() instanceof TaxonNaturalComparator){\r
+ return this.getComparator().compare((TaxonNode)e1, (TaxonNode)e2);\r
+ }else{\r
+ return this.getComparator().compare(((TaxonNode)e1).getTaxon(),((TaxonNode)e2).getTaxon());\r
+ }\r
}\r
}\r
}\r
import org.eclipse.ui.navigator.CommonDropAdapter;
import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
public IStatus handleDrop(CommonDropAdapter dropAdapter,
DropTargetEvent dropTargetEvent, Object target) {
+
if (target instanceof ITaxonTreeNode) {
Set<TaxonNode> taxonNodes = getSelectedTaxa();
ITaxonTreeNode targetTreeNode = (ITaxonTreeNode) target;
+ if (targetTreeNode instanceof Classification){
+ targetTreeNode = ((Classification)targetTreeNode).getRootNode();
+ targetTreeNode = HibernateProxyHelper.deproxy(targetTreeNode, TaxonNode.class);
+ }
if(taxonNodes != null) {
- return moveTaxon(taxonNodes, targetTreeNode);
+ if (taxonNodes.size() == 1){
+ return moveTaxon(taxonNodes.iterator().next(), targetTreeNode);
+ } else{
+ if( MessageDialog.openConfirm(null, "Moving taxon", "The operation move accepted taxon to other parent is available only for a single taxon.")){
+ return null;
+ }
+ }
}
}
* @param parentTaxon
* @return
*/
- private IStatus moveTaxon(Set<TaxonNode> taxonNodes, ITaxonTreeNode targetITaxonTreeNode) {
+ private IStatus moveTaxon(TaxonNode taxonNode, ITaxonTreeNode targetITaxonTreeNode) {
TaxonNavigator taxonNavigator;
taxonNavigator = (TaxonNavigator) NavigationUtil.showView(TaxonNavigator.ID);
if(targetITaxonTreeNode instanceof TaxonNode){
TaxonNode targetTaxonNode = (TaxonNode) targetITaxonTreeNode;
-
-// for(TaxonNode taxonNode : taxonNodes){
-// if (taxonNode.equals(targetTaxonNode)) {
-// return Status.CANCEL_STATUS;
-// }
-// }
-
- // Make sure parent taxon does not have unsaved changes
+ // Make sure parent taxon does not have unsaved changes
if (NavigationUtil.isDirty(targetTaxonNode)){
MessageDialog.openWarning(NavigationUtil.getShell(), "Unsaved Parent Taxon", "There are unsaved " +
"changes in the parent taxon. Pleas save first.");
return Status.CANCEL_STATUS;
}
+ }
+ if (!PreferencesUtil.getSortNodesNaturally()){
+ IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
+ if (workspaceUndoContext == null) {
+ logger.error("Workspace undo context is null. DND operation cancelled");
+ return Status.CANCEL_STATUS;
+ }
+
+ AbstractPostOperation operation = new MoveTaxonOperation
+ ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+ NavigationUtil.executeOperation(operation);
- // Make sure parentTaxon is not the drop target
-// if (!childTaxonNode.isTopmostNode() && childTaxonNode.getParent().equals(targetTaxonNode)){
-// return Status.CANCEL_STATUS;
-// }
+ logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
+ return Status.OK_STATUS;
+ }else{
+ String[] buttonLables = {"Parent", "Predecessor", "Cancel"};
+ MessageDialog dialog = new MessageDialog(null, "Target node", null, "Do you want to use the target node as parent or do you want to move the taxon below the target.", MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
+ dialog.open();
+ int returnCode = dialog.getReturnCode();
+ if (returnCode == 0){
+ IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
+ if (workspaceUndoContext == null) {
+ logger.error("Workspace undo context is null. DND operation cancelled");
+ return Status.CANCEL_STATUS;
+ }
- // Make sure taxon is not being dropped onto itself
-// if (childTaxonNode.equals(targetTaxonNode)) {
-// return Status.CANCEL_STATUS;
-// }
+ AbstractPostOperation operation = new MoveTaxonOperation
+ ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+ NavigationUtil.executeOperation(operation);
+ logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
+ return Status.OK_STATUS;
+ }else if (returnCode == 1){
+ IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
+ if (workspaceUndoContext == null) {
+ logger.error("Workspace undo context is null. DND operation cancelled");
+ return Status.CANCEL_STATUS;
+ }
+ AbstractPostOperation operation = new MoveTaxonOperation
+ ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, false);
+ NavigationUtil.executeOperation(operation);
+
+ logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
+ return Status.OK_STATUS;
+ } else{
+ return Status.CANCEL_STATUS;
+ }
- }
- IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
- if (workspaceUndoContext == null) {
- logger.error("Workspace undo context is null. DND operation cancelled");
- return Status.CANCEL_STATUS;
}
- AbstractPostOperation operation = new MoveTaxonOperation("Move Taxon",
- workspaceUndoContext,
- taxonNodes,
- targetITaxonTreeNode,
- this,
- taxonNavigator,
- taxonNavigator);
- NavigationUtil.executeOperation(operation);
-
- logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
- return Status.OK_STATUS;
}
/* (non-Javadoc)
--- /dev/null
+package eu.etaxonomy.taxeditor.navigation.navigator.handler;
+
+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.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
+import eu.etaxonomy.taxeditor.navigation.operation.CreateNewTaxonHierarchyOperation;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+
+public class CreateClassificationHierarchyHandler extends AbstractHandler {
+
+ private static final Logger logger = Logger.getLogger(CreateClassificationHierarchyHandler.class);
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+ * ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+ if (currentSelection instanceof IStructuredSelection) {
+ Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
+ if (selectedElement instanceof Classification) {
+
+ Classification classification = (Classification) selectedElement;
+ try {
+ TaxonNavigator taxonNavigator = (TaxonNavigator)AbstractUtility.showView(TaxonNavigator.ID);
+// IClassificationService service = CdmStore.getService(IClassificationService.class);
+
+ // Map<String, List<TaxonNode>> sortedGenusList =
+ // service.getSortedGenusList(classification.getAllNodes());
+
+
+ CreateNewTaxonHierarchyOperation operation = new CreateNewTaxonHierarchyOperation("Create Taxon Hierarchy", StoreUtil.getUndoContext(),classification,NavigationUtil.getNavigator(false), NavigationUtil.getNavigator(false) );
+
+ AbstractUtility.executeOperation(operation);
+// UpdateResult result = service.createHierarchyInClassification(classification, null);
+//
+// Classification classification2 = CdmBase.deproxy(result.getCdmEntity(), Classification.class);
+//
+// Set<CdmBase> updatedObjects = result.getUpdatedObjects();
+//
+// Shell activeShell = HandlerUtil.getActiveShell(event);
+
+// MessagingUtils.messageDialog("Add Hierarchy successful",
+// FixClassificationHierarchyHandler.class, "Operation 'Fix Hierarchy' was successful. New classification is "
+// + classification2.getTitleCache() + "\nUpdated Objects: " + updatedObjects.size());
+ //Success
+ taxonNavigator.refresh();
+ } catch (Exception e) {
+ MessagingUtils.messageDialog("Failed to open Editor", CreateClassificationHierarchyHandler.class,
+ "Could not open ChecklistView. The hierarchy is corrupted!", e);
+ }
+ }
+ }
+ return null;
+ }
+
+}
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.ui.dialog.DeleteConfiguratorDialog;
-import eu.etaxonomy.taxeditor.ui.dialog.DeleteTaxonConfiguratorDialog;
+import eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator.DeleteConfiguratorDialog;
/**
* <p>DeleteTreeNodeHandler class.</p>
ITaxonTreeNode taxonNode =treeNode;
TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
if (taxonNode instanceof Classification && taxonNode.hasChildNodes()){
- if(!DeleteTaxonConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification? The tree has children, they will be deleted, too.")){
+ if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification? The tree has children, they will be deleted, too.")){
return null;
}
} else if (taxonNode instanceof Classification && !taxonNode.hasChildNodes()){
- if(!DeleteTaxonConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification?")){
+ if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification?")){
return null;
}
} else {
if (taxonNode.hasChildNodes()){
- DeleteConfiguratorDialog dialog = new DeleteTaxonConfiguratorDialog(
+ DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(
config,
HandlerUtil.getActiveShell(event),
"Confirm Deletion",
}
}else{
- if(!DeleteTaxonConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
+ if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
return null;
}
}
}
} else{
try{
- if(!DeleteTaxonConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected nodes?")){
+ if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected nodes?")){
return null;
}
if (allEditorsClosed){
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection instanceof StructuredSelection){
- final StructuredSelection structuredSelection = (StructuredSelection) selection;
+ if(selection instanceof IStructuredSelection){
+ final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof Classification){
Classification classification = (Classification) structuredSelection.getFirstElement();
package eu.etaxonomy.taxeditor.navigation.navigator.handler;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import java.util.UUID;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.handlers.HandlerUtil;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
/**
public class MoveTaxonHandler extends AbstractHandler implements IPostOperationEnabled {
private TaxonNode parentTaxonNode;
-
+ protected IWorkbenchPage activePage;
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
/** {@inheritDoc} */
+
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- TaxonNavigator taxonNavigator = NavigationUtil.showNavigator();
+ activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
+ TaxonNavigator taxonNavigator = (TaxonNavigator)NavigationUtil.showView(TaxonNavigator.ID);
TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
Iterator selectionIterator = selection.iterator();
- Set<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
+ TaxonNode taxonNode = null;
+ UUID taxonNodeUUID = null;
// do not show the current selection
List<UUID> excludeTaxa = new ArrayList<UUID>();
- while (selectionIterator.hasNext()){
+ if (selection.size() == 1){
Object object = selectionIterator.next();
if(object instanceof TaxonNode){
- TaxonNode taxonNode = (TaxonNode) object;
- taxonNodes.add(taxonNode);
+ taxonNode = HibernateProxyHelper.deproxy(object,TaxonNode.class);
+ taxonNodeUUID = taxonNode.getUuid();
excludeTaxa.add(taxonNode.getTaxon().getUuid());
}
+ } else{
+ if( MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Moving taxon", "The operation move accepted taxon to other parent is available only for a single taxon.")){
+ return null;
+ }
}
-// TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
- parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose new parent", excludeTaxa, null, null);
- if(parentTaxonNode != null){
- if(NavigationUtil.isDirty(parentTaxonNode)){
- MessageDialog.openWarning(HandlerUtil.getActiveShell(event), "Unsaved Parent Taxon", "There are unsaved " +
- "changes in the parent taxon. Please save first.");
- return null;
+// TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
+ if (taxonNode != null){
+ boolean moveToNewParent = true;
+ if (PreferencesUtil.getSortNodesNaturally()){
+ if(!MessageDialog.openQuestion(null, "Target node", "The choosen target node should be the parent?")){
+ moveToNewParent = false;
+ }
+ parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose the taxon above the moved taxon.", excludeTaxa, null, null);
+ }else{
+ parentTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), taxonNavigator.getConversationHolder(), "Choose new parent", excludeTaxa, null, null);
}
+ if(parentTaxonNode != null){
+ if(NavigationUtil.isDirty(parentTaxonNode)){
+ MessageDialog.openWarning(HandlerUtil.getActiveShell(event), "Unsaved Parent Taxon", "There are unsaved " +
+ "changes in the parent taxon. Please save first.");
+ return null;
+ }
+
+ AbstractPostOperation operation = new MoveTaxonOperation
+ ("Move taxon to new parent", NavigationUtil.getUndoContext(),
+ taxonNode, parentTaxonNode, taxonNavigator, taxonNavigator, moveToNewParent); //$NON-NLS-1$
+ NavigationUtil.executeOperation(operation);
+ taxonNavigator.refresh();
- AbstractPostOperation operation = new MoveTaxonOperation("Move taxon to new parent",
- NavigationUtil.getUndoContext(),
- taxonNodes,
- parentTaxonNode,
- this,
- taxonNavigator,
- taxonNavigator); //$NON-NLS-1$
- NavigationUtil.executeOperation(operation);
-
+ }
}
return null;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
private final TaxonNode newAcceptedTaxonNode;
private final ICdmEntitySessionEnabled cdmEntitySessionEnabled;
+
//private TaxonNode oldTaxonNode;
/**
bind();
Taxon oldTaxon = (Taxon) HibernateProxyHelper.deproxy(((TaxonNode) taxonNode).getTaxon());
-
- UpdateResult result = CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(taxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
+ try {
+ UpdateResult result = CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(taxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
+ } catch (IllegalArgumentException e) {
+ MessagingUtils.errorDialog("Operation failed", this, e.getMessage(), TaxeditorNavigationPlugin.PLUGIN_ID, e, false);
+ return Status.CANCEL_STATUS;
+ }
monitor.worked(40);
+
return postExecute(oldTaxon);
}
package eu.etaxonomy.taxeditor.navigation.navigator.operation;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
-import eu.etaxonomy.cdm.model.taxon.IllegalAncestryException;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
/**
* A reference to the former taxonomical parents
*/
+
private final Map<TaxonNode, ITaxonTreeNode> oldParentTreeNodes;
private final Set<TaxonNode> taxonNodes;
+ private final TaxonNode taxonNode;
+ private final boolean moveToParentNode;
/**
* <p>Constructor for MoveTaxonOperation.</p>
*
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
* @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
*/
+
public MoveTaxonOperation(String label,
IUndoContext undoContext,
- Set<TaxonNode> taxonNodes,
+ TaxonNode taxonNodeToMove,
ITaxonTreeNode newParentTreeNode,
IPostOperationEnabled postOperationEnabled,
IConversationEnabled conversationEnabled,
- ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+ ICdmEntitySessionEnabled cdmEntitySessionEnabled,
+ boolean moveToParentNode) {
super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
- this.taxonNodes = taxonNodes;
+ this.taxonNode = taxonNodeToMove;
+ /*for (TaxonNode node:taxonNodes){
+ this.taxonNodes.add(service.load(node.getUuid()));
+ }*/
- this.newParentTreeNode = newParentTreeNode;
+ this.newParentTreeNode = newParentTreeNode;
+ this.moveToParentNode = moveToParentNode;
// Save old parent ITaxonTreeNodes for undo
- oldParentTreeNodes = new HashMap<TaxonNode, ITaxonTreeNode>();
- for(TaxonNode taxonNode : taxonNodes){
- this.oldParentTreeNodes.put(taxonNode, taxonNode.getParent());
- }
+ //this.parentNode = taxonNode.getParent();
}
bind();
monitor.worked(20);
-
- try {
- for (TaxonNode taxonNode : taxonNodes){
- UpdateResult result = CdmStore.getService( ITaxonNodeService.class).moveTaxonNode(taxonNode.getUuid(), newParentTreeNode.getUuid());
- monitor.worked(2);
- }
-
-
-
- } catch(IllegalAncestryException e) {
- MessagingUtils.warningDialog("Illegal ancestry", this, e.getMessage());
- }
+ UpdateResult result = CdmStore.getService(ITaxonNodeService.class).moveTaxonNode(this.taxonNode.getUuid(),newParentTreeNode.getUuid(), moveToParentNode);
+// try {
+// for (TaxonNode taxonNode : taxonNodes){
+// TaxonNode newTaxonNode = newParentTreeNode.addChildNode(taxonNode,
+// newParentTreeNode.getReference(), newParentTreeNode.getMicroReference());
+// //taxonNodes.add(newTaxonNode);
+//
+// monitor.worked(2);
+// }
+// } catch(IllegalAncestryException e) {
+// MessagingUtils.warningDialog("Illegal ancestry", this, e.getMessage());
+// }
monitor.worked(40);
return postExecute(null);
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.navigation.operation;
+
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author a.oppermann
+ * @date 28.04.2015
+ *
+ */
+public class CreateNewTaxonHierarchyOperation extends AbstractPersistentPostOperation {
+
+ private final Classification classification;
+
+ private final IClassificationService service;
+
+ /**
+ * @param label
+ * @param undoContext
+ */
+ public CreateNewTaxonHierarchyOperation(String label, IUndoContext undoContext, Classification classification,
+ IPostOperationEnabled postOperationEnabled,
+ IConversationEnabled conversationEnabled) {
+ super(label, undoContext, postOperationEnabled, conversationEnabled);
+
+ this.classification = classification;
+ this.service = CdmStore.getService(IClassificationService.class);
+
+ }
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ monitor.worked(20);
+ UpdateResult result = service.createHierarchyInClassification(classification, null);
+ monitor.worked(60);
+ Set<CdmBase> updatedObjects = result.getUpdatedObjects();
+ Set<CdmBase> unchangedObjects = result.getUnchangedObjects();
+ Classification classification2 = CdmBase.deproxy(result.getCdmEntity(), Classification.class);
+
+ MessagingUtils.informationDialog("Add Hierarchy successful", "New classification is "
+ + classification2.getTitleCache() + "\nCreated Genus: " + updatedObjects.size()
+ +"\nCreated Subspecies: " + unchangedObjects.size());
+
+ return postExecute(result.getCdmEntity());
+ }
+
+ @Override
+ public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return null;
+ }
+
+ @Override
+ public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return null;
+ }
+
+}
public static String SearchBar_2;\r
public static String SearchBar_3;\r
public static String SearchBar_4;\r
- public static String SearchBar_5;\r
public static String SearchBar_6;\r
public static String SearchBar_7;\r
public static String SearchBar_8;\r
// $Id$
/**
* 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.
*/
* Handles focus changes for the search textfield.
*/
private void registerAtFocusService() {
- IFocusService focusService =
+ IFocusService focusService =
(IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
if (focusService != null) {
focusService.addFocusTracker(text_search, "navigation.textControlId");
private void addTextListeners() {
text_search.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
+ @Override
+ public void focusGained(FocusEvent e) {
text_search.setForeground(NavigationUtil.getColor(Resources.SEARCH_VIEW_FOCUS));
if (defaultText.equals(text_search.getText())) {
text_search.setText("");
}
}
- public void focusLost(FocusEvent e) {
+ @Override
+ public void focusLost(FocusEvent e) {
if (text_search.getText() == "") {
text_search.setForeground(NavigationUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
text_search.setText(defaultText);
if(searchString == null){
return;
}
-
+
if("*".equals(searchString.trim())){
MessagingUtils.warningDialog(Messages.SearchBar_2, this, Messages.SearchBar_3);
return;
}
-
-
+
+
IFindTaxaAndNamesConfigurator configurator = configurationListener.getConfigurator();
configurator.setTitleSearchString(searchString);
openSearchResultsView(configurator);
-
+
}
-
+
private String getSearchString(){
String searchString = text_search.getText().trim();
- if (searchString.equals(defaultText) || searchString.length() == 0)
- return null;
+ if (searchString.equals(defaultText) || searchString.length() == 0) {
+ return null;
+ }
return searchString;
}
-
+
/**
* Opens a new instance of the search result view to display the result to the user.
- *
+ *
* @param searchResult
*/
private void openSearchResultsView(IFindTaxaAndNamesConfigurator configurator) {
boolean openResultInSeparateWindows = PreferencesUtil.getPreferenceStore().getBoolean((IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS));
if(openResultInSeparateWindows){
- //increment change secondary id so it is unique
+ //increment change secondary id so it is unique
secondaryId += "1";
}
/**
* Handles drop down menu selection. Available items are defined in the enumeration SearchOption.
- *
+ *
* @author n.hoffmann
* @created Feb 2, 2010
* @version 1.0
/**
* Handles search configuration selection.
- *
+ *
* @author n.hoffmann
* @created Feb 2, 2010
* @version 1.0
class ConfigurationSelectionListener extends SelectionAdapter {
private IFindTaxaAndNamesConfigurator configurator = PreferencesUtil.getSearchConfigurator();
-
+
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
* .swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
- MessagingUtils.info(Messages.SearchBar_5);
SearchOption option = (SearchOption) e.widget.getData();
switch (option){
break;
case COMMON_NAME:
configurator.setDoTaxaByCommonNames(getConfigurator().isDoTaxaByCommonNames() ? false : true);
- break;
+ break;
}
-
+
saveConfigurator();
}
/**
* Available search options.
- *
+ *
* @author n.hoffmann
* @created Feb 2, 2010
* @version 1.0
*/
enum SearchOption {
- TAXON(Messages.SearchBar_6),
- SYNONYM(Messages.SearchBar_7),
- NAME(Messages.SearchBar_8),
+ TAXON(Messages.SearchBar_6),
+ SYNONYM(Messages.SearchBar_7),
+ NAME(Messages.SearchBar_8),
COMMON_NAME(Messages.SearchBar_9);
private final String label;
\r
\r
<!-- enable the configuration of transactional behavior based on annotations -->\r
- <tx:annotation-driven transaction-manager="transactionManager"/> \r
+ <tx:annotation-driven transaction-manager="transactionManager"/>\r
+ \r
+<!-- <bean id="validationManager" class="eu.etaxonomy.cdm.api.validation.ValidationManager" scope="prototype"/> -->\r
+ \r
\r
\r
\r
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Bundle-ManifestVersion: 2
Bundle-Name: Printpublisher Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Require-Bundle: org.eclipse.osgi,
org.eclipse.ui,
eu.etaxonomy.taxeditor.cdmlib,
#Properties file for eu.etaxonomy.taxeditor.printpublisher\r
category.name = Print Publishing\r
-command.label = Erzeuge PDF\r
-command.name = Erzeuge PDF
\ No newline at end of file
+command.label = PDF Erzeugen\r
+command.name = PDF Erzeugen
\ No newline at end of file
+++ /dev/null
-#Properties file for eu.etaxonomy.taxeditor.printpublisher\r
-category.name = Print Publishing\r
-command.label = Generate PDF\r
-command.name = Generate PDF
\ No newline at end of file
p2.inf,\
OSGI-INF/l10n/bundle.properties,\
OSGI-INF/l10n/bundle_de.properties,\
- OSGI-INF/l10n/bundle_en.properties
<parent>
<artifactId>taxeditor-parent</artifactId>
<groupId>eu.etaxonomy</groupId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
+ <classpathentry kind="src" path="src/main/resources"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
Bundle-ManifestVersion: 2
Bundle-Name: DataStore Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 3.4.1.qualifier
+Bundle-Version: 3.5.2.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.cdm,
eu.etaxonomy.taxeditor.ui.bar,
eu.etaxonomy.taxeditor.ui.combo,
eu.etaxonomy.taxeditor.ui.dialog,
+ eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator,
eu.etaxonomy.taxeditor.ui.dialog.selection,
eu.etaxonomy.taxeditor.ui.element,
eu.etaxonomy.taxeditor.ui.group.grantedauthority,
page.name.3 = Taxonomic\r
page.name.4 = Nomenclatural Code\r
page.name.5 = Ranks\r
-page.name.6 = Nomenclatural Status Type\r
-page.name.7 = Name Relationship Type\r
-page.name.8 = Taxon Relationship Type\r
-page.name.9 = Specimen Type Designation Status\r
+page.name.6 = Nomenclatural Status\r
+page.name.7 = Name Relationships\r
+page.name.8 = Concept Relationships\r
+page.name.9 = Type Designation (Specimen)\r
page.name.10 = Available Languages\r
-page.name.11 = Marker Types\r
+page.name.11 = Marker\r
page.name.12 = Extension Types\r
-page.name.13 = Name Type Designation Status\r
+page.name.13 = Type Designation (Name)\r
page.name.14 = Named Area Type\r
page.name.15 = Matching (Experimental)\r
-page.name.16 = NonViralName Matching Strategy\r
+page.name.16 = Taxon Name Matching Strategy\r
page.name.17 = Reference Matching Strategy\r
page.name.18 = Team or Person Matching Strategy\r
page.name.19 = Stage\r
view.name.3 = Supplemental Data\r
view.name.4 = Details\r
view.name.5 = Use Records\r
-view.name.6 = Derivate Search\r
+view.name.6 = Derivative Search\r
editor.name = Defined Term Editor\r
menu.label = Show View\r
-command.label = Derivate Search\r
+command.label = Derivative Search\r
command.label.0 = Details\r
command.label.1 = Supplemental\r
command.label.2 = Datasource\r
page.name.27 = Media\r
page.name.28 = Checklist Editor\r
page.name.29 = Editor Profile\r
-page.name.30 = Language
\ No newline at end of file
+page.name.30 = Language\r
+command.label.clone = Clone\r
+command.label.openInSpecimenEditor = Open in Specimen Editor\r
+page.name.31 = Order of Taxonnodes\r
+extension.name.0 = Popup Menu Commands\r
+command.name.8 = Clone Datasource\r
+command.name.9 = Open Feature Tree Editor Wizard\r
+command.name.10 = Open Password Wizzard\r
+command.name.11 = Open Distribution Editor Wizard\r
+command.name.12 = Connect\r
+wizard.name.18 = CSV\r
+wizard.name.19 = CSV_NAME\r
+wizard.name.20 = CSV_PRINT\r
+activity.description = DELETE permission dependent ui contributions\r
+activity.name = Delete\r
+activity.description.0 = UPDATE permission dependent ui contributions\r
+activity.name.0 = Update\r
+activity.description.1 = CREATE permission dependent ui contributions\r
+activity.name.1 = Delete\r
+activity.description.2 = ROLE_USER_MANAGER dependent ui contributions\r
+activity.name.2 = UserManagement\r
+activity.description.3 = ROLE_PROJECT_MANAGER dependent ui contributions\r
+activity.name.3 = ProjectManagement\r
+extension-point.name = Cdm Viewer\r
+Bundle-Vendor = EDIT\r
+Bundle-Name = DataStore Bundle\r
+command.name.13 = delete\r
+command.name.14 = delete
\ No newline at end of file
page.name.3 = Taxonomisch
page.name.4 = Nomenklaturcode
page.name.5 = R\u00e4nge
-page.name.6 = Nomenklaturstatus Typ
-page.name.7 = Beziehungstyp Name
-page.name.8 = Beziehungstyp Taxon
-page.name.9 = Belegtyp Bezeichnungsstatus
+page.name.6 = Nomenklatorischer Status
+page.name.7 = Namensbeziehungen
+page.name.8 = Konzeptbeziehungen
+page.name.9 = Typusarten (Belege)
page.name.10 = Verf\u00fcgbare Sprachen
-page.name.11 = Markertypen
-page.name.12 = Erweiterungstypen
-page.name.13 = Namenstyp Bezeichnungsstatus
-page.name.14 = Benannte Gebiete
-page.name.15 = Matching (Experimental)
-page.name.16 = NonViralName Matching Strategie
-page.name.17 = Referenz Matching Strategie
-page.name.18 = Team oder Person Matching Strategie
-page.name.19 = Stufe (Stage)
-page.name.20 = Erhaltungs-(Preservation) Methode
+page.name.11 = Marker
+page.name.12 = Erweiterungen
+page.name.13 = Typusarten (Namen)
+page.name.14 = Gebiete
+page.name.15 = Matching (experimentel)
+page.name.16 = Taxonnamen Matching-Strategie
+page.name.17 = Referenz Matching-Strategie
+page.name.18 = Team oder Personen Matching-Strategie
+page.name.19 = Stadium
+page.name.20 = Konservierungsmethode
page.name.21 = Merkmalsbaum
page.name.22 = Standard Merkmalsbaum
page.name.23 = Repr\u00e4sentation
page.name.24 = Mobot Open Url
-page.name.25 = Typ Bezeichnungen
+page.name.25 = Typus
view.name = Datenquelle
view.name.0 = Fortschritt
view.name.1 = Nachrichten
view.name.3 = Zusatzdaten
view.name.4 = Details
view.name.5 = Benutze Datensatz
-view.name.6 = Suche Derivate
+view.name.6 = Derivatsuche
editor.name = Editor f\u00fcr definierte Begriffe
menu.label = Zeige Ansicht
command.label = Derivatsuche
command.name = Verbinde Datenquelle
command.name.0 = Bearbeite Datenquelle
command.name.1 = Erstelle Datenquelle
-command.name.2 = Schie\u00dfe aktive Verbindungen
+command.name.2 = Schlie\u00dfe aktive Verbindungen
command.name.3 = Aktualisiere Datenquellen
command.name.4 = Zeige Login Window
command.name.5 = \u00d6ffne Editor f\u00fcr definierte Begriffe
fontDefinition.label.3 = Schrift Normal
themeElementCategory.label.2 = Suche Ansicht
themeElementCategory.description.2 = Farben und Schriften f\u00fcr die Suchansicht
-colorDefinition.label.11 = Suche Ansicht Fordergrund
+colorDefinition.label.11 = Suche Ansicht Vordergrund
colorDefinition.label.12 = Suche Ansicht Fokus
fontDefinition.label.4 = Schrift f\u00fcr Akzeptierte
fontDefinition.description = Die Schrift f\u00fcr akzeptierte Taxa in den Suchergebnissen.
fontDefinition.label.5 = Synonymschrift
fontDefinition.description.0 = Die Schrift f\u00fcr Synonyme in den Suchergebnissen.
fontDefinition.label.6 = Andere Schrift
-fontDefinition.description.1 = Die Schrift die normalerweise in den Suchergebnissen benutzt wird.
+fontDefinition.description.1 = Die Schrift, die normalerweise in den Suchergebnissen benutzt wird.
colorDefinition.label.13 = Fehler beim Parsing
colorDefinition.label.14 = Gesperrtes Namenseditierfeld
colorDefinition.label.15 = Editor fehlerhaft
-page.name.26 = Specimens und FieldUnits
+page.name.26 = Specimens und Field Units
page.name.27 = Media
-page.name.28 = Checklist Editor
+page.name.28 = Checklisten Editor
page.name.29 = Editor Profil
-page.name.30 = Sprache
\ No newline at end of file
+page.name.30 = Sprache
+command.label.clone = Klonen
+command.label.openInSpecimenEditor = \u00d6ffnen im Specimen-Editor
\ No newline at end of file
+++ /dev/null
-#Properties file for eu.etaxonomy.taxeditor.store\r
-page.name = Taxonomic Editor\r
-page.name.0 = Description\r
-page.name.1 = Features\r
-page.name.2 = Distribution Status\r
-page.name.3 = Taxonomic\r
-page.name.4 = Nomenclatural Code\r
-page.name.5 = Ranks\r
-page.name.6 = Nomenclatural Status Type\r
-page.name.7 = Name Relationship Type\r
-page.name.8 = Taxon Relationship Type\r
-page.name.9 = Specimen Type Designation Status\r
-page.name.10 = Available Languages\r
-page.name.11 = Marker Types\r
-page.name.12 = Extension Types\r
-page.name.13 = Name Type Designation Status\r
-page.name.14 = Named Area Type\r
-page.name.15 = Matching (Experimental)\r
-page.name.16 = NonViralName Matching Strategy\r
-page.name.17 = Reference Matching Strategy\r
-page.name.18 = Team or Person Matching Strategy\r
-page.name.19 = Stage\r
-page.name.20 = Preservation Method\r
-page.name.21 = Feature Tree\r
-page.name.22 = Default Feature Trees\r
-page.name.23 = Representation\r
-page.name.24 = Mobot Open Url\r
-page.name.25 = Type Designations\r
-view.name = Datasource\r
-view.name.0 = Progress\r
-view.name.1 = Message\r
-view.name.2 = Reporting\r
-view.name.3 = Supplemental Data\r
-view.name.4 = Details\r
-view.name.5 = Use Records\r
-view.name.6 = Derivate Search\r
-editor.name = Defined Term Editor\r
-menu.label = Show View\r
-command.label = Derivate Search\r
-command.label.0 = Details\r
-command.label.1 = Supplemental\r
-command.label.2 = Datasource\r
-command.label.3 = Error Log\r
-command.label.4 = Reporting\r
-command.label.5 = Switch User\r
-command.label.6 = Connect\r
-command.label.7 = New\r
-command.label.8 = Edit\r
-command.label.9 = Delete\r
-command.label.10 = Close Active Connection\r
-command.label.11 = Update Datamodel\r
-menu.label.0 = New\r
-command.label.12 = Vocabulary\r
-command.label.13 = Defined Term\r
-command.label.14 = Delete\r
-extension.name = Popup Menu Commands\r
-command.name = Connect Datasource\r
-command.name.0 = Edit Datasource\r
-command.name.1 = Create Datasource\r
-command.name.2 = Close Active Connection\r
-command.name.3 = Update Datasource\r
-command.name.4 = Show Login Window\r
-command.name.5 = Open Defined Term Editor\r
-commandParameter.name = inputType\r
-commandParameter.name.0 = inputType\r
-command.name.6 = New Defined Term\r
-command.name.7 = New Term Vocabulary\r
-category.name = CDM\r
-wizard.name = TCS\r
-wizard.name.0 = Berlin Model\r
-wizard.name.1 = Endnote\r
-wizard.name.2 = Excel Normal Explicit Taxa\r
-wizard.name.3 = ABCD\r
-wizard.name.4 = SDD\r
-wizard.name.5 = Specimen CDM Excel\r
-category.name.0 = CDM\r
-wizard.name.6 = JAXB\r
-wizard.name.7 = Berlin Model\r
-category.name.1 = Excel\r
-wizard.name.8 = SDD\r
-wizard.name.9 = DwC-A\r
-wizard.name.10 = Reference\r
-wizard.name.11 = Name\r
-wizard.name.12 = Team\r
-wizard.name.13 = Person\r
-wizard.name.14 = Specimen\r
-wizard.name.15 = Polytomous Key\r
-category.name.2 = CDM\r
-wizard.name.16 = Taxon\r
-wizard.name.17 = Classification\r
-themeElementCategory.label = Taxonomic Editor\r
-themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor\r
-colorDefinition.label = List Background\r
-colorDefinition.label.0 = Global Text Color\r
-colorDefinition.label.1 = Global Color Composite Background\r
-colorDefinition.label.2 = Global Color Composite Irrelevant\r
-colorDefinition.label.3 = Global Text Color Disabled\r
-colorDefinition.label.4 = Global Background Color Disabled\r
-themeElementCategory.label.0 = Details View\r
-themeElementCategory.description.0 = Colors and fonts for the details view\r
-colorDefinition.label.5 = Entity Element List Background Odd\r
-colorDefinition.label.6 = Entity Element List Background Even\r
-themeElementCategory.label.1 = Name Editor\r
-themeElementCategory.description.1 = Colors and fonts for the name editor\r
-colorDefinition.label.7 = Container Background\r
-colorDefinition.label.8 = Container Selected Focus\r
-colorDefinition.label.9 = Container Selected\r
-colorDefinition.label.10 = Container Drag Enter\r
-fontDefinition.label = Accepted Taxon Font\r
-fontDefinition.label.0 = Synonym Font\r
-fontDefinition.label.1 = Misapplication Font\r
-fontDefinition.label.2 = Concept Font\r
-fontDefinition.label.3 = Default Font\r
-themeElementCategory.label.2 = Search View\r
-themeElementCategory.description.2 = Colors and fonts for the search view\r
-colorDefinition.label.11 = Search View Foreground\r
-colorDefinition.label.12 = Search View Focus\r
-fontDefinition.label.4 = Accepted font\r
-fontDefinition.description = The font that is used for accepted taxa in the search result list.\r
-fontDefinition.label.5 = Synonym font\r
-fontDefinition.description.0 = The font that is used for synonyms in the search result list.\r
-fontDefinition.label.6 = Other font\r
-fontDefinition.description.1 = The font used by default in the search result list.\r
-colorDefinition.label.13 = Parse Error\r
-colorDefinition.label.14 = Disabled Name Editor Field\r
-colorDefinition.label.15 = Editor On Error\r
-page.name.26 = Specimens and FieldUnits\r
-page.name.27 = Media\r
-page.name.28 = Checklist Editor\r
-page.name.29 = Editor Profile\r
-page.name.30 = Language
\ No newline at end of file
CdmDataSourceViewPart_7=Database\r
CdmDataSourceViewPart_8=Type\r
CdmDataSourceViewPart_9=Up\r
+LanguageEditorPreferencePage_ChooseDefaultLanguage=Please choose your default language for the editor: \r
+LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restarted, in order to complete the language switch.\nDo you want to restart now?\r
+LanguageEditorPreferencePage_PleaseRestart=Please Restart\r
+LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect.\r
+OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required.\r
+OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.
\ No newline at end of file
CdmDataSourceViewPart_7=Datenquelle\r
CdmDataSourceViewPart_8=Typ\r
CdmDataSourceViewPart_9=Verf\u00FCgbar\r
+LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte wählen Sie die Standardsprache für den Taxonomischen Editor aus.\r
+LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten?\r
+LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten\r
+LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.\r
+OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.
\ No newline at end of file
+++ /dev/null
-CdmDataSourceViewPart_1=Loading datasources\r
-CdmDataSourceViewPart_10=Server\r
-CdmDataSourceViewPart_11=Name\r
-CdmDataSourceViewPart_12=Connected\r
-CdmDataSourceViewPart_2=Notes\r
-CdmDataSourceViewPart_3=Compatible\r
-CdmDataSourceViewPart_4=CDM Version\r
-CdmDataSourceViewPart_5=Created\r
-CdmDataSourceViewPart_6=Nomenclatural Code\r
-CdmDataSourceViewPart_7=Database\r
-CdmDataSourceViewPart_8=Type\r
-CdmDataSourceViewPart_9=Up\r
OSGI-INF/,\
OSGI-INF/l10n/bundle.properties,\
OSGI-INF/l10n/bundle_de.properties,\
- OSGI-INF/l10n/bundle_en.properties,\
OSGI-INF/l10n/messages.properties,\
OSGI-INF/l10n/messages_de.properties,\
- OSGI-INF/l10n/messages_en.properties
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
+ <extension-point id="eu.etaxonomy.taxeditor.store.cdmViewer" name="%extension-point.name" schema="schema/eu.etaxonomy.taxeditor.store.cdmViewer.exsd"/>
<extension
point="org.eclipse.ui.preferencePages">
<page
id="eu.etaxonomy.taxeditor.preferences.specimenTypeDesignationStatus"
name="%page.name.9">
</page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.taxonomic"
+ class="eu.etaxonomy.taxeditor.preference.menu.NameTypeDesignationStatusMenuPreferences"
+ id="eu.etaxonomy.taxeditor.preferences.nameTypeDesignationStatus"
+ name="%page.name.13">
+ </page>
<page
category="eu.etaxonomy.taxeditor.preferences.language"
class="eu.etaxonomy.taxeditor.preference.menu.LanguageMenuPreferences"
id="eu.etaxonomy.taxeditor.preferences.extensionTypes"
name="%page.name.12">
</page>
- <page
- category="eu.etaxonomy.taxeditor.preferences.taxonomic"
- class="eu.etaxonomy.taxeditor.preference.menu.NameTypeDesignationStatusMenuPreferences"
- id="eu.etaxonomy.taxeditor.preferences.nameTypeDesignationStatus"
- name="%page.name.13">
- </page>
<page
category="eu.etaxonomy.taxeditor.preferences.description"
class="eu.etaxonomy.taxeditor.preference.menu.NamedAreaTypeMenuPreferences"
id="eu.etaxonomy.taxeditor.preference.defaultlanguagepditorpreferencePage"
name="%page.name.30">
</page>
+ <page
+ category="eu.etaxonomy.taxeditor.preferences.general"
+ class="eu.etaxonomy.taxeditor.preference.OrderPreferences"
+ id="eu.etaxonomy.taxeditor.preference.OrderPreferencesPage"
+ name="%page.name.31">
+ </page>
</extension>
<extension
point="org.eclipse.ui.views">
</command>
<command
commandId="eu.etaxonomy.taxeditor.store.datasource.clone"
- label="Clone"
+ label="%command.label.clone"
style="push">
<visibleWhen>
<with
visible="true">
</separator>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.view.datasource.delete"
label="%command.label.9"
style="push">
<visibleWhen>
</command>
</menu>
<command
- commandId="org.eclipse.ui.edit.delete"
+ commandId="eu.etaxonomy.taxeditor.editor.definedTerms.delete"
label="%command.label.14"
style="push">
<visibleWhen
locationURI="popup:eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView">
<command
commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
- label="Open in Derivate Editor"
+ label="%command.label.openInSpecimenEditor"
style="push">
<visibleWhen
checkEnabled="true">
point="org.eclipse.ui.handlers">
<handler
class="eu.etaxonomy.taxeditor.view.datasource.handler.DeleteDataSourceHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.view.datasource.delete">
<activeWhen>
<with
variable="activePartId">
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.definedterm.handler.DeleteTermBaseHandler"
- commandId="org.eclipse.ui.edit.delete">
+ commandId="eu.etaxonomy.taxeditor.editor.definedTerms.delete">
<activeWhen>
<with
variable="activePartId">
</handler>
</extension>
<extension
- name="Popup Menu Commands"
+ name="%extension.name.0"
point="org.eclipse.ui.commands">
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.ChangeConnectionHandler"
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CloneDataSourceHandler"
id="eu.etaxonomy.taxeditor.store.datasource.clone"
- name="Clone Datasource">
+ name="%command.name.8">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CreateDataSourceHandler"
id="eu.etaxonomy.taxeditor.store.datasource.close"
name="%command.name.2">
</command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.DeleteDataSourceHandler"
+ id="eu.etaxonomy.taxeditor.view.datasource.delete"
+ name="%command.name.13">
+ </command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.UpdateDataSourceHandler"
id="eu.etaxonomy.taxeditor.store.datasource.update"
</command>
<command
id="eu.etaxonomy.taxeditor.store.open.FeatureTreeEditorWizard"
- name="Open Feature Tree Editor Wizard">
+ name="%command.name.9">
</command>
<command
id="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
- name="Open Password Wizzard">
+ name="%command.name.10">
</command>
<command
id="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler"
- name="Open Distribution Editor Wizard">
+ name="%command.name.11">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.ChangeConnectionHandler"
id="eu.etaxonomy.taxeditor.datasource.connect"
- name="Connect">
+ name="%command.name.12">
+ </command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.DeleteTermBaseHandler"
+ id="eu.etaxonomy.taxeditor.editor.definedTerms.delete"
+ name="%command.name.14">
</command>
<command
defaultHandler="eu.etaxonomy.taxeditor.handler.OpenInspectSessionsHandler"
category="eu.etaxonomy.taxeditor.export.category.cdm"
class="eu.etaxonomy.taxeditor.io.wizard.CsvExportWizard"
id="eu.etaxonomy.taxeditor.io.export.csv"
- name="CSV">
+ name="%wizard.name.18">
+ </wizard>
+ <wizard
+ category="eu.etaxonomy.taxeditor.export.category.cdm"
+ class="eu.etaxonomy.taxeditor.io.wizard.CsvNameExportWizard"
+ id="eu.etaxonomy.taxeditor.io.export.csv_name"
+ name="%wizard.name.19">
+ </wizard>
+ <wizard
+ category="eu.etaxonomy.taxeditor.export.category.cdm"
+ class="eu.etaxonomy.taxeditor.io.wizard.CsvPrintExportWizard"
+ id="eu.etaxonomy.taxeditor.io.export.csv_print"
+ name="%wizard.name.20">
</wizard>
</extension>
<extension
<extension
point="org.eclipse.ui.activities">
<activity
- description="DELETE permission dependent ui contributions"
+ description="%activity.description"
id="eu.etaxonomy.taxeditor.store.activityDelete"
- name="Delete">
+ name="%activity.name">
<enabledWhen>
<reference
definitionId="canDELETE">
pattern="eu\.etaxonomy\.taxeditor\..*/.*.delete">
</activityPatternBinding>
<activity
- description="UPDATE permission dependent ui contributions"
+ description="%activity.description.0"
id="eu.etaxonomy.taxeditor.store.activityUpdate"
- name="Update">
+ name="%activity.name.0">
<enabledWhen>
<reference
definitionId="canUPDATE">
pattern="eu\.etaxonomy\.taxeditor\..*/.*.command\.update\..*">
</activityPatternBinding>
<activity
- description="CREATE permission dependent ui contributions"
+ description="%activity.description.1"
id="eu.etaxonomy.taxeditor.store.activityCreate"
- name="Delete">
+ name="%activity.name.1">
<enabledWhen>
<reference
definitionId="canDELETE">
pattern="eu\.etaxonomy\.taxeditor\..*/.*.command\.create\..*">
</activityPatternBinding>
<activity
- description="ROLE_USER_MANAGER dependent ui contributions"
+ description="%activity.description.2"
id="eu.etaxonomy.taxeditor.store.activityUserManagement"
- name="UserManagement">
+ name="%activity.name.2">
<enabledWhen>
<reference
definitionId="hasROLE_USER_MANAGER">
pattern="eu\.etaxonomy\.taxeditor\..*/bulkeditor\.input\.group">
</activityPatternBinding>
<activity
- description="ROLE_PROJECT_MANAGER dependent ui contributions"
+ description="%activity.description.3"
id="eu.etaxonomy.taxeditor.store.activityProjectManagement"
- name="ProjectManagement">
+ name="%activity.name.3">
<enabledWhen>
<reference
definitionId="hasROLE_PROJECT_MANAGER">
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="eu.etaxonomy.taxeditor.store" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="eu.etaxonomy.taxeditor.store" id="eu.etaxonomy.taxeditor.store.cdmViewer" name="Cdm Viewer"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ <documentation>
+ Extensions must provide and ICdmViewer which maps input elements to viewers which are able to display information for them.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="cdmViewer" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="att" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="cdmViewer">
+ <annotation>
+ <documentation>
+ A Cdm Viewer knows what viewer or editor can show which input.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class of the viewer.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":eu.etaxonomy.taxeditor.view.ICdmViewer"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
-// $Id$\r
-/**\r
- * Copyright (C) 2014 EDIT\r
- * European Distributed Institute of Taxonomy\r
- * http://www.e-taxonomy.eu\r
- *\r
- * The contents of this file are subject to the Mozilla Public License Version 1.1\r
- * See LICENSE.TXT at the top of this package for the full license terms.\r
- */\r
-package eu.etaxonomy.taxeditor.view.datasource;\r
-\r
-import org.eclipse.osgi.util.NLS;\r
-\r
-/**\r
- * @author d.schild\r
- * @date 18.06.2014\r
- *\r
- */\r
-public class Messages extends NLS {\r
- private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$\r
- public static String CdmDataSourceViewPart_1;\r
- public static String CdmDataSourceViewPart_10;\r
- public static String CdmDataSourceViewPart_11;\r
- public static String CdmDataSourceViewPart_12;\r
- public static String CdmDataSourceViewPart_2;\r
- public static String CdmDataSourceViewPart_3;\r
- public static String CdmDataSourceViewPart_4;\r
- public static String CdmDataSourceViewPart_5;\r
- public static String CdmDataSourceViewPart_6;\r
- public static String CdmDataSourceViewPart_7;\r
- public static String CdmDataSourceViewPart_8;\r
- public static String CdmDataSourceViewPart_9;\r
- static {\r
- // initialize resource bundle\r
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);\r
- }\r
-\r
- private Messages() {\r
- }\r
-}\r
+// $Id$
+/**
+ * Copyright (C) 2015 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.eclipse.osgi.util.NLS;
+
+/**
+ * @author pplitzner
+ * @date Apr 14, 2015
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$
+ public static String LanguageEditorPreferencePage_ChooseDefaultLanguage;
+ public static String LanguageEditorPreferencePage_EditorHasToRestart;
+ public static String LanguageEditorPreferencePage_PleaseRestart;
+ public static String LanguageEditorPreferencePage_RestartRequired;
+ public static String OrderPreferencePage_NewNavigatorWindowRequired;
+ public static String OrderPreferencePage_PleaseReopenNavigator;
+ public static String CdmDataSourceViewPart_1;
+ public static String CdmDataSourceViewPart_10;
+ public static String CdmDataSourceViewPart_11;
+ public static String CdmDataSourceViewPart_12;
+ public static String CdmDataSourceViewPart_2;
+ public static String CdmDataSourceViewPart_3;
+ public static String CdmDataSourceViewPart_4;
+ public static String CdmDataSourceViewPart_5;
+ public static String CdmDataSourceViewPart_6;
+ public static String CdmDataSourceViewPart_7;
+ public static String CdmDataSourceViewPart_8;
+ public static String CdmDataSourceViewPart_9;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
+++ /dev/null
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor;\r
-\r
-import java.util.UUID;\r
-\r
-import eu.etaxonomy.cdm.model.common.VocabularyEnum;\r
-\r
-public class UsageTermCollection {\r
- public final static UUID uuidMarkersVocabulary = UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305");\r
- \r
- public final static UUID uuidUseMarkerType = UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039");\r
- public final static String useMakerLabel = "use";\r
- \r
- public final static UUID uuidFeatureVocabulary = VocabularyEnum.Feature.getUuid(); // UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");\r
- public final static UUID uuidPalmWebFeatureTree = UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0");\r
- \r
- \r
- public final static UUID uuidUseRecordFeature = UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599");\r
- public final static String useRecordFeatureLabel = "Use Record";\r
- \r
- public final static UUID uuidUseSummaryFeature = UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279");\r
- public final static String useSummaryFeatureLabel = "Use";\r
- \r
- public final static UUID uuidUseCategoryVocabulary = UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931");\r
- public final static String useCategoryVocabularyLabel = "Use Category";\r
- public final static String useSubCategoryVocabularyLabel = "Use SubCategory";\r
- public final static UUID uuidUseCategoryDummy = UUID.fromString("983a7184-6a51-489e-aca1-f21fc4fdbae3");\r
- public final static UUID uuidUseSubCategoryDummy = UUID.fromString("a8d80223-5c79-4063-8c6b-4dc8681e9c62");\r
- \r
- public final static UUID uuidCountryVocabulary = UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b");\r
- public final static String countryLabel = "Country";\r
- public final static UUID uuidCountryDummy = UUID.fromString("761dddee-bfa2-41f4-82df-3a19c71adee0");\r
- \r
- public final static UUID uuidPlantPartVocabulary = UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35");\r
- public final static String plantPartLabel = "Plant Part";\r
- public final static UUID uuidPlantPartDummy = UUID.fromString("30150a82-a12f-4278-96ad-7ce708efa082");\r
- \r
- public final static UUID uuidHumanGroupVocabulary = UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc");\r
- public final static String humanGroupLabel = "Human Group";\r
- public final static UUID uuidHumanGroupDummy = UUID.fromString("c4b63327-2548-429d-8d55-81fdba5900a5");\r
- public final static UUID uuidEthnicGroupDummy = UUID.fromString("3ca851e5-d0d4-41cd-9066-f79e246c36c2");\r
- \r
- public final static String ethnicGroupLabel = "Ethnic Group";\r
- \r
- public final static String notAvailableLabel = "N/A";\r
- \r
- \r
- \r
- \r
- \r
- \r
-\r
-\r
- \r
- \r
-}\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
\r
/**\r
* @author l.morris\r
if (element instanceof DefinedTermBase) {\r
DefinedTermBase<?> dtb = (DefinedTermBase<?>) element;\r
if (StringUtils.isNotBlank(dtb.getIdInVocabulary())) {\r
- return dtb.getIdInVocabulary() + " : " + dtb.getTitleCache();\r
+ return dtb.getIdInVocabulary() + " : " + dtb.getLabel(PreferencesUtil.getGlobalLanguage());\r
} else {\r
- return dtb.getTitleCache();\r
+ return dtb.getLabel(PreferencesUtil.getGlobalLanguage());\r
}\r
} else if (element instanceof TermBase) {\r
return ((TermBase) element).getTitleCache();\r
protected ICdmApplicationConfiguration applicationConfiguration;
public static enum TYPE {
- Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel
+ Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name
}
/**
--- /dev/null
+// $Id$\r
+/**\r
+ * Copyright (C) 2007 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+\r
+package eu.etaxonomy.taxeditor.io.wizard;\r
+\r
+import java.io.File;\r
+\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.swt.widgets.Combo;\r
+import org.eclipse.ui.IWorkbench;\r
+\r
+import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+/**\r
+ * @author k.luther\r
+ * @created Apr. 12, 2015\r
+ * @version 1.0\r
+ */\r
+public class CsvNameExportWizard extends AbstractExportWizard<CsvNameExportConfigurator> {\r
+\r
+ protected CsvNameExportConfigurator configurator;\r
+ protected ExportToFileDestinationWizardPage page;\r
+\r
+ private final String description = "Export the names of the currently selected database into Semicolon Separated Value format.";\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,\r
+ * org.eclipse.jface.viewers.IStructuredSelection)\r
+ */\r
+ @Override\r
+ public void init(IWorkbench workbench, IStructuredSelection selection) {\r
+ configurator = CsvNameExportConfigurator.NewInstance(null,null);\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see\r
+ * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()\r
+ */\r
+ @Override\r
+ public CsvNameExportConfigurator getConfigurator() {\r
+ return configurator;\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()\r
+ */\r
+ @Override\r
+ public boolean performFinish() {\r
+ String urlString = page.getFolderText() + File.separator\r
+ + page.getExportFileName();\r
+\r
+ final Combo combo = page.getCombo();\r
+ \r
+ configurator.setDestination(new File(urlString));\r
+\r
+ CdmStore.getExportManager().run(configurator);\r
+\r
+ return true;\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()\r
+ */\r
+ @Override\r
+ public void addPages() {\r
+ //TODO create page with drop down menu for export for single classification.\r
+// super.addPages();\r
+\r
+\r
+ //standard page\r
+ page = ExportToFileDestinationWizardPage.CsvNames();\r
+\r
+ addPage(page);\r
+ }\r
+}\r
+\r
--- /dev/null
+package eu.etaxonomy.taxeditor.io.wizard;\r
+\r
+import java.io.File;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.UUID;\r
+\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.swt.widgets.Combo;\r
+import org.eclipse.ui.IWorkbench;\r
+\r
+import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;\r
+import eu.etaxonomy.cdm.model.taxon.Classification;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+public class CsvPrintExportWizard extends CsvNameExportWizard{\r
+ \r
+ \r
+ private final String description = "Export the contents of the currently selected database into Semicolon Separated Value format.";\r
+ @Override\r
+ public void init(IWorkbench workbench, IStructuredSelection selection) {\r
+ configurator = CsvNameExportConfigurator.NewInstance(null,null);\r
+ configurator.setNamesOnly(false);\r
+ }\r
+\r
+ @Override\r
+ public CsvNameExportConfigurator getConfigurator() {\r
+ \r
+ return configurator;\r
+ }\r
+\r
+ \r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()\r
+ */\r
+ @Override\r
+ public void addPages() {\r
+ //TODO create page with drop down menu for export for single classification.\r
+// super.addPages();\r
+\r
+\r
+ //standard page\r
+ page = ExportToFileDestinationWizardPage.CsvPrint();\r
+\r
+ addPage(page);\r
+ }\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()\r
+ */\r
+ @Override\r
+ public boolean performFinish() {\r
+ String urlString = page.getFolderText() + File.separator\r
+ + page.getExportFileName();\r
+\r
+ final Combo combo = page.getCombo();\r
+ final List<Classification> listClassifications = CdmStore.getCurrentApplicationConfiguration().getClassificationService().listClassifications(null, null, null, null);\r
+ if(combo != null){\r
+ int selectionIndex = combo.getSelectionIndex();\r
+ HashSet<UUID> set = new HashSet<UUID>();\r
+ if(selectionIndex == -1){\r
+ for(Classification c:listClassifications){\r
+ set.add(c.getUuid());\r
+ }\r
+ }else{\r
+ for(Classification c:listClassifications){\r
+ if(c.getTitleCache().equalsIgnoreCase(combo.getItem(selectionIndex))){\r
+ set.add(c.getUuid());\r
+ }\r
+ }\r
+ \r
+ configurator.setHasHeaderLines(true);\r
+ \r
+ }\r
+ } else{ \r
+ configurator.setClassificationUUID(listClassifications.get(0).getUuid());\r
+ }\r
+ configurator.setDestination(new File(urlString));\r
+\r
+ CdmStore.getExportManager().run(configurator);\r
+\r
+ return true;\r
+ }\r
+\r
+}\r
public static final String DWCA_EXPORT = "DWCA_EXPORT";
public static final String CSV_EXPORT = "CSV_EXPORT";
+ public static final String CSV_NAME_EXPORT = "CSV_NAME_EXPORT";
public static final String XML = "xml";
public static final String CSV = "csv";
+
+
public static final String ZIP = "zip";
private static boolean csvExport = false;
+
+ private static boolean csvNameExport = false;
+
+ private static String CSV_PRINT_EXPORT ="CSV_PRINT_EXPORT";
+
+ private static boolean csvPrintExport = false;
private DirectoryDialog folderDialog;
private Text text_exportFileName;
"Export the contents of the currently selected database into Comma Separated Value format.",
CSV);
}
+
+ /**
+ * @return
+ */
+ public static ExportToFileDestinationWizardPage CsvNames() {
+ csvNameExport = true;
+ return new ExportToFileDestinationWizardPage(
+ CSV_NAME_EXPORT,
+ "csvNames",
+ "CSV Name Export",
+ "Export the names of the currently selected database into Semicolon Separated Value format.",
+ CSV);
+ }
+
+ /**
+ * @return
+ */
+ public static ExportToFileDestinationWizardPage CsvPrint() {
+ csvPrintExport = true;
+ return new ExportToFileDestinationWizardPage(
+ CSV_PRINT_EXPORT,
+ "csvPrint",
+ "CSV Print Export",
+ "Export the content of the currently selected database into Semicolon Separated Value format.",
+ CSV);
+ }
/*
* (non-Javadoc)
comboBox.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
true, false, 2, 1));
}
+
+
+
Label fileLabel = new Label(composite, SWT.NONE);
fileLabel.setText("File");
* @return a {@link java.lang.String} object.
*/
public static String getLabel(Object element){
+ String noLabelString = "[no label]";
if (element instanceof FeatureNodeContainer){
return getFeatureNodeContainerText((FeatureNodeContainer) element);
}
return getDescriptionText((DescriptionBase) element);
}
else if(element instanceof CategoricalData){
- return getCategoricalDataText((CategoricalData) element);
+ String categoricalDataText = getCategoricalDataText((CategoricalData) element);
+ if(categoricalDataText.isEmpty()){
+ categoricalDataText = noLabelString;
+ }
+ return categoricalDataText;
}
else if (element instanceof CommonTaxonName) {
return getCommonNameText((CommonTaxonName) element);
return getIndividualsAssociationText((IndividualsAssociation) element);
}
else if (element instanceof QuantitativeData) {
- return getQuantitativeDataText((QuantitativeData) element);
+ String quantitativeDataText = getQuantitativeDataText((QuantitativeData) element);
+ if(quantitativeDataText.isEmpty()){
+ quantitativeDataText = noLabelString;
+ }
+ return quantitativeDataText;
}
else if (element instanceof TaxonInteraction) {
return getTaxonInteractionText((TaxonInteraction) element);
public static final String COLLAPSE_ALL = "collapse_all";
public static final String TISSUE_SAMPLE_DERIVATE = "tissue_sample_derivate";
+ public static final String TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA = "tissue_sample_derivate_character_data";
public static final String DNA_SAMPLE_DERIVATE = "dna_sample_derivate";
+ public static final String DNA_SAMPLE_DERIVATE_CHARACTER_DATA = "dna_sample_derivate_character_data";
public static final String FIELD_UNIT = "field_unit";
+ public static final String FIELD_UNIT_CHARACTER_DATA = "field_unit_character_data";
public static final String SPECIMEN_DERIVATE = "specimen_derivate";
+ public static final String SPECIMEN_DERIVATE_CHARACTER_DATA = "specimen_derivate_character_data";
public static final String ARTWORK_DERIVATE = "artwork_derivate";
+ public static final String ARTWORK_DERIVATE_CHARACTER_DATA = "artwork_derivate_character_data";
public static final String SPECIMEN_SCAN_DERIVATE = "specimen_scan_derivate";
+ public static final String SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA = "specimen_scan_derivate_character_data";
public static final String LIVING_PLANT_PHOTO_DERIVATE = "living_plant_photo_derivate";
+ public static final String LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA = "living_plant_photo_derivate_character_data";
public static final String DETAIL_IMAGE_DERIVATE = "detail_image_derivate";
+ public static final String DETAIL_IMAGE_DERIVATE_CHARACTER_DATA = "detail_image_derivate_character_data";
public static final String SEQUENCE_DERIVATE = "sequence_derivate";
public static final String AMPLIFICATION_DERIVATE = "amplification_derivate";
public static final String SINGLE_READ_DERIVATE = "single_read_derivate";
"lock_open.png");
registerImage(registry, DNA_SAMPLE_DERIVATE,
"dna_derivate-16x16-32.png");
+ registerImage(registry, DNA_SAMPLE_DERIVATE_CHARACTER_DATA,
+ "dna_derivate_data-16x16-32.png");
registerImage(registry, FIELD_UNIT,
"fieldunit-16x16-32.png");
+ registerImage(registry, FIELD_UNIT_CHARACTER_DATA,
+ "fieldunit_data-16x16-32.png");
registerImage(registry, SPECIMEN_DERIVATE,
"specimen_derivate-16x16-32.png");
+ registerImage(registry, SPECIMEN_DERIVATE_CHARACTER_DATA,
+ "specimen_derivate_data-16x16-32.png");
registerImage(registry, ARTWORK_DERIVATE,
"artwork_derivate-16x16-32.png");
+ registerImage(registry, ARTWORK_DERIVATE_CHARACTER_DATA,
+ "artwork_derivate_data-16x16-32.png");
registerImage(registry, SPECIMEN_SCAN_DERIVATE,
"specimen_scan_derivate-16x16-32.png");
+ registerImage(registry, SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA,
+ "specimen_scan_derivate_data-16x16-32.png");
registerImage(registry, LIVING_PLANT_PHOTO_DERIVATE,
"living_plant_photo_derivate-16x16-32.png");
+ registerImage(registry, LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA,
+ "living_plant_photo_derivate_data-16x16-32.png");
registerImage(registry, DETAIL_IMAGE_DERIVATE,
"detail_image_derivate-16x16-32.png");
+ registerImage(registry, DETAIL_IMAGE_DERIVATE_CHARACTER_DATA,
+ "detail_image_derivate_data-16x16-32.png");
registerImage(registry, TISSUE_SAMPLE_DERIVATE,
"tissue_sample-16x16-32.png");
+ registerImage(registry, TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA,
+ "tissue_sample_data-16x16-32.png");
registerImage(registry, SEQUENCE_DERIVATE,
"sequence_derivate-16x16-32.png");
registerImage(registry, AMPLIFICATION_DERIVATE,
--- /dev/null
+// $Id$
+/**
+* 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.parser;
+
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.cdm.strategy.match.MatchMode;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * This class defines the MatchStrategies that will be used by the ParseHandler.
+ *
+ * @author n.hoffmann
+ * @created Jan 22, 2010
+ * @version 1.0
+ */
+public class MatchStrategyConfigurator {
+
+ /**
+ * <p>NonViralNameMatchStrategy</p>
+ *
+ * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static IMatchStrategy NonViralNameMatchStrategy() throws MatchException{
+ return getDefaultNonViralNameMatchStrategy();// PreferencesUtil.getMatchStrategy(NonViralName.class);
+ }
+
+ /**
+ * <p>TeamOrPersonMatchStrategy</p>
+ *
+ * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static IMatchStrategy TeamOrPersonMatchStrategy() throws MatchException{
+ return PreferencesUtil.getMatchStrategy(TeamOrPersonBase.class);
+ }
+
+ /**
+ * <p>ReferenceMatchStrategy</p>
+ *
+ * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static IMatchStrategy ReferenceMatchStrategy() throws MatchException{
+ return getDefaultReferenceMatchStrategy();// PreferencesUtil.getMatchStrategy(ReferenceBase.class);
+ }
+
+ /**
+ * <p>getDefaultNonViralNameMatchStrategy</p>
+ *
+ * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static IMatchStrategy getDefaultNonViralNameMatchStrategy() throws MatchException{
+ IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(NonViralName.class);
+
+ strategy.setMatchMode("nomenclaturalReference", MatchMode.IGNORE);
+ strategy.setMatchMode("combinationAuthorTeam", MatchMode.IGNORE);
+ strategy.setMatchMode("exCombinationAuthorTeam", MatchMode.IGNORE);
+ strategy.setMatchMode("basionymAuthorTeam", MatchMode.IGNORE);
+ strategy.setMatchMode("exBasionymAuthorTeam", MatchMode.IGNORE);
+
+ return strategy;
+ }
+
+ /**
+ * <p>getDefaultTeamOrPersonMatchStrategy</p>
+ *
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
+ */
+ public static IMatchStrategy getDefaultTeamOrPersonMatchStrategy() throws MatchException{
+ IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(TeamOrPersonBase.class);
+
+ return strategy;
+ }
+
+
+ /**
+ * <p>getDefaultReferenceMatchStrategy</p>
+ *
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
+ */
+ public static IMatchStrategy getDefaultReferenceMatchStrategy() throws MatchException{
+ IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(Reference.class);
+
+ strategy.setMatchMode("title", MatchMode.EQUAL);
+ strategy.setMatchMode("inReference", MatchMode.IGNORE);
+
+ return strategy;
+ }
+
+ /**
+ * <p>setMatchStrategy</p>
+ *
+ * @param matchStrategy a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static void setMatchStrategy(IMatchStrategy matchStrategy) {
+ PreferencesUtil.setMatchStrategy(matchStrategy);
+ }
+
+}
import java.util.ArrayList;
import java.util.List;
-import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.name.NonViralName;
return new ArrayList<INomenclaturalReference>();
}
try{
- return CdmStore.getService(ICommonService.class).findMatching(nomenclaturalReference, MatchStrategy.Reference);
+
+ return CdmStore.getCommonService().findMatching(nomenclaturalReference, MatchStrategy.Reference);
+
}catch (MatchException e) {
MessagingUtils.error(this.getClass(), "Error finding matching references", e);
}
}
try{
- return CdmStore.getService(ICommonService.class).findMatching(authorTeam, MatchStrategy.TeamOrPerson);
+
+ return CdmStore.getCommonService().findMatching(authorTeam, MatchStrategy.TeamOrPerson);
+
}catch (MatchException e) {
MessagingUtils.error(this.getClass(), "Error finding matching authors", e);
}
private List<TaxonNameBase> findMatchingLatinNames(TaxonNameBase taxonNameBase) {
try {
- return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategy.NonViralName);
+
+ return CdmStore.getCommonService().findMatching(taxonNameBase, MatchStrategy.NonViralName);
+
} catch (MatchException e) {
MessagingUtils.error(this.getClass(), "Error finding matching names", e);
--- /dev/null
+// $Id$
+/**
+* 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.preference;
+
+import org.eclipse.core.expressions.PropertyTester;
+
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author n.hoffmann
+ * @created Jan 26, 2011
+ * @version 1.0
+ */
+public class CdmStorePropertyTester extends PropertyTester {
+
+ private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+
+ if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){
+ return isCdmStoreConnected();
+ }
+ return false;
+ }
+
+ private boolean isCdmStoreConnected(){
+ boolean active = CdmStore.isActive();
+ return active;
+ }
+}
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
/**
"eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler");
button_openFeatureTree.setText("Open Distribution Selection Wizard");
+ PreferencesUtil.recursiveSetEnabled(button_openFeatureTree, CdmStore.isActive());
+
if(isEditorActivated){
child.setEnabled(true);
}else{
// $Id$
/**
* 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.
*/
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import eu.etaxonomy.taxeditor.featuretree.FeatureTreeEditorWizard;
-import eu.etaxonomy.taxeditor.featuretree.OpenFeatureTreeEditorWizardHandler;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
/**
* <p>
* FeatureTreePreferences class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Aug 5, 2010
* @version 1.0
* <p>
* Constructor for FeatureTreePreferences.
* </p>
- *
+ *
* @param title
* a {@link java.lang.String} object.
*/
* <p>
* Constructor for FeatureTreePreferences.
* </p>
- *
+ *
* @param title
* a {@link java.lang.String} object.
* @param image
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
* .swt.widgets.Composite)
/** {@inheritDoc} */
@Override
protected Control createContents(Composite parent) {
-
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
final CommandHandlerButton button_openFeatureTree = new CommandHandlerButton(composite, SWT.PUSH, "eu.etaxonomy.taxeditor.store.open.FeatureTreeEditorWizard");
button_openFeatureTree.setText("Open FeatureTree Editor");
-
+ PreferencesUtil.recursiveSetEnabled(composite, CdmStore.isActive());
return composite;
}
}
/** Constant <code>SORT_RANKS_HIERARCHICHALLY="eu.etaxonomy.taxeditor.menus.sortRanksH"{trunked}</code> */
public static final String SORT_RANKS_HIERARCHICHALLY = "eu.etaxonomy.taxeditor.menus.sortRanksHierarchichally";
-
+ /** Constant <code>SORT_NODES_NATURALL="eu.etaxonomy.taxeditor.menus.sortNodesN"{trunked}</code> */
+ public static final String SORT_NODES_NATURALLY = "eu.etaxonomy.taxeditor.menus.sortNodesNaturally";
+
/**
* Whether multilanguage text fields should be editable in multiple languages.
*/
package eu.etaxonomy.taxeditor.preference;
import java.io.IOException;
+import java.util.Locale;
import org.apache.commons.lang.StringUtils;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+
+import eu.etaxonomy.taxeditor.Messages;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
/**
* @author n.hoffmann
private CCombo combo;
PreferencesUtil preferencesUtil = new PreferencesUtil();
+ private boolean isSelectionChanged = false;
+ private int initalSelectionIndex;
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
private void createEditorDefaultLanguage(Composite container) {
// TODO Auto-generated method stub
final Label description = new Label(container, SWT.NONE);
- description.setText("After changing the default language, a restart is required,\nin order for the new settings to take effect.");
+ description.setText(Messages.LanguageEditorPreferencePage_RestartRequired);
final Label label = new Label(container, SWT.NONE);
- label.setText("Please choose your default language for the editor: ");
+ label.setText(Messages.LanguageEditorPreferencePage_ChooseDefaultLanguage);
GridData oneLine = new GridData();
oneLine.grabExcessHorizontalSpace = true;
public void widgetSelected(SelectionEvent e) {
try {
preferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
+ if(initalSelectionIndex != combo.getSelectionIndex()) {
+ isSelectionChanged = true;
+ }else{
+ isSelectionChanged = false;
+ }
} catch (IOException e1) {
- e1.printStackTrace();
+ MessagingUtils.messageDialog("Failed to write Config.ini", LanguageEditorPreferencePage.class,
+ "Language switch failed, because could not write to Folder. No writing permissions!", null);
}
}
private void restoreSavedSelection() {
String rememberedValue = PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.DEFAULT_LANGUAGE_EDITOR);
if(StringUtils.isNotEmpty(rememberedValue)&& StringUtils.isNotBlank(rememberedValue)){
- if(rememberedValue.equalsIgnoreCase("en")){
+ if(rememberedValue.equalsIgnoreCase("en")){ //$NON-NLS-1$
+ initalSelectionIndex = 1;
+ combo.select(1);
+ }else if(rememberedValue.equalsIgnoreCase("de")){ //$NON-NLS-1$
+ initalSelectionIndex = 0;
+ combo.select(0);
+ }
+ }else{
+ Locale locale = Locale.getDefault();
+ if(locale.getLanguage().equals(new Locale("de").getLanguage())){
+ initalSelectionIndex = 0;
+ combo.select(0);
+ }else if(locale.getLanguage().equals(new Locale("en").getLanguage())){
+ initalSelectionIndex = 1;
combo.select(1);
- }else if(rememberedValue.equalsIgnoreCase("de")){
- combo.select(0);
}
}
}
private enum Language{
- GERMAN("Deutsch"), ENGLISH("English");
+ GERMAN("Deutsch"), ENGLISH("English"); //$NON-NLS-1$ //$NON-NLS-2$
private final String label;
private Language(String label){
this.label = label;
@Override
public boolean performOk() {
try {
- preferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
+ if(isSelectionChanged){
+ preferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
+ boolean result = MessageDialog.openConfirm(getShell(), Messages.LanguageEditorPreferencePage_PleaseRestart, Messages.LanguageEditorPreferencePage_EditorHasToRestart);
+ if(result){
+ //Press Ok
+ PlatformUI.getWorkbench().restart();
+ }
+ }
} catch (IOException e) {
e.printStackTrace();
}
return super.performOk();
}
+
}
--- /dev/null
+package eu.etaxonomy.taxeditor.preference;\r
+\r
+import java.io.IOException;\r
+\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.preference.PreferencePage;\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.events.SelectionAdapter;\r
+import org.eclipse.swt.events.SelectionEvent;\r
+import org.eclipse.swt.graphics.Image;\r
+import org.eclipse.swt.graphics.Point;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Button;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.ui.IWorkbench;\r
+import org.eclipse.ui.IWorkbenchPreferencePage;\r
+import org.eclipse.ui.PlatformUI;\r
+\r
+import eu.etaxonomy.taxeditor.Messages;\r
+\r
+public class OrderPreferences extends PreferencePage implements IWorkbenchPreferencePage {\r
+ \r
+\r
+ boolean isNaturalOrderActivated;\r
+ boolean isSelectionChanged = false;\r
+ /*\r
+ * (non-Javadoc)\r
+ *\r
+ * @see\r
+ * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors\r
+ * ()\r
+ */\r
+ @Override\r
+ protected Control createContents(Composite parent) {\r
+\r
+ Composite composite = new Composite(parent, SWT.NULL);\r
+ composite.setLayout(new GridLayout());\r
+ final Label description = new Label(parent, SWT.NONE);\r
+ description.setText(Messages.OrderPreferencePage_NewNavigatorWindowRequired);\r
+ isNaturalOrderActivated = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SORT_NODES_NATURALLY);\r
+ final Button activateCheckButton = new Button(composite, SWT.CHECK);\r
+ activateCheckButton.setText("Enable Natural Order");\r
+ activateCheckButton.setSelection(isNaturalOrderActivated);\r
+ activateCheckButton.addSelectionListener(new SelectionAdapter(){\r
+ @Override\r
+ public void widgetSelected(SelectionEvent e) {\r
+ if(isNaturalOrderActivated != activateCheckButton.getSelection()) {\r
+ isNaturalOrderActivated = activateCheckButton.getSelection();\r
+ PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SORT_NODES_NATURALLY, isNaturalOrderActivated);\r
+ isSelectionChanged = true;\r
+ }else{\r
+ isSelectionChanged = false;\r
+ }\r
+\r
+ }\r
+ });\r
+\r
+ \r
+\r
+ return composite;\r
+ }\r
+\r
+ \r
+ @Override\r
+ public void init(IWorkbench workbench) {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ /* (non-Javadoc)\r
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()\r
+ */\r
+ @Override\r
+ public boolean performOk() {\r
+ if(isSelectionChanged){\r
+ MessageDialog.openInformation(getShell(), null, Messages.OrderPreferencePage_PleaseReopenNavigator); \r
+ return super.performOk();\r
+ }\r
+ return true;\r
+ }\r
+\r
+\r
+}\r
import org.eclipse.core.expressions.PropertyTester;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
/**
* @author n.hoffmann
* @created Jan 26, 2011
private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled";
- private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
@Override
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
-
if(SHOW_EXPERIMENTAL_FEATURES.equals(property)){
return isShowExperimentalFeatures();
}
if(SHOW_CHECKLIST_EDITOR.equals(property)){
return isChecklistEditorEnabled();
}
- if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){
- return isCdmStoreConnected();
- }
-
return false;
}
return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
}
- private boolean isCdmStoreConnected(){
- boolean active = CdmStore.isActive();
- return active;
- }
}
import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
*/
public void writePropertyToConfigFile(int setLanguage) throws IOException {
File file = org.eclipse.core.runtime.preferences.ConfigurationScope.INSTANCE.getLocation().toFile();
+ //give warning to user if the directory has no write access
+ if(file == null){
+ throw new IOException();
+ }
Properties properties = load(file.getAbsolutePath()+"/config.ini");
switch(setLanguage){
case 0:
return p2Repos;
}
+
+ /**
+ * enables/disables nested composite. <br>
+ *
+ * @param ctrl - Composite to be en-/disabeld
+ * @param enabled - boolean
+ */
+ public static void recursiveSetEnabled(Control ctrl, boolean enabled) {
+ if (ctrl instanceof Composite) {
+ Composite comp = (Composite) ctrl;
+ for (Control c : comp.getChildren()) {
+ recursiveSetEnabled(c, enabled);
+ }
+ } else {
+ ctrl.setEnabled(enabled);
+ }
+ }
+
+ /**
+ * <p>
+ * getSortRanksNaturally
+ * </p>
+ *
+ * @return a boolean.
+ */
+ public static boolean getSortNodesNaturally() {
+ return getPreferenceStore().getBoolean(SORT_NODES_NATURALLY);
+ }
+
+ /**
+ * <p>
+ * setSortRanksNaturally
+ * </p>
+ *
+ * @param selection
+ * a boolean.
+ */
+ public static void setSortNodesNaturally(boolean selection) {
+ getPreferenceStore().setValue(SORT_NODES_NATURALLY, selection);
+ }
}
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.api.service.IService;
import eu.etaxonomy.cdm.config.ICdmSource;
import eu.etaxonomy.cdm.database.DbSchemaValidation;
private static SearchManager searchManager = new SearchManager();
private static EditorManager editorManager = new EditorManager();
+
+ private static UseObjectStore useObjectInitializer = new UseObjectStore();
private static CdmStoreConnector job;
return service;
}
+
+ /**
+ * @see #getService(Class)
+ * As ICommonService is not extending IService we need a specific request here
+ */
+ public static ICommonService getCommonService() {
+ ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration();
+
+ return configuration.getCommonService();
+
+ }
/**
* <p>
// $Id$
/**
* 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.
*/
CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter
.CreateSubMonitor(monitor, 7);
// This is where we instantiate the application controller
+ int oldPriority = Thread.currentThread().getPriority();
try {
-
+ Thread.currentThread().setPriority(10);
applicationController = getApplicationController(cdmSource,subprogressMonitor);
-
} catch (Exception e) {
if(! causeIsCancelationExceptionRecursive(e)){
return new Status(IStatus.ERROR, "Could not connect to CDM Store", "An error occurred while trying to connect to datasource: " + cdmSource.getName(), e);
}
} finally {
monitor.done();
+ Thread.currentThread().setPriority(oldPriority);
}
}
-
-
+
+
if (!monitor.isCanceled()) {
CdmStore.setInstance(applicationController, cdmSource);
display.asyncExec(new Runnable() {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Runnable#run()
*/
@Override
display.asyncExec(new Runnable() {
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Runnable#run()
*/
@Override
private ICdmApplicationConfiguration getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
if(cdmSource instanceof ICdmDataSource) {
- return CdmApplicationController.NewInstance(applicationContextBean,
- (ICdmDataSource)cdmSource,
+ return CdmApplicationController.NewInstance(applicationContextBean,
+ (ICdmDataSource)cdmSource,
dbSchemaValidation,
- false,
+ false,
subprogressMonitor);
} else if(cdmSource instanceof ICdmRemoteSource) {
- return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
- false,
+ return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
+ false,
subprogressMonitor,
null);
} else {
return causeIsCancelationExceptionRecursive(throwable.getCause());
}
}
-
+
private void checkDatabaseReachable(IProgressMonitor monitor) {
try {
monitor.subTask("Checking if datasource is reachable.");
MessagingUtils.messageDialog("Could not connect to chosen datasource",
this, "Reason: " + e.getMessage(), e);
monitor.setCanceled(true);
- }
+ }
}
}
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
return CdmStore.getService(ITaxonService.class).findTaxaAndNamesForEditor(configurator);
}
-
-
+
+
/**
* <p>findReferences</p>
* @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
* @return a {@link java.util.List} object.
*/
- public List<AgentBase> findTeamOrPersons(IIdentifiableEntityServiceConfigurator configurator){
+ @SuppressWarnings("unchecked")
+ public List<TeamOrPersonBase> findTeamOrPersons(IIdentifiableEntityServiceConfigurator configurator){
configurator.setClazz(TeamOrPersonBase.class);
- return findAgents(configurator);
+ return (List)findAgents(configurator);
}
/**
* @param showFieldUnits if <code>true</code> then also FieldUnits are searched
* @return
*/
- public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator configurator, boolean showFieldUnits){
- if(! showFieldUnits){
- configurator.setClazz(DerivedUnit.class);
+ public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits){
+ if(configurator.getClazz()==null){
+ if(showFieldUnits){
+ configurator.setClazz(SpecimenOrObservationBase.class);
+ }
+ else{
+ configurator.setClazz(DerivedUnit.class);
+ }
+ }
+ if(configurator.getClazz().equals(SpecimenOrObservationBase.class)){
+ //get FieldUnits + DerivedUnits
+ List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
+ configurator.setClazz(DerivedUnit.class);
+ int derivedUnitCount = CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator);
+ configurator.setClazz(FieldUnit.class);
+ int fieldUnitCount = CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator);
+
+ if(checkLargeResult(derivedUnitCount+fieldUnitCount)){
+ configurator.setClazz(DerivedUnit.class);
+ records.addAll(CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords());
+ configurator.setClazz(FieldUnit.class);
+ records.addAll(CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords());
+ }
+ return records;
+
}
- if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countByTitle(configurator))){
+ if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator))){
return CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords();
}
return NO_RESULTS;
}
- /**
- * Searches for {@link SpecimenOrObservationBase} with the parameters specified in the {@link IIdentifiableEntityServiceConfigurator}
- * which match the given {@link SpecimenOrObservationType}
- * @param configurator the configurator to use for the search
- * @param type the type/record basis the specimens must have
- * @return a list of the SpecimenOrObservationBases matching the search parameters found
-
- * @deprecated method needs to be optimized with a direct SQL query instead of iterating over all specimens
- */
- @Deprecated
- //TODO: method needs to be optimized with a direct SQL query instead of iterating over all specimens
- public List<SpecimenOrObservationBase> findOccurrencesByType(IIdentifiableEntityServiceConfigurator configurator, SpecimenOrObservationType type){
- List<SpecimenOrObservationBase> filteredOccurrences = new ArrayList<SpecimenOrObservationBase>();
- List<SpecimenOrObservationBase> occurrences = findOccurrences(configurator, true);
- if(type!=null){
- for(SpecimenOrObservationBase occurrence:occurrences){
- if(occurrence.getRecordBasis().equals(type)
- || occurrence.getRecordBasis().isKindOf(type)
- || type == SpecimenOrObservationType.Unknown){
- filteredOccurrences.add(occurrence);
- }
- }
- }
- else{
- filteredOccurrences = occurrences;
- }
- return filteredOccurrences;
- }
-
public List<User> findUsers(IIdentifiableEntityServiceConfigurator configurator){
String userNameSearchString = sqlizeTitleSearchString(configurator);
// TODO why are users not identifiable entities?
return getFilteredTerms(TermStore.getTerms(clazz));
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.ContextListenerAdapter#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void contextStart(IMemento memento, IProgressMonitor monitor) {
// read preferred terms from memento into an in memory representation
}
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.ContextListenerAdapter#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void contextStop(IMemento memento, IProgressMonitor monitor) {
saveTerms(memento, monitor);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.ContextListenerAdapter#workbenchShutdown(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
saveTerms(memento, monitor);
--- /dev/null
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla protected License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.store;\r
+\r
+import java.util.UUID;\r
+\r
+import eu.etaxonomy.cdm.model.common.VocabularyEnum;\r
+\r
+public class UsageTermCollection {\r
+ protected final static UUID uuidMarkersVocabulary = UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305");\r
+ \r
+ public final static UUID uuidUseMarkerType = UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039");\r
+ \r
+ protected final static UUID uuidFeatureVocabulary = VocabularyEnum.Feature.getUuid(); // UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");\r
+ protected final static UUID uuidPalmWebFeatureTree = UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0");\r
+ \r
+ \r
+ protected final static UUID uuidUseRecordFeature = UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599");\r
+ \r
+ protected final static UUID uuidUseSummaryFeature = UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279");\r
+ \r
+ public final static UUID uuidUseCategoryVocabulary = UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931");\r
+ protected final static UUID uuidUseCategoryDummy = UUID.fromString("983a7184-6a51-489e-aca1-f21fc4fdbae3");\r
+ protected final static UUID uuidUseSubCategoryDummy = UUID.fromString("a8d80223-5c79-4063-8c6b-4dc8681e9c62");\r
+ \r
+ protected final static UUID uuidCountryVocabulary = UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b");\r
+ protected final static UUID uuidCountryDummy = UUID.fromString("761dddee-bfa2-41f4-82df-3a19c71adee0");\r
+ \r
+ protected final static UUID uuidPlantPartVocabulary = UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35");\r
+ protected final static UUID uuidPlantPartDummy = UUID.fromString("30150a82-a12f-4278-96ad-7ce708efa082");\r
+ \r
+ protected final static UUID uuidHumanGroupVocabulary = UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc");\r
+ protected final static UUID uuidHumanGroupDummy = UUID.fromString("c4b63327-2548-429d-8d55-81fdba5900a5");\r
+ protected final static UUID uuidEthnicGroupDummy = UUID.fromString("3ca851e5-d0d4-41cd-9066-f79e246c36c2");\r
+\r
+ public final static String useMakerLabel = "use";\r
+ public final static String useRecordFeatureLabel = "Use Record";\r
+ public final static String useSummaryFeatureLabel = "Use";\r
+ public final static String useCategoryVocabularyLabel = "Use Category";\r
+ public final static String useSubCategoryVocabularyLabel = "Use SubCategory";\r
+ public final static String countryLabel = "Country";\r
+ public final static String plantPartLabel = "Plant Part";\r
+ public final static String humanGroupLabel = "Human Group";\r
+ public final static String ethnicGroupLabel = "Ethnic Group";\r
+ public final static String notAvailableLabel = "N/A";\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+\r
+\r
+ \r
+ \r
+}\r
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.store;\r
+\r
+import java.net.URI;\r
+import java.net.URISyntaxException;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.NullProgressMonitor;\r
+\r
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
+import eu.etaxonomy.cdm.model.common.MarkerType;\r
+import eu.etaxonomy.cdm.model.common.TermType;\r
+import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.cdm.model.description.Feature;\r
+import eu.etaxonomy.cdm.model.description.State;\r
+\r
+/**\r
+ * A store to handle all terms and vocabulary required for \r
+ * the UseObjects view and components.\r
+ * Whenever one of the terms is requested, all required terms are generated\r
+ * in the database as we consider the requests as an indicator that \r
+ * someone wants to use the terms.\r
+ * This \r
+ * @author a.theys\r
+ * @author a.mueller\r
+ * @created mar 13, 2012\r
+ */\r
+public class UseObjectStore {\r
+\r
+ private static boolean isInitialized;\r
+ \r
+ private static MarkerType useMarkerType;\r
+ private static Feature useSummaryFeature;\r
+ private static Feature useRecordFeature;\r
+ \r
+ \r
+ public static void reset() {\r
+ isInitialized = false;\r
+ useMarkerType = null;\r
+ useSummaryFeature = null;\r
+ useRecordFeature = null;\r
+ }\r
+ \r
+ public static MarkerType getUseMarkerType() {\r
+ initialize();\r
+ return useMarkerType;\r
+ }\r
+ \r
+ public static Feature getUseSummaryFeature() {\r
+ initialize();\r
+ return useSummaryFeature;\r
+ }\r
+ \r
+ public static Feature getUseRecordFeature() {\r
+ initialize();\r
+ return useRecordFeature;\r
+ }\r
+\r
+ \r
+ private static void initialize(){\r
+ setupNecessaryItems(null);\r
+ isInitialized = true;\r
+ }\r
+ \r
+ private static void setupNecessaryItems( IProgressMonitor monitor ) {\r
+ if (isInitialized){\r
+ return;\r
+ }\r
+ if (monitor == null){\r
+ //TODO can we use a better one?\r
+ monitor = new NullProgressMonitor();\r
+ }\r
+ \r
+ ConversationHolder conversation = CdmStore.createConversation();\r
+ \r
+ //retrieve terms and vocabularies from db\r
+ useRecordFeature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);\r
+ useSummaryFeature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
+\r
+ \r
+\r
+ //create use marker type if not exists\r
+ createUseMarkerType(conversation);\r
+\r
+ //create state vocabulary if not exists\r
+ createStateVocabulary(monitor, conversation);\r
+\r
+ //create state vocabulary if not exists\r
+ createCountryVocabulary(monitor, conversation);\r
+\r
+ //create plant part vocabulary\r
+ createPlantVocabulary(monitor, conversation);\r
+\r
+ //create human group vocabulary\r
+ createHumanGroupVocabulary(monitor, conversation);\r
+\r
+ if(useRecordFeature == null || useSummaryFeature == null) {\r
+ TermVocabulary<Feature> featureVocabulary = CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary));\r
+// FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree);\r
+\r
+ if (useRecordFeature == null ) {\r
+ useRecordFeature = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null);\r
+ useRecordFeature.setUuid(UsageTermCollection.uuidUseRecordFeature);\r
+ useRecordFeature.setSupportsCategoricalData(true);\r
+ featureVocabulary.addTerm(useRecordFeature);\r
+ \r
+// if (palmWebFeatureTree != null){\r
+// FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord);\r
+// palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);\r
+// }else{\r
+// StoreUtil.warn(getClass(), "No current feature tree available to add useRecord feature");\r
+// }\r
+ }\r
+ if (useSummaryFeature == null) {\r
+ useSummaryFeature = Feature.NewInstance(UsageTermCollection.useSummaryFeatureLabel, UsageTermCollection.useSummaryFeatureLabel, null);\r
+ useSummaryFeature.setUuid(UsageTermCollection.uuidUseSummaryFeature);\r
+ useSummaryFeature.setSupportsTextData(true);\r
+ featureVocabulary.addTerm(useSummaryFeature);\r
+// if (palmWebFeatureTree != null){\r
+// FeatureNode useSumFeatureNode = FeatureNode.NewInstance(featureUseSummary);\r
+// palmWebFeatureTree.getRoot().addChild(useSumFeatureNode);\r
+// }else{\r
+// StoreUtil.warn(getClass(), "No current feature tree available to add use summary feature");\r
+// }\r
+ }\r
+\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary);\r
+// if (palmWebFeatureTree != null){\r
+// CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree);\r
+// }\r
+ conversation.commit(true);\r
+\r
+ }\r
+ conversation.close();\r
+ }\r
+\r
+\r
+ private static void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) {\r
+ TermVocabulary<DefinedTerm> humanGroupVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
+ if (humanGroupVocabulary == null){\r
+ monitor.subTask("create human group vocabulary");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ humanGroupVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+ humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
+\r
+ DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
+\r
+ DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
+ newDummyModifier.addIncludes(newSubDummyModifier);\r
+ humanGroupVocabulary.addTerm(newDummyModifier);\r
+\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ }\r
+\r
+\r
+ private static void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
+ TermVocabulary<DefinedTerm> plantPartVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
+ if (plantPartVocabulary == null){\r
+ monitor.subTask("create plant part vocabulary");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+ plantPartVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+ plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
+\r
+ DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
+ plantPartVocabulary.addTerm(newDummyModifier);\r
+\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ }\r
+\r
+\r
+ private static void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
+ TermVocabulary<DefinedTerm> countryVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
+ if (countryVocabulary == null){\r
+ monitor.subTask("create country vocabulary");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+ countryVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+ countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
+\r
+ DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
+ countryVocabulary.addTerm(newDummyModifier);\r
+\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ }\r
+\r
+\r
+ private static void createStateVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
+ TermVocabulary<State> stateVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
+ if (stateVocabulary == null){\r
+ monitor.subTask("create state vocabulary");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ stateVocabulary = TermVocabulary.NewInstance(TermType.State, UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+ stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
+\r
+ State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
+ State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy);\r
+ newDummyState.addIncludes(newDummySubCat);\r
+\r
+ stateVocabulary.addTerm(newDummyState);\r
+\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ }\r
+\r
+\r
+ private static void createUseMarkerType(ConversationHolder conversation) {\r
+ useMarkerType = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
+ if (useMarkerType == null){\r
+ useMarkerType = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null);\r
+ useMarkerType.setUuid( UsageTermCollection.uuidUseMarkerType);\r
+ TermVocabulary<MarkerType> markerTypeVocabulary = CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary));\r
+ markerTypeVocabulary.addTerm(useMarkerType);\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.ui.combo;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.store.TermManager;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.ISelectable;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+
+/**
+ * <p>
+ * Abstract AbstractTermComboElement class.
+ * </p>
+ *
+ * @author n.hoffmann
+ * @created Nov 5, 2009
+ * @version 1.0
+ * @param <VOC>
+ */
+public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>>
+ extends AbstractCdmFormElement implements SelectionListener,
+ DisposeListener, IEnableableFormElement, ISelectable {
+
+ private static final int DEFAULT_VISIBLE_ITEMS = 10;
+
+ private VOC selection;
+
+ private VOC emptyElement;
+ private static String EMPTY_ELEMENT_LABEL = "";
+
+ protected Label label;
+ private final Combo combo;
+
+ private ArrayList<VOC> terms;
+
+ private Comparator<VOC> vocComparator;
+
+ private final TermType termType;
+
+ public VocabularyComboElement(CdmFormFactory formFactory,
+ ICdmFormElement parentElement, TermType termType, String labelString, VOC selection,
+ int style) {
+ super(formFactory, parentElement);
+
+ this.termType = termType;
+
+ if (labelString != null) {
+ label = formFactory.createLabel(getLayoutComposite(), labelString);
+ addControl(label);
+ }
+
+ // create combo
+ combo = new Combo(getLayoutComposite(), SWT.BORDER | SWT.READ_ONLY );//FIXME: removed this parameter seems break windows version: | style
+ addControl(combo);
+ combo.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+ combo.setVisibleItemCount(DEFAULT_VISIBLE_ITEMS);
+
+ populateTerms(getVocabularies());
+
+ combo.addSelectionListener(this);
+ combo.addDisposeListener(this);
+ PreferencesUtil.getPreferenceStore().addPropertyChangeListener(this);
+
+ if (selection != null) {
+ setSelection(selection);
+ }
+ }
+
+ /**
+ * <p>
+ * Getter for the field <code>selection</code>.
+ * </p>
+ *
+ * @return a T object.
+ */
+ public VOC getSelection() {
+ return selection;
+ }
+
+ /**
+ * <p>Sets the selection of the combo to the given T object.</p>
+ * <p>Passing <code>null</code> to this method will set the selection to
+ * the empty element and effectively clear the selection</p>
+ *
+ * @param selection
+ * a T object or <code>null</code> to clear the selection
+ */
+ public void setSelection(VOC selection) {
+ this.selection = selection;
+
+ this.selection = selection;
+
+ Listener[] listeners = combo.getListeners(SWT.Selection);
+
+ for (Listener listener : listeners) {
+ combo.removeListener(SWT.Selection, listener);
+ }
+ int selectedIndex;
+ if(selection == null){
+ // set selection to the emptyElement
+ selectedIndex = 0;
+ }else{
+ selectedIndex = terms.indexOf(selection);
+ if (selectedIndex == -1) {
+ createTermNotInPreferredTerms(selection);
+ selectedIndex = terms.indexOf(selection);
+ }
+ }
+ combo.select(selectedIndex);
+
+ for (Listener listener : listeners) {
+ combo.addListener(SWT.Selection, listener);
+ }
+ }
+
+ /**
+ * Fills the combo with elements and sets up the convenience functions
+ * for selection index
+ *
+ * @param preferredTerms
+ */
+ private void populateTerms(List<VOC> preferredTerms) {
+
+ combo.removeAll();
+
+ terms = new ArrayList<VOC>();
+
+ int i = 1;
+ int index = 0;
+
+ // Add an empty element for when nothing was selected yet
+ combo.add(EMPTY_ELEMENT_LABEL);
+ terms.add(emptyElement);
+
+ if (vocComparator != null) {
+ Collections.sort(preferredTerms, vocComparator);
+ }
+ for (VOC term : preferredTerms) {
+ String label = getLabel(term);
+ if (label == null) {
+ if (term.getTitleCache() != null) {
+ label = term.getTitleCache();
+ MessagingUtils.warn(getClass(),
+ "Term does not have a default language representation: " + label
+ + ", " + term.getUuid());
+ } else {
+ label = "Unknown";
+ MessagingUtils.warn(getClass(),
+ "Representation Label and TitleCache empty for term: "
+ + term + ", " + term.getUuid());
+ }
+
+ }
+
+ combo.add(label);
+ terms.add(term);
+
+ i++;
+ if (selection != null) {
+ if (selection.equals(term)) {
+ index = i;
+ }
+ }
+ }
+
+ if (selection != null && index == 0) {
+ createTermNotInPreferredTerms(selection);
+ }
+
+ combo.select(index);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void setEnabled(boolean enabled) {
+ combo.setEnabled(enabled);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#isEnabled()
+ */
+ @Override
+ public boolean isEnabled() {
+ return combo.isEnabled();
+ }
+
+ /**
+ * <p>
+ * preferredTerms
+ * </p>
+ *
+ * @return a {@link java.util.List} object.
+ */
+ protected List<VOC> getVocabularies(){
+ List<TermVocabulary<TERM>> list = CdmStore.getService(IVocabularyService.class).<TERM>findByTermType(termType);
+ return (List<VOC>) list;
+ }
+
+ /**
+ * May be overridden by derived classes if the desired label string does not
+ * reside in term.getLabel();
+ *
+ * @param term
+ * a T object.
+ * @return a {@link java.lang.String} object.
+ */
+ protected String getLabel(VOC term) {
+ if (term == null){
+ return "";
+ }else{
+ return term.getLabel(CdmStore.getDefaultLanguage());
+ }
+ }
+
+ /**
+ *
+ *
+ * @param term
+ */
+ private void createTermNotInPreferredTerms(VOC term) {
+ List<VOC> preferredTerms = getVocabularies();
+
+ preferredTerms.add(term);
+
+ populateTerms(preferredTerms);
+ }
+
+ /**
+ * <p>
+ * addSelectionListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void addSelectionListener(SelectionListener listener) {
+ combo.addSelectionListener(listener);
+ }
+
+ /**
+ * <p>
+ * removeSelectionListener
+ * </p>
+ *
+ * @param listener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ */
+ public void removeSelectionListener(SelectionListener listener) {
+ combo.removeSelectionListener(listener);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
+ * .events.SelectionEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selection = terms.get(combo.getSelectionIndex());
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.
+ * PropertyChangeEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if (event != null
+ && PreferencesUtil.PREFERRED_TERMS_CHANGE.equals(event
+ .getProperty())) {
+ populateTerms(getVocabularies());
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setSelected(boolean selected) {
+ setBackground(selected ? SELECTED : getPersistentBackground());
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ PreferencesUtil.getPreferenceStore().removePropertyChangeListener(this);
+ }
+
+ // not used
+ /** {@inheritDoc} */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setIrrelevant(boolean irrelevant) {
+ String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT
+ : Resources.COLOR_COMPOSITE_BACKGROUND;
+
+ Color color = StoreUtil.getColor(colorId);
+ combo.setBackground(color);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setBackground(Color color) {
+ if (label != null) {
+ label.setBackground(color);
+ }
+ }
+
+ /**
+ *
+ */
+ protected TermManager getTermManager() {
+ return CdmStore.getTermManager();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public int getVisibleItemCount(){
+ return combo.getVisibleItemCount();
+ }
+
+ /**
+ *
+ * @param count
+ */
+ public void setVisibleItemCount(int count){
+ combo.setVisibleItemCount(count);
+ }
+
+}
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2015 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.ui.dialog;
-
-import org.apache.log4j.Logger;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
-
-/**
- * @author pplitzner
- * @date Jan 28, 2015
- *
- */
-public class DeleteTaxonConfiguratorDialog extends DeleteConfiguratorDialog {
-
- @SuppressWarnings("unused")
- private final Logger logger = Logger.getLogger(DeleteTaxonConfiguratorDialog.class);
-
- private final TaxonDeletionConfigurator configurator;
-
- /**
- * @param configurator
- * @param parentShell
- * @param dialogTitle
- * @param dialogTitleImage
- * @param dialogMessage
- * @param dialogImageType
- * @param dialogButtonLabels
- * @param defaultIndex
- */
- public DeleteTaxonConfiguratorDialog(TaxonDeletionConfigurator configurator, Shell parentShell, String dialogTitle,
- Image dialogTitleImage, String dialogMessage,int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- this.configurator = configurator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createCustomArea(Composite parent) {
- DeleteConfiguratorComposite composite = new DeleteConfiguratorComposite(configurator, parent, NONE);
- return composite;
- }
-
- public static boolean openConfirmWithConfigurator(TaxonDeletionConfigurator configurator, Shell parent, String title, String message) {
- DeleteTaxonConfiguratorDialog dialog = new DeleteTaxonConfiguratorDialog(configurator, parent, title, getDefaultImage(), message, QUESTION, getButtonLabels(QUESTION), 0);
- return dialog.open() == 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#isResizable()
- */
- @Override
- protected boolean isResizable() {
- return true;
- }
-
-}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.dialog.deleteConfigurator;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.events.IExpansionListener;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author pplitzner
+ * @date Feb 16, 2015
+ *
+ */
+public class DeleteConfiguratorComposite extends Composite implements IExpansionListener{
+
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+ private final Section sctnConfigure;
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public DeleteConfiguratorComposite(final Composite parent, int style) {
+ super(parent, SWT.NONE);
+
+ addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ toolkit.dispose();
+ }
+ });
+ toolkit.paintBordersFor(this);
+ setLayout(new FillLayout(SWT.HORIZONTAL));
+
+ sctnConfigure = toolkit.createSection(this, Section.CLIENT_INDENT | Section.TWISTIE);
+ sctnConfigure.addExpansionListener(this);
+ sctnConfigure.setBackground(getBackground());
+ toolkit.paintBordersFor(sctnConfigure);
+ sctnConfigure.setText("Configure");
+
+
+ }
+
+
+ public void addConfiguratorComposite(Composite configuratorComposite){
+ toolkit.paintBordersFor(configuratorComposite);
+ sctnConfigure.setClient(configuratorComposite);
+ }
+
+ @Override
+ public void expansionStateChanged(ExpansionEvent e) {
+ getShell().setSize(getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ }
+ @Override
+ public void expansionStateChanging(ExpansionEvent e) {
+ }
+ public Section getSectionConfigure() {
+ return sctnConfigure;
+ }
+}
* 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.ui.dialog;
+package eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
+import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
/**
* Abstract subclass of MessageDialog providing the functionality to configure
* @date Jan 28, 2015
*
*/
-public abstract class DeleteConfiguratorDialog extends MessageDialog{
+public class DeleteConfiguratorDialog extends MessageDialog{
- public DeleteConfiguratorDialog(Shell parentShell, String dialogTitle,
+ private final DeleteConfiguratorBase configurator;
+
+ public DeleteConfiguratorDialog(DeleteConfiguratorBase configurator, Shell parentShell, String dialogTitle,
Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
+ this.configurator = configurator;
}
/* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
*/
@Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
+ protected Control createCustomArea(Composite parent) {
+ DeleteConfiguratorComposite composite = new DeleteConfiguratorComposite(parent, NONE);
+ if(configurator instanceof TaxonBaseDeletionConfigurator){
+ composite.addConfiguratorComposite(new DeleteTaxonConfiguratorComposite((TaxonBaseDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
+ }
+ else if(configurator instanceof SpecimenDeleteConfigurator){
+ composite.addConfiguratorComposite(new DeleteSpecimenConfiguratorComposite((SpecimenDeleteConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
+ }
return composite;
}
+ public static boolean openConfirmWithConfigurator(DeleteConfiguratorBase configurator, Shell parent, String title, String message) {
+ DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(configurator, parent, title, getDefaultImage(), message, QUESTION, getButtonLabels(QUESTION), 0);
+ return dialog.open() == 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#isResizable()
+ */
+ @Override
+ protected boolean isResizable() {
+ return true;
+ }
+
+
/**
* @param kind
* @return
*/
- static String[] getButtonLabels(int kind) {
+ protected static String[] getButtonLabels(int kind) {
String[] dialogButtonLabels;
switch (kind) {
case ERROR:
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.dialog.deleteConfigurator;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.PojoProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
+
+/**
+ * @author pplitzner
+ * @date Feb 18, 2015
+ *
+ */
+public class DeleteSpecimenConfiguratorComposite extends Composite {
+ private final DataBindingContext m_bindingContext;
+
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ private final SpecimenDeleteConfigurator configurator;
+ private final Button btnDeleteChildren;
+ private final Button btnDeleteFromTypeDesignation;
+ private final Button btnDeleteMolecularData;
+ private final Button btnDeleteIndividualsassociationsfactual;
+ private final Button btnDeleteSpecimenDescription;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public DeleteSpecimenConfiguratorComposite(SpecimenDeleteConfigurator configurator, Composite parent, int style) {
+ super(parent, style);
+ this.configurator = configurator;
+ addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ toolkit.dispose();
+ }
+ });
+ toolkit.paintBordersFor(this);
+ setLayout(new RowLayout(SWT.VERTICAL));
+
+ btnDeleteChildren = new Button(this, SWT.CHECK);
+ btnDeleteChildren.setText("Delete Children");
+
+ btnDeleteFromTypeDesignation = new Button(this, SWT.CHECK);
+ btnDeleteFromTypeDesignation.setText("Delete from type designation");
+
+ btnDeleteMolecularData = new Button(this, SWT.CHECK);
+ btnDeleteMolecularData.setText("Delete molecular data");
+
+ btnDeleteIndividualsassociationsfactual = new Button(this, SWT.CHECK);
+ btnDeleteIndividualsassociationsfactual.setText("Delete from factual data");
+
+ btnDeleteSpecimenDescription = new Button(this, SWT.CHECK);
+ btnDeleteSpecimenDescription.setText("Delete specimen description");
+ m_bindingContext = initDataBindings();
+
+ }
+ protected DataBindingContext initDataBindings() {
+ DataBindingContext bindingContext = new DataBindingContext();
+ //
+ IObservableValue observeSelectionBtnDeleteChildrenObserveWidget = WidgetProperties.selection().observe(btnDeleteChildren);
+ IObservableValue deleteChildrenConfiguratorObserveValue = PojoProperties.value("deleteChildren").observe(configurator);
+ bindingContext.bindValue(observeSelectionBtnDeleteChildrenObserveWidget, deleteChildrenConfiguratorObserveValue, null, null);
+ //
+ IObservableValue observeSelectionBtnDeleteFromTypeDesignationObserveWidget = WidgetProperties.selection().observe(btnDeleteFromTypeDesignation);
+ IObservableValue deleteFromTypeDesignationConfiguratorObserveValue = PojoProperties.value("deleteFromTypeDesignation").observe(configurator);
+ bindingContext.bindValue(observeSelectionBtnDeleteFromTypeDesignationObserveWidget, deleteFromTypeDesignationConfiguratorObserveValue, null, null);
+ //
+ IObservableValue observeSelectionBtnDeleteMolecularDataObserveWidget = WidgetProperties.selection().observe(btnDeleteMolecularData);
+ IObservableValue deleteMolecularDataConfiguratorObserveValue = PojoProperties.value("deleteMolecularData").observe(configurator);
+ bindingContext.bindValue(observeSelectionBtnDeleteMolecularDataObserveWidget, deleteMolecularDataConfiguratorObserveValue, null, null);
+ //
+ IObservableValue observeSelectionBtnDeleteIndividualsassociationsfactualObserveWidget = WidgetProperties.selection().observe(btnDeleteIndividualsassociationsfactual);
+ IObservableValue deleteFromIndividualsAssociationConfiguratorObserveValue = PojoProperties.value("deleteFromIndividualsAssociation").observe(configurator);
+ bindingContext.bindValue(observeSelectionBtnDeleteIndividualsassociationsfactualObserveWidget, deleteFromIndividualsAssociationConfiguratorObserveValue, null, null);
+ //
+ IObservableValue observeSelectionBtnDeleteSpecimenDescriptionObserveWidget = WidgetProperties.selection().observe(btnDeleteSpecimenDescription);
+ IObservableValue deleteFromDescriptionConfiguratorObserveValue = PojoProperties.value("deleteFromDescription").observe(configurator);
+ bindingContext.bindValue(observeSelectionBtnDeleteSpecimenDescriptionObserveWidget, deleteFromDescriptionConfiguratorObserveValue, null, null);
+ //
+ return bindingContext;
+ }
+}
* 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.ui.dialog;
+package eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.PojoProperties;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.events.IExpansionListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
/**
* @author pplitzner
- * @date Feb 16, 2015
+ * @date Feb 18, 2015
*
*/
-public class DeleteConfiguratorComposite extends Composite implements IExpansionListener{
+public class DeleteTaxonConfiguratorComposite extends Composite {
private final DataBindingContext m_bindingContext;
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
- private TaxonBaseDeletionConfigurator configurator = null;
+ private final TaxonBaseDeletionConfigurator configurator;
private final Button btnDeleteTaxonName;
/**
* @param parent
* @param style
*/
- public DeleteConfiguratorComposite(TaxonBaseDeletionConfigurator configurator, final Composite parent, int style) {
- super(parent, SWT.NONE);
+ public DeleteTaxonConfiguratorComposite(TaxonBaseDeletionConfigurator configurator, Composite parent, int style) {
+ super(parent, style);
this.configurator = configurator;
-
addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
}
});
toolkit.paintBordersFor(this);
- setLayout(new FillLayout(SWT.HORIZONTAL));
-
- Section sctnConfigure = toolkit.createSection(this, Section.CLIENT_INDENT | Section.TWISTIE);
- sctnConfigure.addExpansionListener(this);
- sctnConfigure.setBackground(getBackground());
- toolkit.paintBordersFor(sctnConfigure);
- sctnConfigure.setText("Configure");
+ setLayout(new RowLayout(SWT.VERTICAL));
+ setBackground(getBackground());
- btnDeleteTaxonName = new Button(sctnConfigure, SWT.CHECK);
- sctnConfigure.setClient(btnDeleteTaxonName);
- btnDeleteTaxonName.setText("Delete Taxon Name");
+ btnDeleteTaxonName = new Button(this, SWT.CHECK);
+ btnDeleteTaxonName.setText("Delete taxon name if possible");
m_bindingContext = initDataBindings();
}
+
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
//
return bindingContext;
}
-
- public Button getBtnDeleteTaxonName() {
- return btnDeleteTaxonName;
- }
-
- @Override
- public void expansionStateChanged(ExpansionEvent e) {
- getShell().setSize(getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT));
- }
- @Override
- public void expansionStateChanging(ExpansionEvent e) {
- }
}
super(shell, conversation, title, multi, settings, cdmObject);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
- */
@Override
protected Feature getPersistentObject(UUID uuid) {
- DefinedTermBase term = CdmStore.getService(ITermService.class).load(uuid);
+ DefinedTermBase<?> term = CdmStore.getService(ITermService.class).load(uuid);
if(term instanceof Feature){
return (Feature) term;
return null;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel()
- */
@Override
protected void initModel() {
List<Feature> features = CdmStore.getService(ITermService.class).list(Feature.class, null, null, null, null);
List<UuidAndTitleCache<Feature>> featureUuidAndTitleCache = new ArrayList<UuidAndTitleCache<Feature>>();
for(Feature feature : features){
- UuidAndTitleCache<Feature> uuidAndTitleCache = new UuidAndTitleCache<Feature>(Feature.class, feature.getUuid(), feature.getTitleCache());
+ UuidAndTitleCache<Feature> uuidAndTitleCache = new UuidAndTitleCache<Feature>(Feature.class, feature.getUuid(), feature.getId(), feature.getTitleCache());
featureUuidAndTitleCache.add(uuidAndTitleCache);
}
}
model.clear();
for(FeatureTree featureTree : featureTrees){
- UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(), featureTree.getTitleCache());
+ UuidAndTitleCache<FeatureTree> element = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(),featureTree.getId(), featureTree.getTitleCache());
model.add(element);
}
}
return String.format("Create a new <a>%1s</a>" , "Feature tree ");
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
- */
+
/** {@inheritDoc} */
@Override
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
for(GrantedAuthorityImpl authority : authorities){
- model.add(new UuidAndTitleCache<GrantedAuthorityImpl>(GrantedAuthorityImpl.class, authority.getUuid(),String.format("%s", GrantedAuthorityLabelTextProvider.getText(authority))));
+ model.add(new UuidAndTitleCache<GrantedAuthorityImpl>(GrantedAuthorityImpl.class, authority.getUuid(), authority.getId(), String.format("%s", GrantedAuthorityLabelTextProvider.getText(authority))));
}
}
return String.format("Create a new <a>%1s</a>", "GrantedAuthority ");
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard(java.lang.String)
- */
@Override
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
return new NewGrantedAuthorityWizard();
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
- */
@Override
protected GrantedAuthorityImpl getPersistentObject(UUID uuid) {
return CdmStore.getService(IGrantedAuthorityService.class).load(uuid);
model = new ArrayList<UuidAndTitleCache<Group>>();
for(Group group : groups){
- model.add(new UuidAndTitleCache<Group>(Group.class, group.getUuid(),String.format("%s", group.getName())));
+ model.add(new UuidAndTitleCache<Group>(Group.class, group.getUuid(), group.getId(), String.format("%s", group.getName())));
}
}
model.clear();
for(Object areaObject : terms){
NamedArea area = (NamedArea) HibernateProxyHelper.deproxy(areaObject);
- UuidAndTitleCache<NamedArea> element = new UuidAndTitleCache<NamedArea>(NamedArea.class, area.getUuid(), getTitle(area));
+ UuidAndTitleCache<NamedArea> element = new UuidAndTitleCache<NamedArea>(NamedArea.class, area.getUuid(), area.getId(), getTitle(area));
model.add(element);
}
}
--- /dev/null
+package eu.etaxonomy.taxeditor.ui.dialog.selection;\r
+\r
+import java.util.List;\r
+import java.util.UUID;\r
+\r
+import org.eclipse.swt.widgets.Shell;\r
+\r
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
+import eu.etaxonomy.cdm.model.taxon.Classification;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+\r
+public class TaxonNodeSelectionNaturalOrderDialog extends\r
+ TaxonNodeSelectionDialog {\r
+\r
+ protected TaxonNodeSelectionNaturalOrderDialog(Shell shell,\r
+ ConversationHolder conversation, String title,\r
+ List<UUID> excludeTaxa, boolean multi, TaxonNode node,\r
+ Classification classification) {\r
+ super(shell, conversation, title, excludeTaxa, multi, node, classification);\r
+ // TODO Auto-generated constructor stub\r
+ }\r
+ \r
+ \r
+\r
+}\r
model = new ArrayList<UuidAndTitleCache<User>>();
for(User user : users){
- model.add(new UuidAndTitleCache<User>(User.class, user.getUuid(),String.format("%s, %s", user.getUsername(), user.getPerson())));
+ model.add(new UuidAndTitleCache<User>(User.class, user.getUuid(), user.getId(), String.format("%s, %s", user.getUsername(), user.getPerson())));
}
}
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.description.KeyStatement;
+import eu.etaxonomy.cdm.model.description.MeasurementUnit;
import eu.etaxonomy.cdm.model.description.QuantitativeData;
+import eu.etaxonomy.cdm.model.description.State;
import eu.etaxonomy.cdm.model.description.StateData;
+import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
import eu.etaxonomy.cdm.model.description.TaxonInteraction;
import eu.etaxonomy.cdm.model.description.TextData;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
import eu.etaxonomy.taxeditor.ui.section.description.ScopeSection;
import eu.etaxonomy.taxeditor.ui.section.description.StateDataElement;
import eu.etaxonomy.taxeditor.ui.section.description.StateDataSection;
+import eu.etaxonomy.taxeditor.ui.section.description.StateModifierElement;
import eu.etaxonomy.taxeditor.ui.section.description.StatisticalMeasurementValueElement;
import eu.etaxonomy.taxeditor.ui.section.description.StatisticalMeasurementValueSection;
import eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement;
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailElement;
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.identifier.IdentifierDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.identifier.IdentifierDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailElement;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.CurrentDeterminationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitFacadeDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitFacadeDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.NamedAreaDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.OriginalLabelDataSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.SourceCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenHierarchyDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenHierarchyDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenCurrentDeterminationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit.PreservedSpecimenSourceCollectionDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractSampleDesignationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationCloningDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationCloningDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGelPhotoCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.FeatureDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateModifierCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
return element;
}
+ public <TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>> VocabularyComboElement<TERM, VOC> createVocabularyComboElement(
+ TermType termType, String label, VOC selection, ICdmFormElement parentElement, int style) {
+ VocabularyComboElement<TERM, VOC> element = new VocabularyComboElement<TERM, VOC>(this, parentElement, termType, label, selection, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
+
/**
* <p>
* createBrowserElement
return section;
}
- public DerivedUnitFacadeDetailSection createDerivedUnitFacadeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
- DerivedUnitFacadeDetailSection section = new DerivedUnitFacadeDetailSection(this, conversation, parentElement, selectionProvider, style);
- addAndAdaptSection(parentElement, section);
- return section;
- }
-
public FieldUnitDetailSection createFieldUnitDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
FieldUnitDetailSection section = new FieldUnitDetailSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public SpecimenHierarchyDetailSection createSpecimenHierarchyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ SpecimenHierarchyDetailSection section = new SpecimenHierarchyDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public DerivedUnitBaseDetailSection createDerivedUnitBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
DerivedUnitBaseDetailSection section = new DerivedUnitBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
return element;
}
- public DerivedUnitFacadeDetailElement createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement){
- DerivedUnitFacadeDetailElement element = new DerivedUnitFacadeDetailElement(this, parentElement);
- addAndAdaptElement(parentElement, element);
- return element;
- }
-
public NonViralNameDetailElement createNonViralNameDetailElement(ICdmFormElement parentElement){
NonViralNameDetailElement element = new NonViralNameDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
}
+ public SpecimenHierarchyDetailElement createSpecimenHierarchyDetailElement(ICdmFormElement parentElement) {
+ SpecimenHierarchyDetailElement element = new SpecimenHierarchyDetailElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
return section;
}
+ public StateVocabularyCollectionSection createStateVocabulariesSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ StateVocabularyCollectionSection section = new StateVocabularyCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public StateModifierCollectionSection createStateModifierCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ StateModifierCollectionSection section = new StateModifierCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public MeasurementUnitCollectionSection createMeasurementUnitCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ MeasurementUnitCollectionSection section = new MeasurementUnitCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public StatisticalMeasureCollectionSection createStatisticalMeasureCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ StatisticalMeasureCollectionSection section = new StatisticalMeasureCollectionSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public CollectingAreasDetailSection createCollectingAreasDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public GeoScopeDetailSection createGeoScopeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ GeoScopeDetailSection section = new GeoScopeDetailSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
+ public IdentifierDetailSection createIdentifierDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ IdentifierDetailSection section = new IdentifierDetailSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public CurrentSampleDesignationDetailSection createCurrentSampleDesignationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
CurrentSampleDesignationDetailSection section = new CurrentSampleDesignationDetailSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
- public GeographicalScopeDetailSection createGeographicalScopeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
- GeographicalScopeDetailSection section = new GeographicalScopeDetailSection(this, conversation, parentElement, style);
- addAndAdaptSection(parentElement, section);
- return section;
- }
-
public ScopeRestrictionSection createScopeRestrictionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
ScopeRestrictionSection section = new ScopeRestrictionSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
- /**
- * <p>
- * createEntityCollectionElement
- * </p>
- *
- * @param removeListener
- * a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style
- * a int.
- * @param parentElement
- * a
- * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- * @param versionableEntity
- * a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
- * object.
- * @param backgroundColor
- * a {@link org.eclipse.swt.graphics.Color} object.
- * @return a
- * {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
- * object.
- */
public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
AbstractEntityCollectionElement element = null;
} else if (entity instanceof Marker) {
element = new MarkerElement(this, parentElement, (Marker) entity, removeListener, style);
} else if (entity instanceof Media) {
- element = new MediaMetaElement(this, parentElement, (Media) entity, removeListener, style);
+ element = new MediaMetaElement(this, parentElement, (Media) entity, removeListener, true, style);
} else if (entity instanceof MediaRepresentation) {
element = new MediaRepresentationElement(this, parentElement, (MediaRepresentation) entity, removeListener,
style);
} else if (entity instanceof IdentifiableSource) {
element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
style);
- } else if (entity instanceof DefinedTerm) {
- switch(((DefinedTerm)entity).getTermType()) {
- case Scope:
- element = new ScopeElement(this,
- parentElement,
- (DefinedTerm) entity,
- removeListener,
- style);
- break;
- case Modifier:
- element = new ModifierElement(this,
- parentElement,
- (DefinedTerm) entity,
- removeListener,
- style);
- break;
- default:
- //FIXME : Actually we should through an exception here
- element = null;
- break;
-
- }
+ } else if (entity instanceof DefinedTerm) {
+ switch(((DefinedTerm)entity).getTermType()) {
+ case Scope:
+ element = new ScopeElement(this,
+ parentElement,
+ (DefinedTerm) entity,
+ removeListener,
+ style);
+ break;
+ case Modifier:
+ element = new ModifierElement(this,
+ parentElement,
+ (DefinedTerm) entity,
+ removeListener,
+ style);
+ break;
+ default:
+ break;
+
+ }
} else if (entity instanceof Reference) {
if(parentElement instanceof SequenceReferenceCollectionDetailSection){
element = new SequenceReferenceCollectionDetailElement(this, parentElement, (Reference) entity, removeListener, style);
element = new StatisticalMeasurementValueElement(this, parentElement, (StatisticalMeasurementValue) entity,
removeListener, style);
} else if (entity instanceof DerivedUnit) {
- switch(((DerivedUnit)entity).getRecordBasis()) {
- case LivingSpecimen:
- case PreservedSpecimen:
- case OtherSpecimen:
- element = new SpecimenCollectionDetailElement(this,
- parentElement,
- (DerivedUnit) entity,
- removeListener,
- style);
- break;
- default:
- element = new DerivedUnitElement(this,
- parentElement,
- (DerivedUnit) entity,
- removeListener,
- style);
- }
+ switch(((DerivedUnit)entity).getRecordBasis()) {
+ case LivingSpecimen:
+ case PreservedSpecimen:
+ case OtherSpecimen:
+ element = new SpecimenCollectionDetailElement(this,
+ parentElement,
+ (DerivedUnit) entity,
+ removeListener,
+ style);
+ break;
+ default:
+ element = new DerivedUnitElement(this,
+ parentElement,
+ (DerivedUnit) entity,
+ removeListener,
+ style);
+ }
} else if (entity instanceof NamedArea) {
element = new NamedAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
}
} else if (entity instanceof Identifier) {
- element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
+ if(parentElement instanceof AbstractSampleDesignationDetailSection){
+ element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
+ }
+ else{
+ element = new IdentifierDetailElement(this, parentElement, (Identifier) entity, removeListener, style);
+ }
+ } else if (entity instanceof TermVocabulary) {
+ TermVocabulary<?> termVocabulary = (TermVocabulary<?>)entity;
+ switch (termVocabulary.getTermType()) {
+ case State:
+ element = new StateVocabularyCollectionElement(this, parentElement, (TermVocabulary<State>) entity, removeListener, backgroundColor, style);
+ break;
+ case Modifier:
+ element = new StateModifierElement(this, parentElement, (TermVocabulary<DefinedTerm>) entity, removeListener, backgroundColor, style);
+ break;
+ default:
+ break;
+ }
+ } else if (entity instanceof MeasurementUnit) {
+ element = new MeasurementUnitCollectionElement(this, parentElement, (MeasurementUnit) entity, removeListener, backgroundColor, style);
+ } else if (entity instanceof StatisticalMeasure) {
+ element = new StatisticalMeasureCollectionElement(this, parentElement, (StatisticalMeasure) entity, removeListener, backgroundColor, style);
}
if (element == null) {
text_minVal.setNumber(getEntity().getAbsoluteElevation());
}
if(getEntity().getAbsoluteElevationMaximum() != null) {
- text_maxVal.setNumber(getEntity().getAbsoluteElevation());
+ text_maxVal.setNumber(getEntity().getAbsoluteElevationMaximum());
}
if(getEntity().getAbsoluteElevationText() != null) {
text_freeText.setText(getEntity().getAbsoluteElevationText());
* @return the Integer value or null if {@link NumberFormatException} occurs.
*/
public Integer getInteger() {
- String text = super.getText().trim();
- try {
- return text.equals("") ? 0 : new Integer(text);
- } catch (NumberFormatException e) {
- exception = e;
- }
+ if(super.getText()!=null){
+ String text = super.getText().trim();
+ try {
+ return StringUtils.isBlank(text) ? 0 : new Integer(text);
+ } catch (NumberFormatException e) {
+ exception = e;
+ }
+ }
return null;
}
public Float getFloat(){
String text = super.getText();
try {
- return new Float(text);
+ return StringUtils.isBlank(text) ? 0 : new Float(text);
} catch (NumberFormatException e) {
exception = e;
}
package eu.etaxonomy.taxeditor.ui.element;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataField;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
*/
public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
+ private TextWithLabelElement textOriginalLabel;
+
/**
* @param formFactory
* @param formElement
@Override
protected void createControls(ICdmFormElement formElement,
DerivedUnitFacade entity, int style) {
- OriginalLabelDataField originalLabelDataField = new OriginalLabelDataField(formElement.getLayoutComposite(), style, entity.innerDerivedUnit(), getFormFactory());
- originalLabelDataField.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+ textOriginalLabel = formFactory.createMultiLineTextWithLabel(formElement, "Original Label Info", 120, style);
+ textOriginalLabel.setText(entity.getOriginalLabelInfo());
}
/*
*/
@Override
public void handleEvent(Object eventSource) {
+ if(eventSource==textOriginalLabel){
+ getEntity().setOriginalLabelInfo(textOriginalLabel.getText());
+ }
}
}
*/
package eu.etaxonomy.taxeditor.ui.element;
+import org.apache.commons.lang.StringUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
* @return a {@link java.lang.String} object.
*/
public String getText() {
- return text.getText();
+ if (StringUtils.isBlank(text.getText())){
+ return null;
+ }else{
+ return text.getText();
+ }
}
/**
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2014 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.ui.mvc;
-
-import java.util.List;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
-
-/**
- * @author pplitzner
- * @date 23.06.2014
- *
- */
-public class OriginalLabelDataField extends Composite {
-
- private DataBindingContext m_bindingContext;
- private DerivedUnit derivedUnit = null;
- private final Text originalLabelInfoText;
- private CdmFormFactory formFactory;
-
- public OriginalLabelDataField(Composite parent, int style, DerivedUnit newDerivedUnit, CdmFormFactory formFactory) {
- this(parent, style);
- setDerivedUnit(newDerivedUnit);
- this.formFactory = formFactory;
- }
-
- public OriginalLabelDataField(Composite parent, int style) {
- super(parent, style);
- setLayout(new GridLayout(2, false));
-
- new Label(this, SWT.NONE).setText("Original Label Data");
-
- originalLabelInfoText = new Text(this, SWT.BORDER | SWT.WRAP | SWT.MULTI);
- originalLabelInfoText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- if(formFactory!=null){
- List<IPropertyChangeListener> propertyChangeListeners = formFactory.getPropertyChangeListeners();
- for (IPropertyChangeListener iPropertyChangeListener : propertyChangeListeners) {
- iPropertyChangeListener.propertyChange(new CdmPropertyChangeEvent(OriginalLabelDataField.this, e));
- }
- }
- }
- });
- originalLabelInfoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
- if (derivedUnit != null) {
- m_bindingContext = initDataBindings();
- }
- }
-
- @Override
- protected void checkSubclass() {
- // Disable the check that prevents subclassing of SWT components
- }
-
- private DataBindingContext initDataBindings() {
- IObservableValue originalLabelInfoObserveWidget = SWTObservables.observeText(originalLabelInfoText, SWT.Modify);
- IObservableValue originalLabelInfoObserveValue = BeansObservables
- .observeValue(derivedUnit, "originalLabelInfo");
- //
- DataBindingContext bindingContext = new DataBindingContext();
- //
- bindingContext.bindValue(originalLabelInfoObserveWidget, originalLabelInfoObserveValue, null, null);
- //
- return bindingContext;
- }
-
- public DerivedUnit getDerivedUnit() {
- return derivedUnit;
- }
-
- public void setDerivedUnit(DerivedUnit newDerivedUnit) {
- setDerivedUnit(newDerivedUnit, true);
- }
-
- public void setDerivedUnit(DerivedUnit newDerivedUnit, boolean update) {
- derivedUnit = newDerivedUnit;
- if (update) {
- if (m_bindingContext != null) {
- m_bindingContext.dispose();
- m_bindingContext = null;
- }
- if (derivedUnit != null) {
- m_bindingContext = initDataBindings();
- }
- }
- }
-
-}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
*/
protected void setSectionTitle() {
String title = "";
- if (getEntity() != null && (getEntity() instanceof IdentifiableEntity)) {
+ if (getEntity() != null && (getEntity() instanceof IdentifiableEntity) && !(getEntity() instanceof SpecimenOrObservationBase)) {
title = ": " + ((IdentifiableEntity) getEntity()).getTitleCache();
}
this.setText(String.format("%s%s", getHeading(), title));
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
private final Composite box;
- private Button button_remove;
+ private Button btnRemove;
+ private Button btnChooseEntity;
private Color backgroundColor;
* a ENTITY object.
*/
public AbstractEntityCollectionElement(CdmFormFactory formFactory,
- AbstractFormSection section, ENTITY entity,
- SelectionListener removeListener, Color backgroundColor, int style) {
+ AbstractFormSection section, ENTITY entity,
+ SelectionListener removeListener, Color backgroundColor, int style) {
+ this(formFactory, section, entity, removeListener, false, backgroundColor, style);
+ }
+ public AbstractEntityCollectionElement(CdmFormFactory formFactory,
+ AbstractFormSection section, ENTITY entity, SelectionListener removeListener,
+ boolean isChoosableEntity, Color backgroundColor, int style) {
super(formFactory, (ICdmFormElement) section);
init();
formFactory.addPropertyChangeListener(this);
- // section.getLayoutComposite().setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_CYAN));
-
box = formFactory.createComposite(section.getLayoutComposite());
box.setBackgroundMode(SWT.INHERIT_DEFAULT);
addControl(box);
- TableWrapLayout boxLayout = LayoutConstants.LAYOUT(2, false);
+ TableWrapLayout boxLayout = LayoutConstants.LAYOUT(3, false);
boxLayout.topMargin = 4;
boxLayout.bottomMargin = 4;
box.setLayout(boxLayout);
box.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
- // box.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
-
container = formFactory.createComposite(box);
container.setBackgroundMode(SWT.INHERIT_DEFAULT);
- // container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
setLayoutComposite(container);
addControl(container);
container.setLayout(containerLayout);
container.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+ if(isChoosableEntity){
+ btnChooseEntity = formFactory.createButton(box, null, SWT.PUSH);
+ addControl(btnChooseEntity);
+ btnChooseEntity.setLayoutData(LayoutConstants.RIGHT());
+ btnChooseEntity.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
+ btnChooseEntity.setToolTipText("Browse");
+ btnChooseEntity.addListener(SWT.Selection, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ ENTITY entity = selectFromDialog();
+ if(entity!=null){
+ if(getParentElement() instanceof AbstractEntityCollectionSection){
+ ((AbstractEntityCollectionSection)getParentElement()).removeElement(getEntity());
+ setEntity(entity);
+ ((AbstractEntityCollectionSection)getParentElement()).addElement(entity);
+ ((AbstractEntityCollectionSection)getParentElement()).firePropertyChangeEvent(getParentElement());
+ }
+ }
+ }
+ });
+ }
+
if (removeListener != null) {
- button_remove = formFactory.createButton(box, null, SWT.PUSH);
- addControl(button_remove);
- button_remove.setLayoutData(LayoutConstants.RIGHT());
- button_remove.setImage(ImageResources
+ btnRemove = formFactory.createButton(box, null, SWT.PUSH);
+ addControl(btnRemove);
+ btnRemove.setLayoutData(LayoutConstants.RIGHT());
+ btnRemove.setImage(ImageResources
.getImage(ImageResources.TRASH_ICON));
- button_remove.setToolTipText("Remove");
+ btnRemove.setToolTipText("Remove");
- button_remove.addSelectionListener(removeListener);
+ btnRemove.addSelectionListener(removeListener);
}
createControls(this, style);
return entity;
}
+ /**
+ * Sub classes should override to provide the functionality to choose the
+ * entity from existing ones from the data source.<br>
+ * <b>Note:</b> to enable this functionality sub classes have to set
+ * the corresponding flag in the super constructor
+ * @return an existing entity from the data source
+ */
+ protected ENTITY selectFromDialog(){
+ return null;
+ }
+
/**
* <p>
* createControls
/**
* Call this method after dynamically changing the client area.
- * If the options changed is set to true, will also fire a state changed
+ * If the options changed is set to <code>true</code>, will also fire a state changed
* event to inform the user of unsaved changes.
*
* @param changed a boolean.
*/
protected void internalUpdateSection(boolean changed){
+ setSectionTitle();
destroyDynamicContent();
if(isExpanded() || expandSectionWhenContentAvailable()) {
renderContent(isExpanded());
/** {@inheritDoc} */
@Override
protected String getTooltipString() {
- return "Add a membmer to this team";
+ return "Add a member to this team";
}
/** {@inheritDoc} */
// $Id$
/**
* 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.
*/
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* <p>
* ClassificationDetailElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Sep 27, 2010
* @version 1.0
private TextWithLabelElement text_microReference;
+ private TimePeriodElement element_date;
+
+ private GeoScopeDetailSection section_collectingAreas;
+
+
+
+
/**
* <p>
* Constructor for ClassificationDetailElement.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement,
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement,
- Classification entity, int style) {
- text_treeLabel = formFactory.createTextWithLabelElement(formElement,
- "Label", entity != null ? entity.getTitleCache() : null,
- SWT.NULL);
- selection_reference = formFactory
- .createSelectionElement(Reference.class,
- getConversationHolder(), formElement, "Reference",
- entity != null ? entity.getReference() : null,
- EntitySelectionElement.ALL, SWT.NULL);
- text_microReference = formFactory.createTextWithLabelElement(
- formElement, "Reference Detail",
- entity != null ? entity.getMicroReference() : null, SWT.NULL);
+ Classification entity, int style) {
+ text_treeLabel = formFactory.createTextWithLabelElement(formElement, "Label", entity != null ? entity.getTitleCache() : null, SWT.NULL);
+ selection_reference = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Reference",
+ entity != null ? entity.getReference() : null, EntitySelectionElement.ALL, SWT.NULL);
+ text_microReference = formFactory.createTextWithLabelElement(formElement, "Reference Detail",
+ entity != null ? entity.getMicroReference() : null, SWT.NULL);
+ element_date = formFactory.createTimePeriodElement(formElement, "Date",
+ entity.getTimeperiod(), style);
+ section_collectingAreas = formFactory.createGeoScopeDetailSection(getConversationHolder(), formElement, SWT.NULL);
+ section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_collectingAreas.setEntity(entity);
+
}
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
* .lang.Object)
getEntity().setReference(selection_reference.getEntity());
} else if (eventSource == text_microReference) {
getEntity().setMicroReference(text_microReference.getText());
+ }else if (eventSource == element_date) {
+ getEntity().setTimeperiod(element_date.getTimePeriod());
}
}
}
package eu.etaxonomy.taxeditor.ui.section.classification;
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.swt.widgets.Text;
+
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.name.Rank;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Classification;
selection_reuseExistingTaxon = formFactory
.createSelectionElement(Taxon.class,
getConversationHolder(), formElement,
- "Reuse existing Taxon", null,
- EntitySelectionElement.NOTHING, style);
+ "Reuse existing taxon", null,
+ EntitySelectionElement.DELETABLE, style);
selection_reuseExistingName = formFactory
.createSelectionElement(TaxonNameBase.class,
getConversationHolder(), formElement,
"Reuse existing name", null,
- EntitySelectionElement.ALL, style);
+ EntitySelectionElement.DELETABLE, style);
text_newTaxonName = formFactory.createTextWithLabelElement(formElement,
"New Taxon", "", style);
+ text_newTaxonName.setFocus();
+ preFillParentTaxonName();
checkbox_openInEditor = formFactory.createCheckbox(formElement,
"Open in Editor", true, style);
setParentTreeNode(entity);
}
- /*
+ private void preFillParentTaxonName() {
+ if(getEntity() instanceof TaxonNode){
+ TaxonNode node = (TaxonNode)getEntity();
+ if(node.getTaxon()!=null){
+ Taxon taxon = HibernateProxyHelper.deproxy(node.getTaxon(), Taxon.class);
+ if(taxon.getName()!=null && taxon.getName().isInstanceOf(NonViralName.class)){
+ NonViralName<?> name = HibernateProxyHelper.deproxy(node.getTaxon().getName(), NonViralName.class);
+ if( ! name.isSupraGeneric() && name.getRank() != null){
+ String taxonName = "";
+ if(name.isGenus() || name.isInfraGeneric()|| name.isSpeciesAggregate() ){
+ taxonName = name.getGenusOrUninomial();
+ }
+ else if(name.isSpecies() || name.isInfraSpecific() ){
+ taxonName = CdmUtils.concat(" ", name.getGenusOrUninomial(),name.getSpecificEpithet());
+ }
+ if (StringUtils.isNotBlank(taxonName)){
+ text_newTaxonName.setText(taxonName + " ");
+ if(text_newTaxonName.getMainControl() instanceof Text){
+ Text text = (Text)text_newTaxonName.getMainControl();
+ text.setSelection(text_newTaxonName.getText().length());
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
* (non-Javadoc)
*
* @see
// $Id$
/**
* 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.
*/
SelectionListener removeListener, int style) {
super(formFactory, section, entity, removeListener, null, style);
}
-
+
/** {@inheritDoc} */
@Override
public void setEntity(NamedArea entity) {
-
+
}
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
-
+
}
/** {@inheritDoc} */
@Override
- public void handleEvent(Object eventSource) {
+ public void handleEvent(Object eventSource) {
}
+
+
}
package eu.etaxonomy.taxeditor.ui.section.description;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.StateData;
+import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
* @param style a int.
*/
public ModifierElement(CdmFormFactory formFactory,
- AbstractFormSection section, DefinedTerm entity,
+ AbstractFormSection<?> section, DefinedTerm entity,
SelectionListener removeListener, int style) {
super(formFactory, section, entity, removeListener, null, style);
}
@Override
public void setEntity(DefinedTerm entity) {
this.entity = entity;
- combo_modifier.setSelection(entity);
+ if(getParentElement() instanceof ModifierSection){
+ ModifierSection parentSection = (ModifierSection) getParentElement();
+ List<DefinedTerm> modifierTerms = new ArrayList<DefinedTerm>();
+ Set<TermVocabulary<DefinedTerm>> recommendedModifierEnumeration = new HashSet<TermVocabulary<DefinedTerm>>();
+ if(parentSection.getEntity() instanceof StateData){
+ StateData stateData = (StateData) parentSection.getEntity();
+ recommendedModifierEnumeration = stateData.getCategoricalData().getFeature().getRecommendedModifierEnumeration();
+ }
+ if(parentSection.getEntity() instanceof StatisticalMeasurementValue){
+ StatisticalMeasurementValue statisticalMeasurementValue = (StatisticalMeasurementValue)parentSection.getEntity();
+ recommendedModifierEnumeration = statisticalMeasurementValue.getQuantitativeData().getFeature().getRecommendedModifierEnumeration();
+ }
+ for (TermVocabulary<DefinedTerm> termVocabulary : recommendedModifierEnumeration) {
+ modifierTerms.addAll(termVocabulary.getTerms());
+ }
+ combo_modifier.setTerms(modifierTerms);
+ }
+ if(entity.getId()>0){
+ combo_modifier.setSelection(entity);
+ }
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
-
+ if(eventSource==combo_modifier){
+ if(getParentElement() instanceof ModifierSection){
+ ModifierSection parentSection = (ModifierSection) getParentElement();
+ if((parentSection).getEntity() instanceof StateData){
+ StateData stateData = (StateData) parentSection.getEntity();
+ stateData.removeModifier(entity);
+ DefinedTerm term = combo_modifier.getSelection();
+ stateData.addModifier(term);
+ entity = term;
+ }
+ }
+ }
}
}
// $Id$
/**
* 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.
*/
import eu.etaxonomy.cdm.model.description.IModifiable;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
/**
* <p>ModifierSection class.</p>
* @created Sep 15, 2010
* @version 1.0
*/
-public class ModifierSection extends AbstractEntityCollectionSection<IModifiable, DefinedTerm> {
+public class ModifierSection extends AbstractUnboundEntityCollectionSection<IModifiable, DefinedTerm> {
/**
* <p>Constructor for ModifierSection.</p>
int style) {
super(formFactory, conversation, parentElement, "Modifiers", style);
}
-
- /** {@inheritDoc} */
- @Override
- public Collection<DefinedTerm> getCollection(IModifiable entity) {
- return entity.getModifiers();
- }
/** {@inheritDoc} */
@Override
- public DefinedTerm createNewElement() {
- return DefinedTerm.NewInstance(TermType.Modifier,"","Untitled","");
+ public DefinedTerm createNewElement() {
+ return DefinedTerm.NewInstance(TermType.Modifier,"","Untitled","");
}
/** {@inheritDoc} */
protected String getTooltipString() {
return "Add a modifier.";
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ @Override
+ protected Collection<DefinedTerm> getEntityCollection(IModifiable entity) {
+ return entity.getModifiers();
+ }
}
package eu.etaxonomy.taxeditor.ui.section.description;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.description.State;
import eu.etaxonomy.cdm.model.description.StateData;
import eu.etaxonomy.taxeditor.store.CdmStore;
@Override
public void setEntity(StateData entity) {
this.entity = entity;
+ List<State> stateTerms = new ArrayList<State>();
+ Set<TermVocabulary<State>> stateVocabularies = getEntity().getCategoricalData().getFeature().getSupportedCategoricalEnumerations();
+ for (TermVocabulary<State> termVocabulary : stateVocabularies) {
+ stateTerms.addAll(termVocabulary.getTerms());
+ }
+ combo_state.setTerms(stateTerms);
combo_state.setSelection(entity.getState());
section_modifiers.setEntity(entity);
if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.description;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateModifierCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class StateModifierElement extends AbstractEntityCollectionElement<TermVocabulary<DefinedTerm>> {
+
+
+ private VocabularyComboElement<DefinedTerm, TermVocabulary<DefinedTerm>> comboStateVocabulary;
+
+ /**
+ * @param formFactory
+ * @param section
+ * @param entity
+ * @param removeListener
+ * @param isChoosableEntity
+ * @param backgroundColor
+ * @param style
+ */
+ public StateModifierElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabulary<DefinedTerm> entity,
+ SelectionListener removeListener, Color backgroundColor, int style) {
+ super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+
+ }
+
+ @Override
+ public void createControls(ICdmFormElement element, int style) {
+ comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.Modifier, "State modifiers", null, element, style);
+ }
+
+ @Override
+ public void setEntity(TermVocabulary<DefinedTerm> entity) {
+ this.entity = entity;
+ if(entity.getId()!=0){
+ comboStateVocabulary.setSelection(entity);
+ }
+ }
+
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
+ if(getParentElement() instanceof StateModifierCollectionSection){
+ Feature feature = ((StateModifierCollectionSection) getParentElement()).getEntity();
+ feature.removeRecommendedModifierEnumeration(entity);
+ TermVocabulary<DefinedTerm> vocabulary = comboStateVocabulary.getSelection();
+ feature.addRecommendedModifierEnumeration(vocabulary);
+ entity = vocabulary;
+ }
+ }
+ }
+
+}
package eu.etaxonomy.taxeditor.ui.section.description;
+import java.util.ArrayList;
+import java.util.Set;
+
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
@Override
public void setEntity(StatisticalMeasurementValue entity) {
this.entity = entity;
- number_value.setNumber(entity.getValue());
+ Set<StatisticalMeasure> statisiticalMeasures = getEntity().getQuantitativeData().getFeature().getRecommendedStatisticalMeasures();
+ combo_type.setTerms(new ArrayList<StatisticalMeasure>(statisiticalMeasures));
combo_type.setSelection(entity.getType());
+ number_value.setNumber(entity.getValue());
section_modifiers.setEntity(entity);
}
@Override
public void handleEvent(Object eventSource) {
if(eventSource == number_value){
- getEntity().setValue(number_value.getFloat());
+ Float floatNumber = number_value.getFloat();
+ if(floatNumber==null){
+ String zero = "0.0";
+ floatNumber = new Float(zero);
+ number_value.setText(zero);
+ }
+ getEntity().setValue(floatNumber);
}
else if(eventSource == combo_type){
getEntity().setType(combo_type.getSelection());
section_stateData.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
}
- /** {@inheritDoc} */
- @Override
- public void setEntity(CategoricalData entity) {
-// section_stateData.setEntity(entity);
- super.setEntity(entity);
- }
-
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
*/
*/
package eu.etaxonomy.taxeditor.ui.section.description.detail;
+import java.util.ArrayList;
+
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.model.common.TermType;
public class QuantitativeDataDetailElement extends
AbstractDetailedDescriptionDetailElement<QuantitativeData> {
- private TermComboElement<MeasurementUnit> combo_mesaurementUnit;
+ private TermComboElement<MeasurementUnit> comboMeasurementUnit;
private StatisticalMeasurementValueSection section_statisticalMeasurementValues;
/**
@Override
protected void createControls(ICdmFormElement formElement,
QuantitativeData entity, int style) {
- combo_mesaurementUnit = formFactory.createDefinedTermComboElement(TermType.MeasurementUnit, formElement, "Measurement Unit", entity.getUnit(), style);
+ comboMeasurementUnit = formFactory.createDefinedTermComboElement(TermType.MeasurementUnit, formElement, "Measurement Unit", null, style);
+ comboMeasurementUnit.setTerms(new ArrayList<MeasurementUnit>(entity.getFeature().getRecommendedMeasurementUnits()));
+ comboMeasurementUnit.setSelection(entity.getUnit());
section_statisticalMeasurementValues = formFactory.createStatisticalMeasurementValueSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
section_statisticalMeasurementValues.setEntity(entity);
section_statisticalMeasurementValues.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
- */
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
- if(eventSource == combo_mesaurementUnit){
- getEntity().setUnit(combo_mesaurementUnit.getSelection());
+ if(eventSource == comboMeasurementUnit){
+ getEntity().setUnit(comboMeasurementUnit.getSelection());
}else if (eventSource == section_statisticalMeasurementValues){
// FIXME
}
// $Id$
/**
* 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.
*/
* @version 1.0
*/
public class TextDataDetailElement extends AbstractDetailedDescriptionDetailElement<TextData> {
-
+
private MultilanguageTextElement multilanguageTextElement;
-
+
/**
* <p>Constructor for TextDataDetailElement.</p>
*
ICdmFormElement formElement, TextData entity, int style) {
super(formFactory, formElement, entity, style);
}
-
+
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, TextData entity,
int style) {
- multilanguageTextElement = formFactory.createMultiLanguageTextElement(this, null, entity.getMultilanguageText(), 400, SWT.WRAP);
+ multilanguageTextElement = formFactory.createMultiLanguageTextElement(this, null, entity.getMultilanguageText(), 200, SWT.WRAP);
}
/** {@inheritDoc} */
--- /dev/null
+// $Id$
+/**
+ * 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.ui.section.identifier;
+
+import org.eclipse.swt.events.SelectionListener;
+
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+
+/**
+ * <p>
+ * CollectionDetailElement class.
+ * </p>
+ *
+ * @author n.hoffmann
+ * @created Oct 13, 2010
+ * @version 1.0
+ */
+public class IdentifierDetailElement extends AbstractEntityCollectionElement<Identifier> {
+
+ private TextWithLabelElement textIdentifier;
+
+ private TermComboElement<DefinedTerm> comboIdentifierType;
+
+ /**
+ * <p>
+ * Constructor for CollectingAreasDetailElement.
+ * </p>
+ *
+ * @param formFactory
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+ * object.
+ * @param section
+ * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+ * object.
+ * @param entity
+ * a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
+ * @param removeListener
+ * a {@link org.eclipse.swt.events.SelectionListener} object.
+ * @param style
+ * a int.
+ */
+ public IdentifierDetailElement(CdmFormFactory formFactory,
+ AbstractFormSection section, Identifier entity,
+ SelectionListener removeListener, int style) {
+ super(formFactory, section, entity, removeListener, null, style);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
+ * (java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void setEntity(Identifier entity) {
+ this.entity = entity;
+ textIdentifier.setText(entity.getIdentifier());
+ comboIdentifierType.setSelection(entity.getType());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement,
+ * eu.etaxonomy.cdm.model.common.IAnnotatableEntity, int)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void createControls(ICdmFormElement formElement, int style) {
+ textIdentifier = formFactory.createTextWithLabelElement(formElement, "Identifier", null, style);
+ comboIdentifierType = formFactory.createDefinedTermComboElement(TermType.IdentifierType, formElement, "Type", null, style);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
+ * .lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == textIdentifier) {
+ getEntity().setIdentifier(textIdentifier.getText());
+ } else if (eventSource == comboIdentifierType) {
+ getEntity().setType(comboIdentifierType.getSelection());
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* 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.ui.section.identifier;
+
+import java.util.Collection;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.widgets.Control;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+
+/**
+ * <p>
+ * CollectingAreasDetailSection class.
+ * </p>
+ *
+ * @author n.hoffmann
+ * @created Oct 14, 2010
+ * @version 1.0
+ */
+public class IdentifierDetailSection extends AbstractEntityCollectionSection<DerivedUnitFacade, Identifier> {
+
+ /**
+ * <p>Constructor for CollectingAreasDetailSection.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param style a int.
+ */
+ public IdentifierDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+ super(formFactory, conversation, parentElement, "Identifiers", style);
+ }
+
+ @Override
+ protected Control createToolbar() {
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+ Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ Identifier element = createNewElement();
+ if(element != null){
+ if(! getSection().isExpanded()) {
+ getSection().setExpanded(true);
+ }
+ internalUpdateSection(true);
+ }
+ }
+ };
+ addAction.setImageDescriptor(new ImageDescriptor() {
+
+ @Override
+ public ImageData getImageData() {
+ return ImageResources.getImage(ImageResources.ADD_ICON).getImageData();
+ }
+ });
+ addAction.setToolTipText(getTooltipString());
+
+ toolBarManager.add(addAction);
+
+ return toolBarManager.createControl(this);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Collection<Identifier> getCollection(DerivedUnitFacade entity) {
+ return entity.getIdentifiers();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Identifier createNewElement() {
+ return Identifier.NewInstance(getEntity().baseUnit(), null, null);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(Identifier element) {
+ getEntity().addIdentifier(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(Identifier element) {
+ getEntity().removeIdentifier(getEntity().getIdentifiers().get(0));
+ getConversationHolder().commit();
+ System.out.println();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No identifiers yet.";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add an identifier";
+ }
+
+}
+++ /dev/null
-/**
- *
- */
-package eu.etaxonomy.taxeditor.ui.section.key;
-
-import java.util.Collection;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.description.IIdentificationKey;
-import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
-
-/**
- * @author n.hoffmann
- *
- */
-public class GeographicalScopeDetailSection extends
- AbstractEntityCollectionSection<IIdentificationKey, NamedArea> {
-
- public GeographicalScopeDetailSection(CdmFormFactory formFactory,
- ConversationHolder conversation, ICdmFormElement parentElement, int style) {
- super(formFactory, conversation, parentElement, "Geographical Scope", style);
- }
-
- @Override
- public Collection<NamedArea> getCollection(IIdentificationKey entity) {
- return entity.getGeographicalScope();
- }
-
- @Override
- public NamedArea createNewElement() {
- return NamedArea.NewInstance();
- }
-
- @Override
- public void addElement(NamedArea element) {
- getEntity().addGeographicalScope(element);
- }
-
- @Override
- public void removeElement(NamedArea element) {
- getEntity().removeGeographicalScope(element);
- }
-
- @Override
- public String getEmptyString() {
- return "No geographical scopes yet.";
- }
-
- @Override
- protected String getTooltipString() {
- return "Add a geographical scope";
- }
-
-}
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
*/
public MediaMetaElement(CdmFormFactory cdmFormFactory,
AbstractFormSection<?> formElement, Media element,
- SelectionListener removeListener, int style) {
- super(cdmFormFactory, formElement, element, removeListener, null, style);
+ SelectionListener removeListener, boolean isChoosableEntity, int style) {
+ super(cdmFormFactory, formElement, element, removeListener, isChoosableEntity, null, style);
}
/*
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
+
text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
text_title.setLanguageString(title);
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#selectFromDialog()
+ */
+ @Override
+ protected Media selectFromDialog() {
+ return MediaSelectionDialog.select(AbstractUtility.getShell(), null, null);
+ }
+
public void toggleAdvancedMediaView(){
mediaDetailElement.toggleAdvancedMediaView();
}
setIrrelevant(toggleable_cache.getState(),
Arrays.asList(new Object[] { toggleable_cache }));
}
- } else if (eventSource == selectionExBasionymAuthor) {
- getEntity().setCombinationAuthorTeam(
- selectionExBasionymAuthor.getSelection());
} else if (eventSource == selectionCombinationAuthor) {
getEntity().setCombinationAuthorTeam(
selectionCombinationAuthor.getSelection());
// $Id$
/**
* 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.
*/
* @created Jan 5, 2011
* @version 1.0
*/
-public class HybridDetailElement extends AbstractCdmDetailElement<NonViralName> {
+public class HybridDetailElement extends AbstractCdmDetailElement<NonViralName<?>> {
+
+ private CheckboxElement checkboxMonomHybrid;
+ private CheckboxElement checkboxBinomHybrid;
+ private CheckboxElement checkboxTrinomHybrid;
+ private CheckboxElement checkboxHybridFormula;
- private CheckboxElement checkbox_monomHybrid;
- private CheckboxElement checkbox_binomHybrid;
- private CheckboxElement checkbox_trinomHybrid;
-
/**
* @param formFactory
* @param formElement
super(formFactory, formElement);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
- */
@Override
- protected void createControls(ICdmFormElement formElement, NonViralName entity,
+ protected void createControls(ICdmFormElement formElement, NonViralName<?> entity,
int style) {
- checkbox_monomHybrid = formFactory.createCheckbox(formElement, "Monom Hybrid", entity.isMonomHybrid(), style);
- checkbox_binomHybrid = formFactory.createCheckbox(formElement, "Binom Hybrid", entity.isBinomHybrid(), style);
- checkbox_trinomHybrid = formFactory.createCheckbox(formElement, "Trinom Hybrid", entity.isTrinomHybrid(), style);
+ checkboxMonomHybrid = formFactory.createCheckbox(formElement, "Monom hybrid", entity.isMonomHybrid(), style);
+ checkboxBinomHybrid = formFactory.createCheckbox(formElement, "Binom hybrid", entity.isBinomHybrid(), style);
+ checkboxTrinomHybrid = formFactory.createCheckbox(formElement, "Trinom hybrid", entity.isTrinomHybrid(), style);
+ checkboxHybridFormula = formFactory.createCheckbox(formElement, "Hybrid formula", entity.isHybridFormula(), style);
+ checkboxHybridFormula.setEnabled(false);//read-only
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
- */
@Override
public void handleEvent(Object eventSource) {
- if(eventSource == checkbox_monomHybrid){
- getEntity().setMonomHybrid(checkbox_monomHybrid.getSelection());
+ if(eventSource == checkboxMonomHybrid){
+ getEntity().setMonomHybrid(checkboxMonomHybrid.getSelection());
}
- else if(eventSource == checkbox_binomHybrid){
- getEntity().setBinomHybrid(checkbox_binomHybrid.getSelection());
+ else if(eventSource == checkboxBinomHybrid){
+ getEntity().setBinomHybrid(checkboxBinomHybrid.getSelection());
}
- else if(eventSource == checkbox_trinomHybrid){
- getEntity().setTrinomHybrid(checkbox_trinomHybrid.getSelection());
+ else if(eventSource == checkboxTrinomHybrid){
+ getEntity().setTrinomHybrid(checkboxTrinomHybrid.getSelection());
}
}
import org.eclipse.swt.widgets.Control;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.NameSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
protected Control createToolbar() {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ //choose name
+ Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
+ @Override
+ public void run() {
+ TaxonNameBase taxonName = NameSelectionDialog.select(getShell(), getConversationHolder(), null);
+ if(taxonName!=null){
+ if(taxonName.isInstanceOf(NonViralName.class)){
+ CdmStore.getService(ITaxonNodeService.class).list(TaxonNode.class, null, null, null, null);
+ NonViralName nonViralName = HibernateProxyHelper.deproxy(taxonName, NonViralName.class);
+ taxonBase.setName(nonViralName);
+ // taxonBase.getTitleCache();
+ setEntity(nonViralName);
+ firePropertyChangeEvent(NonViralNameDetailSection.this);
+ }
+ else{
+ MessagingUtils.warningDialog("Invalid name", this, "The selected name can not be used for this taxon.");
+ }
+ }
+ }
+ };
+ chooseNameAction.setToolTipText("Choose name for this taxon");
+ chooseNameAction.setImageDescriptor(ImageResources.getImageDescriptor(ImageResources.BROWSE_ICON));
+
+ toolBarManager.add(chooseNameAction);
+
+ //clone
if(getEntity() != null && checkForMultipleNameUsages(getEntity())){
Action cloneAction = new Action("Clone", IAction.AS_PUSH_BUTTON){
- @Override
- public void run() {
+ @Override
+ public void run() {
boolean confirm = MessagingUtils.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
if(confirm){
setEntity(clonedName);
taxonBase.setName(clonedName);
taxonBase.generateTitle();
-// EditorUtil.getActiveMultiPageTaxonEditor().r
firePropertyChangeEvent(new CdmPropertyChangeEvent(NonViralNameDetailSection.this, null));
}
+++ /dev/null
-// $Id$
-/**
-* 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.ui.section.occurrence;
-
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeConfigurator;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
-
-/**
- * <p>DerivedUnitFacadeDetailElement class.</p>
- *
- * @author n.hoffmann
- * @created Jun 17, 2010
- * @version 1.0
- */
-public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<DerivedUnit> {
-
- private DerivedUnitFacade facade;
-
- private final DerivedUnitFacadeConfigurator configurator;
-
- private DerivedUnitGeneralDetailSection section_general;
- private GatheringEventDetailSection section_gatheringEvent;
- private DerivedUnitBaseDetailSection section_derivedUnitBase;
- private FieldUnitDetailSection section_fieldUnit;
-
- /**
- * <p>Constructor for DerivedUnitFacadeDetailElement.</p>
- *
- * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
- */
- public DerivedUnitFacadeDetailElement(CdmFormFactory formFactory,
- ICdmFormElement formElement) {
- super(formFactory, formElement);
- configurator = DerivedUnitFacadeConfigurator.NewInstance();
- configurator.setMoveDerivedUnitMediaToGallery(true);
- configurator.setMoveFieldObjectMediaToGallery(true);
- }
-
- /** {@inheritDoc} */
- @Override
- public void setEntity(DerivedUnit entity) {
- super.setEntity(entity);
- try {
- facade = DerivedUnitFacade.NewInstance(entity, configurator);
-
- section_general.setEntity(facade);
- section_derivedUnitBase.setEntity(facade);
- section_gatheringEvent.setEntity(facade);
- section_fieldUnit.setEntity(facade);
-
- } catch (DerivedUnitFacadeNotSupportedException e) {
- MessagingUtils.messageDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
- }
- }
-
- /** {@inheritDoc} */
- @Override
- public void removeElements() {
- super.removeElements();
- if(section_general != null){
- removeControl(section_general);
- section_general.dispose();
- section_general = null;
- }
- if(section_derivedUnitBase != null){
- removeControl(section_derivedUnitBase);
- section_derivedUnitBase.dispose();
- section_derivedUnitBase = null;
- }
- if(section_gatheringEvent != null){
- removeControl(section_gatheringEvent);
- section_gatheringEvent.dispose();
- section_gatheringEvent = null;
- }
- if(section_fieldUnit != null){
- removeControl(section_fieldUnit);
- section_fieldUnit.dispose();
- section_fieldUnit = null;
- }
- }
-
- /** {@inheritDoc} */
- @Override
- public DerivedUnit getEntity() {
- throw new IllegalArgumentException("Should not be called");
- }
-
- /**
- * <p>Getter for the field <code>facade</code>.</p>
- *
- * @return a {@link eu.etaxonomy.cdm.api.facade.DerivedUnitFacade} object.
- */
- public DerivedUnitFacade getFacade(){
- return facade;
- }
-
- /** {@inheritDoc} */
- @Override
- protected void createControls(ICdmFormElement formElement,
- DerivedUnit entity, int style) {
-
- section_general = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- section_general.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- addControl(section_general);
- addElement(section_general);
-
- section_gatheringEvent = formFactory.createGatheringEventDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
- section_gatheringEvent.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- addControl(section_gatheringEvent);
- addElement(section_gatheringEvent);
-
- section_fieldUnit = formFactory.createFieldUnitDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
- section_fieldUnit.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- addControl(section_fieldUnit);
- addElement(section_fieldUnit);
-
- section_derivedUnitBase = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
- section_derivedUnitBase.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- addControl(section_derivedUnitBase);
- addElement(section_derivedUnitBase);
- }
-
- /** {@inheritDoc} */
- @Override
- public void handleEvent(Object eventSource) {
- if(eventSource == section_derivedUnitBase || eventSource == section_gatheringEvent || eventSource == section_fieldUnit){
- if(getParentElement() instanceof AbstractCdmDetailSection) {
- ((AbstractCdmDetailSection) getParentElement()).updateTitle();
- }
- }
- }
-}
package eu.etaxonomy.taxeditor.ui.section.occurrence;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.PointElement;
private ToggleableTextElement toggleableText_titleCache;
private EnumComboElement<SpecimenOrObservationType> combo_specorobstype;
private EntitySelectionElement<NamedArea> selection_country;
+ private CollectingAreasDetailSection section_collectingAreas;
private LanguageStringWithLabelElement languageText_locality;
private PointElement element_point;
private NumberWithLabelElement number_elevation;
selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(),
formElement, "Country",
entity.getCountry(), EntitySelectionElement.NOTHING, style);
+
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION)){
+ section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_collectingAreas.setEntity(entity);
+ }
languageText_locality = formFactory
.createLanguageStringWithLabelElement(formElement, "Locality",
entity.getLocality(), style);
--- /dev/null
+// $Id$
+/**
+* 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.ui.section.occurrence;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.NamedAreaSelectionDialog;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+
+/**
+ * <p>
+ * CollectingAreasDetailSection class.
+ * </p>
+ *
+ * @author n.hoffmann
+ * @created Oct 14, 2010
+ * @version 1.0
+ */
+public class GeoScopeDetailSection extends AbstractEntityCollectionSection<Classification, NamedArea> {
+
+ /**
+ * <p>Constructor for CollectingAreasDetailSection.</p>
+ *
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+ * @param style a int.
+ */
+ public GeoScopeDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+ super(formFactory, conversation, parentElement, "Geo Scopes", style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Collection<NamedArea> getCollection(Classification entity) {
+ return entity.getGeoScopes();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public NamedArea createNewElement() {
+ NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(), getConversationHolder(), null);
+
+ return selection;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(NamedArea element) {
+ getEntity().addGeoScope(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(NamedArea element) {
+ getEntity().removeGeoScope(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No geo scopes yet.";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add a geo scope";
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+ * 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.ui.section.occurrence;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.UUID;
+
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Tree;
+
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateContentProvider;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
+
+/**
+ * @author n.hoffmann
+ * @created Dec 16, 2010
+ * @version 1.0
+ */
+public class SpecimenHierarchyDetailElement extends AbstractCdmDetailElement<SpecimenOrObservationBase<?>> {
+
+ /**
+ * @param formFactory
+ * @param formElement
+ */
+ public SpecimenHierarchyDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement, SpecimenOrObservationBase<?> entity, int style) {
+ TreeViewer viewer = new TreeViewer(getLayoutComposite());
+ DerivateLabelProvider labelProvider = new DerivateLabelProvider();
+ Tree tree = viewer.getTree();
+
+ labelProvider.setConversation(getConversationHolder());
+ tree.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
+ viewer.setContentProvider(new DerivateContentProvider());
+ viewer.setLabelProvider(labelProvider);
+ //get root (field unit)
+ Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).getFieldUnits(entity.getUuid());
+ Collection<UUID> fieldUnitUuids = new HashSet<UUID>();
+ for (FieldUnit fieldUnit : fieldUnits) {
+ fieldUnitUuids.add(fieldUnit.getUuid());
+ }
+ viewer.setInput(Collections.singleton(fieldUnitUuids));
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
+ * .lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ }
+
+}
import org.eclipse.jface.viewers.ISelectionProvider;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
/**
- * <p>DerivedUnitFacadeDetailSection class.</p>
- *
* @author n.hoffmann
- * @created Jun 17, 2010
+ * @created Dec 16, 2010
* @version 1.0
*/
-public class DerivedUnitFacadeDetailSection extends AbstractCdmDetailSection<DerivedUnit> {
-
- /**
- * <p>Constructor for DerivedUnitFacadeDetailSection.</p>
- *
- * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
- * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
- * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
- * @param style a int.
+public class SpecimenHierarchyDetailSection extends AbstractCdmDetailSection<SpecimenOrObservationBase<?>> {
+
+ private SpecimenHierarchyDetailElement specimenHierarchyDetailElement;
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param parentElement
+ * @param selectionProvider
+ * @param style
*/
- public DerivedUnitFacadeDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
- ICdmFormElement parentElement,
+ public SpecimenHierarchyDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
super(formFactory, conversation, parentElement, selectionProvider, style);
}
- /** {@inheritDoc} */
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+ */
@Override
public String getHeading() {
- return "Unit";
+ return "Specimen Hierarchy";
}
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
*/
@Override
- protected AbstractCdmDetailElement<DerivedUnit> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnit> parentElement, int style) {
- return formFactory.createDerivedUnitFacadeDetailElement(parentElement);
+ protected AbstractCdmDetailElement<SpecimenOrObservationBase<?>> createCdmDetailElement(AbstractCdmDetailSection<SpecimenOrObservationBase<?>> parentElement, int style) {
+ specimenHierarchyDetailElement = formFactory.createSpecimenHierarchyDetailElement(parentElement);
+ return specimenHierarchyDetailElement;
}
+
}
/** {@inheritDoc} */
@Override
public Identifier createNewElement() {
- Identifier identifier = getEntity().addIdentifier(null, DerivateLabelProvider.getSampleDesignationTerm());
- return identifier;
+ return Identifier.NewInstance(getEntity(), null, DerivateLabelProvider.getSampleDesignationTerm());
}
/* (non-Javadoc)
*/
@Override
public String getHeading() {
- return "General DNA";
+ return "General";
}
/* (non-Javadoc)
*/
@Override
public String getHeading() {
- return "General Sequence";
+ return "General";
}
/* (non-Javadoc)
*/
@Override
public String getHeading() {
- return "General SingleRead";
+ return "General";
}
/* (non-Javadoc)
import org.apache.log4j.Logger;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.agent.Institution;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.cdm.model.common.VocabularyEnum;
import eu.etaxonomy.cdm.model.molecular.DnaSample;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
*/
public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<DnaSample> {
+ private final TermVocabulary plantKindOfUnitVocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.PlantKindOfUnit.getUuid());
+
static private final Logger logger = Logger.getLogger(TissueSampleGeneralDetailElement.class);
private TermComboElement<DefinedTerm> comboKindOfTissue;
*/
@Override
protected void createControls(ICdmFormElement formElement, DnaSample entity, int style) {
- comboKindOfTissue = formFactory.createDefinedTermComboElement(TermType.KindOfUnit, formElement, "Kind Of Tissue", entity.getKindOfUnit(), style);
+ comboKindOfTissue = formFactory.createDefinedTermComboElement(plantKindOfUnitVocabulary, formElement, "Kind Of Tissue", entity.getKindOfUnit(), style);
TimePeriod preparationDate = null;
DefinedTerm preservationMedium = null;
AgentBase<?> staff = null;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
/**
* @author pplitzner
*/
@Override
public String getHeading() {
- return "General Media Specimen";
+ return "General";
}
/* (non-Javadoc)
*/
@Override
public void setText(String title) {
- String text = null;
- if(getEntity()!=null && getEntity().getKindOfUnit()!=null){
- if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getArtworkTerm())){
- text = "Artwork";
- }
- else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getLivingPlantPhotoTerm())){
- text = "Living Plant Photo";
- }
- else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getSpecimenScanTerm())){
- text = "Specimen Scan";
- }
- else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getDetailImageTerm())){
- text = "Detail Image";
- }
- }
- if(text!=null){
- super.setText(text);
- }
- else{
+// String text = null;
+// if(getEntity()!=null && getEntity().getKindOfUnit()!=null){
+// if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getArtworkTerm())){
+// text = "Artwork";
+// }
+// else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getLivingPlantPhotoTerm())){
+// text = "Living Plant Photo";
+// }
+// else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getSpecimenScanTerm())){
+// text = "Specimen Scan";
+// }
+// else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getDetailImageTerm())){
+// text = "Detail Image";
+// }
+// }
+// if(text!=null){
+// super.setText(text);
+// }
+// else{
super.setText(title);
- }
+// }
}
@Override
switch (referenceType) {
case Generic:
break;
+ case Section:
+ break;
case BookSection:
label = "Book";
break;
import eu.etaxonomy.cdm.model.description.CategoricalData;\r
import eu.etaxonomy.cdm.model.description.State;\r
import eu.etaxonomy.cdm.model.description.StateData;\r
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
import eu.etaxonomy.taxeditor.store.TermStore;\r
+import eu.etaxonomy.taxeditor.store.UsageTermCollection;\r
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
List<State> termsToAdd = new ArrayList<State>();\r
for (State term : listOfTerms) {\r
\r
- if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(UsageTermCollection.useCategoryVocabularyLabel))) {\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getUuid().equals( UsageTermCollection.uuidUseCategoryVocabulary))) {\r
termsToAdd.add(term);\r
}\r
- else if ((term.getVocabulary() !=null) && (term.getPartOf() == null) && (term.getVocabulary().getTitleCache().equals(UsageTermCollection.useCategoryVocabularyLabel))) {\r
+ else if ((term.getVocabulary() !=null) && (term.getPartOf() == null) && (term.getVocabulary().getUuid().equals(UsageTermCollection.uuidUseCategoryVocabulary))) {\r
termsToAdd.add(term);\r
}\r
}\r
*/\r
package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
\r
+import org.apache.commons.lang.StringUtils;\r
+\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
public void handleEvent(Object eventSource) {\r
handleRepresentation(eventSource);\r
if(eventSource==textIdInVocabulary){\r
- if (textIdInVocabulary.getText().equals("")){\r
+ if (StringUtils.isBlank(textIdInVocabulary.getText())){\r
getEntity().setIdInVocabulary(null);\r
}else{\r
getEntity().setIdInVocabulary(textIdInVocabulary.getText());\r
*/\r
package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
\r
+import org.eclipse.ui.forms.widgets.ExpandableComposite;\r
+\r
import eu.etaxonomy.cdm.model.description.Feature;\r
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;\r
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;\r
\r
/**\r
* @author l.morris\r
*/\r
public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {\r
\r
+ private ICdmFormElement parentFormElement;\r
+\r
private CheckboxElement supportsTextData;\r
\r
private CheckboxElement supportsQuantitativeData;\r
\r
private CheckboxElement supportsCommonTaxonName;\r
\r
+ private StateVocabularyCollectionSection sectionStateVocabularies;\r
+\r
+ private MeasurementUnitCollectionSection sectionMeasurementUnits;\r
+\r
+ private StatisticalMeasureCollectionSection sectionStatisticalMeasures;\r
+\r
+ private StateModifierCollectionSection sectionStateModifiers;;\r
+\r
/**\r
* @param formFactory\r
* @param formElement\r
@Override\r
protected void createControls(ICdmFormElement formElement, Feature entity, int style) {\r
super.createControls(formElement, entity, style);\r
+ this.parentFormElement = formElement;\r
supportsTextData = formFactory.createCheckbox(formElement, "Supports Text Data", entity.isSupportsTextData(), style);\r
- supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitive Data", entity.isSupportsQuantitativeData(), style);\r
+ supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", entity.isSupportsQuantitativeData(), style);\r
supportsDistribution = formFactory.createCheckbox(formElement, "Supports Distribution", entity.isSupportsDistribution(), style);\r
supportsIndividualAssociation = formFactory.createCheckbox(formElement, "Supports Individual Association", entity.isSupportsIndividualAssociation(), style);\r
supportsTaxonInteraction = formFactory.createCheckbox(formElement, "Supports Taxon Interaction", entity.isSupportsTaxonInteraction(), style);\r
supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", entity.isSupportsCategoricalData(), style);\r
supportsCommonTaxonName = formFactory.createCheckbox(formElement, "Supports Common Taxon Name", entity.isSupportsCommonTaxonName(), style);\r
+\r
+ if(supportsCategoricalData.getSelection()){\r
+ sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStateVocabularies.setEntity(getEntity());\r
+\r
+ }\r
+ if(supportsQuantitativeData.getSelection()){\r
+ sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionMeasurementUnits.setEntity(getEntity());\r
+\r
+ sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStatisticalMeasures.setEntity(getEntity());\r
+ }\r
+ if(supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()){\r
+ sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStateModifiers.setEntity(getEntity());\r
+ }\r
}\r
\r
/* (non-Javadoc)\r
}\r
else if(eventSource == supportsQuantitativeData){\r
getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());\r
+ if(supportsQuantitativeData.getSelection()){\r
+ sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionMeasurementUnits.setEntity(getEntity());\r
+\r
+ sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStatisticalMeasures.setEntity(getEntity());\r
+\r
+ if(!supportsCategoricalData.getSelection()){\r
+ sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStateModifiers.setEntity(getEntity());\r
+ }\r
+ }\r
+ else{\r
+ if(sectionMeasurementUnits!=null){\r
+ removeElementsAndControls(sectionMeasurementUnits);\r
+ removeElementsAndControls(sectionStatisticalMeasures);\r
+ if(!supportsCategoricalData.getSelection()){\r
+ removeElementsAndControls(sectionStateModifiers);\r
+ }\r
+ }\r
+ }\r
}\r
else if(eventSource == supportsDistribution){\r
getEntity().setSupportsDistribution(supportsDistribution.getSelection());\r
}\r
else if(eventSource == supportsCategoricalData){\r
getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());\r
+ if(supportsCategoricalData.getSelection()){\r
+ sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStateVocabularies.setEntity(getEntity());\r
+\r
+ if(!supportsQuantitativeData.getSelection()){\r
+ sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+ sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+ sectionStateModifiers.setEntity(getEntity());\r
+ }\r
+ }\r
+ else{\r
+ if(sectionStateVocabularies!=null){\r
+ removeElementsAndControls(sectionStateVocabularies);\r
+ if(!supportsQuantitativeData.getSelection()){\r
+ removeElementsAndControls(sectionStateModifiers);\r
+ }\r
+ }\r
+ }\r
}\r
else if(eventSource == supportsCommonTaxonName){\r
getEntity().setSupportsCommonTaxonName(supportsCommonTaxonName.getSelection());\r
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.MeasurementUnit;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class MeasurementUnitCollectionElement extends AbstractEntityCollectionElement<MeasurementUnit> {
+
+
+ private TermComboElement<MeasurementUnit> comboMeasurementUnit;
+
+ /**
+ * @param formFactory
+ * @param section
+ * @param entity
+ * @param removeListener
+ * @param isChoosableEntity
+ * @param backgroundColor
+ * @param style
+ */
+ public MeasurementUnitCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, MeasurementUnit entity,
+ SelectionListener removeListener, Color backgroundColor, int style) {
+ super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+
+ }
+
+ @Override
+ public void createControls(ICdmFormElement element, int style) {
+ comboMeasurementUnit = formFactory.createDefinedTermComboElement(TermType.MeasurementUnit, element, "Measurement unit", null, style);
+ }
+
+ @Override
+ public void setEntity(MeasurementUnit entity) {
+ this.entity = entity;
+ if(entity.getId()!=0){
+ comboMeasurementUnit.setSelection(entity);
+ }
+ }
+
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource==comboMeasurementUnit && comboMeasurementUnit.getSelection()!=null){
+ if(getParentElement() instanceof MeasurementUnitCollectionSection){
+ Feature feature = ((MeasurementUnitCollectionSection) getParentElement()).getEntity();
+ feature.removeRecommendedMeasurementUnit(entity);
+ MeasurementUnit measurementUnit = comboMeasurementUnit.getSelection();
+ feature.addRecommendedMeasurementUnit(measurementUnit);
+ entity = measurementUnit;
+ }
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.MeasurementUnit;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class MeasurementUnitCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, MeasurementUnit> {
+
+ public MeasurementUnitCollectionSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+ super(formFactory, conversation, parentElement, "Recommended measurement units", style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected Collection<MeasurementUnit> getEntityCollection(Feature entity) {
+ return entity.getRecommendedMeasurementUnits();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public MeasurementUnit createNewElement() {
+ return MeasurementUnit.NewInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(MeasurementUnit element) {
+ //never gets called
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(MeasurementUnit element) {
+ getEntity().removeRecommendedMeasurementUnit(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No recommended measurement units yet.";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add a measurement unit";
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class StateModifierCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, TermVocabulary<DefinedTerm>> {
+
+ public StateModifierCollectionSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+ super(formFactory, conversation, parentElement, "Recommended state modifier", style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected Collection<TermVocabulary<DefinedTerm>> getEntityCollection(Feature entity) {
+ return entity.getRecommendedModifierEnumeration();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public TermVocabulary<DefinedTerm> createNewElement() {
+ return TermVocabulary.NewInstance(TermType.Modifier);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(TermVocabulary<DefinedTerm> element) {
+ //never gets called
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(TermVocabulary<DefinedTerm> element) {
+ getEntity().removeRecommendedModifierEnumeration(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No state modifiers yet.";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add a state modifier";
+ }
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.State;
+import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class StateVocabularyCollectionElement extends AbstractEntityCollectionElement<TermVocabulary<State>> {
+
+
+ private VocabularyComboElement<State, TermVocabulary<State>> comboStateVocabulary;
+
+ /**
+ * @param formFactory
+ * @param section
+ * @param entity
+ * @param removeListener
+ * @param isChoosableEntity
+ * @param backgroundColor
+ * @param style
+ */
+ public StateVocabularyCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabulary<State> entity,
+ SelectionListener removeListener, Color backgroundColor, int style) {
+ super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+
+ }
+
+ @Override
+ public void createControls(ICdmFormElement element, int style) {
+ comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabularies", null, element, style);
+ }
+
+ @Override
+ public void setEntity(TermVocabulary<State> entity) {
+ this.entity = entity;
+ if(entity.getId()!=0){
+ comboStateVocabulary.setSelection(entity);
+ }
+ }
+
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
+ if(getParentElement() instanceof StateVocabularyCollectionSection){
+ Feature feature = ((StateVocabularyCollectionSection) getParentElement()).getEntity();
+ feature.removeSupportedCategoricalEnumeration(entity);
+ TermVocabulary<State> vocabulary = comboStateVocabulary.getSelection();
+ feature.addSupportedCategoricalEnumeration(vocabulary);
+ entity = vocabulary;
+ }
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.State;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class StateVocabularyCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, TermVocabulary<State>> {
+
+ public StateVocabularyCollectionSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+ super(formFactory, conversation, parentElement, "Supported state vocabularies", style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected Collection<TermVocabulary<State>> getEntityCollection(Feature entity) {
+ return entity.getSupportedCategoricalEnumerations();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public TermVocabulary<State> createNewElement() {
+ return TermVocabulary.NewInstance(TermType.State);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(TermVocabulary<State> element) {
+ //never gets called
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(TermVocabulary<State> element) {
+ getEntity().removeSupportedCategoricalEnumeration(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No state vocabularies yet.";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add a state vocabulary";
+ }
+
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class StatisticalMeasureCollectionElement extends AbstractEntityCollectionElement<StatisticalMeasure> {
+
+
+ private TermComboElement<StatisticalMeasure> comboStatisticalMeasure;
+
+ /**
+ * @param formFactory
+ * @param section
+ * @param entity
+ * @param removeListener
+ * @param isChoosableEntity
+ * @param backgroundColor
+ * @param style
+ */
+ public StatisticalMeasureCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, StatisticalMeasure entity,
+ SelectionListener removeListener, Color backgroundColor, int style) {
+ super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+
+ }
+
+ @Override
+ public void createControls(ICdmFormElement element, int style) {
+ comboStatisticalMeasure = formFactory.createDefinedTermComboElement(TermType.StatisticalMeasure, element, "Statistical measure", null, style);
+ }
+
+ @Override
+ public void setEntity(StatisticalMeasure entity) {
+ this.entity = entity;
+ if(entity.getId()!=0){
+ comboStatisticalMeasure.setSelection(entity);
+ }
+ }
+
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource==comboStatisticalMeasure && comboStatisticalMeasure.getSelection()!=null){
+ if(getParentElement() instanceof StatisticalMeasureCollectionSection){
+ Feature feature = ((StatisticalMeasureCollectionSection) getParentElement()).getEntity();
+ feature.removeRecommendedStatisticalMeasure(entity);
+ StatisticalMeasure statisticalMeasure = comboStatisticalMeasure.getSelection();
+ feature.addRecommendedStatisticalMeasure(statisticalMeasure);
+ entity = statisticalMeasure;
+ }
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.ui.section.vocabulary;
+
+import java.util.Collection;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ *
+ */
+public class StatisticalMeasureCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, StatisticalMeasure> {
+
+ public StatisticalMeasureCollectionSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+ super(formFactory, conversation, parentElement, "Statistical measures", style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected Collection<StatisticalMeasure> getEntityCollection(Feature entity) {
+ return entity.getRecommendedStatisticalMeasures();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public StatisticalMeasure createNewElement() {
+ return StatisticalMeasure.NewInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(StatisticalMeasure element) {
+ //never gets called
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(StatisticalMeasure element) {
+ getEntity().removeRecommendedStatisticalMeasure(element);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No statistical measures yet.";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add a statistical measure";
+ }
+
+}
service = (IService<T>) CdmStore.getService(IAmplificationService.class);
}
//check if original already exists in data base. If not then do not clone and all changes will be persisted directly -> Warning to user.
- if(service !=null && service.find(originalEntity.getUuid())==null){
+ if(service !=null && service.find(originalEntity.getUuid())==null && originalEntity.getId() != 0){
if(MessagingUtils.confirmDialog(TRANSIENT_EDITING_WARNING_TITLE, "["+originalEntity.getClass().getSimpleName()+"]"+originalEntity + " has to be saved before it can be edited. Save now?")){
service.save(originalEntity);
AbstractUtility.getActiveEditor().doSave(new NullProgressMonitor());
}
}
else{
- try {
- //clone original
- clonedEntity = (T) ((CdmBase) originalEntity).clone();
- } catch (CloneNotSupportedException e1) {
- MessagingUtils.warningDialog(TRANSIENT_EDITING_WARNING_TITLE, this, TRANSIENT_EDITING_WARNING_TEXT);
- }
+ //FIXME temporarily disabled cloning re-opening bug #2645 (EditFromSelectionWizard persists data even when canceled)
+// try {
+// //clone original
+// clonedEntity = (T) ((CdmBase) originalEntity).clone();
+// } catch (CloneNotSupportedException e1) {
+// MessagingUtils.warningDialog(TRANSIENT_EDITING_WARNING_TITLE, this, TRANSIENT_EDITING_WARNING_TEXT);
+// }
}
}
}
//be sure to reset to original in all cases
selectionElement.setEntity(originalEntity);
+ selectionElement.refresh();
}
}
this.selection = selection;
}
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
@Override
public void run() {
try{
}
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
- * .eclipse.swt.widgets.Composite)
- */
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2015 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.view;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+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.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+
+/**
+ * This class provides the possibility to choose from a list of possible viewers
+ * which can be opened for a given input in a popup dialog.
+ *
+ * @author pplitzner
+ * @date Feb 23, 2015
+ *
+ */
+public class CdmViewerChooser extends PopupDialog implements ISelectionChangedListener, ILabelProvider{
+
+ private Object input;
+ private Map<Entry<Class<?>, String>, ICdmViewer> nameViewerMap;
+
+ public CdmViewerChooser(Shell parentShell) {
+ this(parentShell, SWT.RESIZE | SWT.ON_TOP, true, false, false, false, false, "Open in ...",
+ "Clicking will open the selected viewer");
+ }
+
+ public CdmViewerChooser(Shell parent, int shellStyle, boolean takeFocusOnOpen, boolean persistSize,
+ boolean persistLocation, boolean showDialogMenu, boolean showPersistActions, String titleText,
+ String infoText) {
+ super(parent, shellStyle, takeFocusOnOpen, persistSize, persistLocation, showDialogMenu, showPersistActions,
+ titleText, infoText);
+ }
+
+ /**
+ * Opens a popup dialog with all possible viewers for the given input.
+ * @param input the input for which the viewers are listed
+ */
+ public void chooseViewer(Object input){
+ this.input = input;
+ this.nameViewerMap = new HashMap<Entry<Class<?>, String>, ICdmViewer>();
+
+ IExtensionRegistry reg = Platform.getExtensionRegistry();
+ IConfigurationElement[] extensions = reg
+ .getConfigurationElementsFor("eu.etaxonomy.taxeditor.store.cdmViewer");
+ for (IConfigurationElement configElement : extensions) {
+ try {
+ Object object = configElement.createExecutableExtension("class");
+ if(object instanceof ICdmViewer){
+ ICdmViewer cdmViewer = (ICdmViewer)object;
+ Map<Class<?>, String> viewerClasses = cdmViewer.getViewerClasses(input);
+ for (Entry<Class<?>, String> entry : viewerClasses.entrySet()) {
+ nameViewerMap.put(entry, cdmViewer);
+ }
+ }
+ else{
+ MessagingUtils.error(CdmViewerChooser.class, new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Could not load cdmViewer extension"));
+ }
+ } catch (CoreException e) {
+ MessagingUtils.error(CdmViewerChooser.class, "Could not load cdmViewer extension", e);
+ }
+ }
+ //if only one editor is available then open it
+ if(nameViewerMap.size()==1){
+ Entry<Class<?>, String> next = nameViewerMap.keySet().iterator().next();
+ ICdmViewer cdmViewer = nameViewerMap.get(next);
+ cdmViewer.show(input, next.getKey());
+ }
+ else{
+ if(nameViewerMap.isEmpty()){
+ this.setInfoText("No viewers registered for this input");
+ }
+ this.open();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ TableViewer viewer = new TableViewer(new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
+ viewer.setContentProvider(new ArrayContentProvider());
+ viewer.setLabelProvider(this);
+ viewer.addSelectionChangedListener(this);
+ viewer.setInput(nameViewerMap.keySet());
+ return parent;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if(selection instanceof IStructuredSelection){
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if(nameViewerMap.containsKey(firstElement)){
+ Entry<Class<?>, String> entry = (Entry<Class<?>, String>)firstElement;
+ ICdmViewer cdmViewer = nameViewerMap.get(entry);
+ cdmViewer.show(input, entry.getKey());
+ this.close();
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ String text = null;
+ if(nameViewerMap.containsKey(element)){
+ Entry<Class<?>, String> entry = (Entry<Class<?>, String>) element;
+ text = entry.getValue();
+ }
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ */
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 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.view;
+
+import java.util.Map;
+
+
+/**
+ * Implementors of this interface provide a mapping of input elements to views
+ * or editors which can display information or provide editing functionality for
+ * the input elements.
+ *
+ * @author pplitzner
+ * @date Feb 23, 2015
+ *
+ */
+public interface ICdmViewer {
+
+ /**
+ * For the given input a map specifying the available viewers classes as
+ * keys and their string representation as values is returned
+ *
+ * @param input
+ * the input for which the viewer classes should be returned
+ * @return a map holding the viewer classes as keys and their string
+ * representations as values
+ */
+ public Map<Class<?>, String> getViewerClasses(Object input);
+
+ /**
+ * Opens the viewer defined by the given viewerClass for the given input.
+ * @param input the input for which a viewer should be opened
+ * @param viewerClass the qualified class name of the viewer
+ */
+ public void show(Object input, Class<?> viewerClass);
+
+}
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import eu.etaxonomy.cdm.config.ICdmSource;
+import eu.etaxonomy.taxeditor.Messages;
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
import eu.etaxonomy.taxeditor.model.IContextListener;
-package eu.etaxonomy.taxeditor.editor.view.derivate;
+package eu.etaxonomy.taxeditor.view.derivateSearch;
import java.util.ArrayList;
import java.util.LinkedHashSet;
@Override
public Object[] getElements(Object inputElement) {
List<TreeNode> rootElements = new ArrayList<TreeNode>();
- if(inputElement instanceof DerivateViewEditorInput){
- Set<UUID> rootUUIDs = ((DerivateViewEditorInput) inputElement).getRootUUIDs();
- for (UUID uuid : rootUUIDs) {
- SpecimenOrObservationBase<?> rootElement = CdmStore.getService(IOccurrenceService.class).load(uuid);
- if(rootElement!=null){
- rootElements.add(new TreeNode(rootElement));
- }
+ if(inputElement instanceof Set){
+ for (Object o: (Set)inputElement) {
+ if(o instanceof UUID){
+ UUID uuid = (UUID)o;
+ SpecimenOrObservationBase<?> rootElement = CdmStore.getService(IOccurrenceService.class).load(uuid);
+ if(rootElement!=null){
+ rootElements.add(new TreeNode(rootElement));
+ }
+ }
}
}
return rootElements.toArray();
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.Identifier;
conversation.bind();
final String emptyString = "";
- final String separator = ", ";
+ final String separator = " ";
String label = emptyString;
}
eu.etaxonomy.cdm.model.occurrence.Collection collection = derivedUnit.getCollection();
if(collection!=null){
- label += collection.getName()!=null?collection.getName()+" ":emptyString;
- label += collection.getCode()!=null?"("+collection.getCode()+"), ":emptyString;
+ label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
}
- label += derivedUnit.getAccessionNumber()!=null?derivedUnit.getAccessionNumber()+separator:emptyString;
- label += derivedUnit.getBarcode()!=null?derivedUnit.getBarcode():emptyString;
+ String mostSignificantIdentifier = CdmStore.getService(IOccurrenceService.class).getMostSignificantIdentifier(derivedUnit);
+ label += mostSignificantIdentifier!=null?mostSignificantIdentifier+separator:emptyString;
}
else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
//TissueSample should only be created by using it's own class
if(element instanceof TreeNode){
element = ((TreeNode) element).getValue();
}
- if(element instanceof FieldUnit){
- return ImageResources.getImage(ImageResources.FIELD_UNIT);
- }
- else if(element instanceof DerivedUnit){
- DerivedUnit derivedUnit = (DerivedUnit)element;
- if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.FieldUnit){
- return ImageResources.getImage(ImageResources.FIELD_UNIT);
- }
- else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.DnaSample){
- return ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE);
- }
- else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
- return ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE);
+ if(element instanceof CdmBase){
+ CdmBase cdmBase = (CdmBase)element;
+ boolean hasCharacterData = false;
+ if(cdmBase.isInstanceOf(SpecimenOrObservationBase.class)){
+ SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(cdmBase, SpecimenOrObservationBase.class);
+ if(!CdmStore.getService(IOccurrenceService.class).getCharacterDataForSpecimen(specimen).isEmpty()){
+ hasCharacterData = true;
+ }
}
- else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
- return ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE);
+ if(cdmBase.isInstanceOf(FieldUnit.class)){
+ return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
}
- else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.Media){
- if(derivedUnit.getKindOfUnit()!=null){
- if(derivedUnit.getKindOfUnit().equals(getArtworkTerm())){
- return ImageResources.getImage(ImageResources.ARTWORK_DERIVATE);
- }
- else if(derivedUnit.getKindOfUnit().equals(getLivingPlantPhotoTerm())){
- return ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE);
- }
- else if(derivedUnit.getKindOfUnit().equals(getSpecimenScanTerm())){
- return ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE);
- }
- else if(derivedUnit.getKindOfUnit().equals(getDetailImageTerm())){
- return ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE);
+ else if(cdmBase.isInstanceOf(DerivedUnit.class)){
+ DerivedUnit derivedUnit = HibernateProxyHelper.deproxy(element, DerivedUnit.class);
+ if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.FieldUnit){
+ return hasCharacterData?ImageResources.getImage(ImageResources.FIELD_UNIT_CHARACTER_DATA):ImageResources.getImage(ImageResources.FIELD_UNIT);
+ }
+ else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.DnaSample){
+ return hasCharacterData?ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.DNA_SAMPLE_DERIVATE);
+ }
+ else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
+ return hasCharacterData?ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.TISSUE_SAMPLE_DERIVATE);
+ }
+ else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
+ return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_DERIVATE);
+ }
+ else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.Media){
+ if(derivedUnit.getKindOfUnit()!=null){
+ if(derivedUnit.getKindOfUnit().equals(getArtworkTerm())){
+ return hasCharacterData?ImageResources.getImage(ImageResources.ARTWORK_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.ARTWORK_DERIVATE);
+ }
+ else if(derivedUnit.getKindOfUnit().equals(getLivingPlantPhotoTerm())){
+ return hasCharacterData?ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.LIVING_PLANT_PHOTO_DERIVATE);
+ }
+ else if(derivedUnit.getKindOfUnit().equals(getSpecimenScanTerm())){
+ return hasCharacterData?ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.SPECIMEN_SCAN_DERIVATE);
+ }
+ else if(derivedUnit.getKindOfUnit().equals(getDetailImageTerm())){
+ return hasCharacterData?ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE_CHARACTER_DATA):ImageResources.getImage(ImageResources.DETAIL_IMAGE_DERIVATE);
+ }
}
}
}
- }
- else if(element instanceof Sequence){
- return ImageResources.getImage(ImageResources.SEQUENCE_DERIVATE);
- }
-
- else if(element instanceof SingleRead){
- if(multiLinkSingleReads.contains(element)){
- return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE_MULTILINK);
+ else if(cdmBase.isInstanceOf(Sequence.class)){
+ return ImageResources.getImage(ImageResources.SEQUENCE_DERIVATE);
}
- else{
- return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE);
+
+ else if(cdmBase.isInstanceOf(SingleRead.class)){
+ if(multiLinkSingleReads.contains(element)){
+ return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE_MULTILINK);
+ }
+ else{
+ return ImageResources.getImage(ImageResources.SINGLE_READ_DERIVATE);
+ }
}
}
return super.getImage(element);
}
public static Identifier<DnaSample> getCurrentSampleDesignation(CdmBase entity) {
- if(entity instanceof DnaSample){
- DnaSample dnaSample = (DnaSample)entity;
+ if(entity.isInstanceOf(DnaSample.class)){
+ DnaSample dnaSample = HibernateProxyHelper.deproxy(entity, DnaSample.class);
for (Identifier<DnaSample> identifier : dnaSample.getIdentifiers()) {
if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
//first sample designation is the current
}
}
}
- else if(entity instanceof Sequence){
- Sequence sequence = (Sequence)entity;
+ else if(entity.isInstanceOf(Sequence.class)){
+ Sequence sequence = HibernateProxyHelper.deproxy(entity, Sequence.class);
if(sequence.getDnaSample()!=null){
return getCurrentSampleDesignation(sequence.getDnaSample());
}
btnClearTaxon.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
lblDerivateType = new Label(this, SWT.NULL);
- lblDerivateType.setText("Derivate Type");
+ lblDerivateType.setText("Derivative Type");
comboDerivateType = new Combo(this, SWT.READ_ONLY);
comboDerivateType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
import org.eclipse.ui.handlers.IHandlerService;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
-import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorImpl;
+import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.SearchManager;
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
import eu.etaxonomy.taxeditor.ui.mvc.combo.EnumTermComboController;
public class DerivateSearchCompositeController implements Listener{
private final DerivateSearchComposite derivateSearchComposite;
- private IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>> configurator;
- private EnumTermComboController<SpecimenOrObservationType> enumTermComboController;
+ private EnumTermComboController<SpecimenOrObservationType> comboSpecimenTypeController;
private final DerivateSearchView derivateSearchView;
private DerivateLabelProvider labelProvider;
private Taxon selectedTaxon;
private void init(){
//derivate type combo
- enumTermComboController = new EnumTermComboController<SpecimenOrObservationType>(derivateSearchComposite.getComboDerivateType(), null, null, SpecimenOrObservationType.class, 0);
- enumTermComboController.setSelection(SpecimenOrObservationType.Unknown);
+ comboSpecimenTypeController = new EnumTermComboController<SpecimenOrObservationType>(derivateSearchComposite.getComboDerivateType(), null, null, SpecimenOrObservationType.class, 0);
+ comboSpecimenTypeController.setSelection(SpecimenOrObservationType.Unknown);
//add listeners
derivateSearchComposite.getSearchField().addListener(SWT.KeyDown, this);
}
});
- configurator = new IdentifiableServiceConfiguratorImpl<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>>();
}
derivateSearchView.setFocus(); //rebind the conversation
}
+ String queryString = derivateSearchComposite.getSearchField().getText();
+ SpecimenOrObservationType specimenType = comboSpecimenTypeController.getSelection();
- List<SpecimenOrObservationBase<?>> filteredByAssociatedTaxon = null;
- //filter by taxon
+ FindOccurrencesConfigurator config = new FindOccurrencesConfigurator();
+ config.setAssociatedTaxonUuid(selectedTaxon!=null?selectedTaxon.getUuid():null);
+ config.setSpecimenType(specimenType.equals(SpecimenOrObservationType.Unknown)?null:specimenType);//unknown := all types
+ config.setTitleSearchString(queryString);
if(selectedTaxon!=null){
- filteredByAssociatedTaxon = CdmStore.getService(IOccurrenceService.class).listByAssociatedTaxon(null, null, selectedTaxon, null, null, null, null, null);
+ config.setRetrieveIndirectlyAssociatedSpecimens(true);
+ config.setSpecimenType(null);
}
- //filter by specimen type
- configurator.setTitleSearchString(derivateSearchComposite.getSearchField().getText());
- SpecimenOrObservationType type = enumTermComboController.getSelection();
- List<SpecimenOrObservationBase> filteredByType = new ArrayList<SpecimenOrObservationBase>();
- if(filteredByAssociatedTaxon!=null){
- for (SpecimenOrObservationBase specimenOrObservationBase : filteredByAssociatedTaxon) {
- if(type.equals(SpecimenOrObservationType.Unknown) || specimenOrObservationBase.getRecordBasis().equals(type)){
- filteredByType.add(specimenOrObservationBase);
+ SearchManager searchManager = new SearchManager();
+ List<SpecimenOrObservationBase> occurrences = searchManager.findOccurrences(config);
+
+ //filter out specimens of wrong type (only if an associated taxon was selected)
+ if(selectedTaxon!=null && !specimenType.equals(SpecimenOrObservationType.Unknown)){
+ List<SpecimenOrObservationBase> specimensOfCorrectType = new ArrayList<SpecimenOrObservationBase>();
+ for(SpecimenOrObservationBase<?> occurrence:occurrences){
+ if(occurrence.getRecordBasis().equals(specimenType)
+ || occurrence.getRecordBasis().isKindOf(specimenType)){
+ specimensOfCorrectType.add(occurrence);
}
}
- }
- else{
- filteredByType = CdmStore.getSearchManager().findOccurrencesByType(configurator, type);
+ occurrences = specimensOfCorrectType;
}
//filter out assigned specimens
if(derivateSearchComposite.getBtnFilterUndeterminedSpecimen().getSelection()){
List<SpecimenOrObservationBase> specimensWithNoDetermination = new ArrayList<SpecimenOrObservationBase>();
- for(SpecimenOrObservationBase<?> result:filteredByType){
+ for(SpecimenOrObservationBase<?> result:occurrences){
if(CdmStore.getService(IOccurrenceService.class).countDeterminations(result, null)==0){
specimensWithNoDetermination.add(result);
}
}
- filteredByType = specimensWithNoDetermination;
+ occurrences = specimensWithNoDetermination;
}
- derivateSearchComposite.getResultViewer().setInput(filteredByType);
+ derivateSearchComposite.getResultViewer().setInput(occurrences);
}
/* (non-Javadoc)
* Resets all input fields
*/
public void reset(){
- derivateSearchComposite.getResultViewer().setInput(null);
- derivateSearchComposite.getSearchField().setText("");
- enumTermComboController.setSelection(SpecimenOrObservationType.Unknown);
- derivateSearchComposite.getComboDerivateType().deselectAll();
+ if(!derivateSearchComposite.isDisposed()){
+ derivateSearchComposite.getResultViewer().setInput(null);
+ derivateSearchComposite.getSearchField().setText("");
+ derivateSearchComposite.getComboDerivateType().deselectAll();
+ comboSpecimenTypeController.setSelection(SpecimenOrObservationType.Unknown);
+ }
selectedTaxon = null;
}
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.ScopeRestrictionSection;
import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
/**
else if ((input instanceof PolytomousKeyNode) &&
(formSection instanceof PolytomousKeyDetailSection ||
- formSection instanceof GeographicalScopeDetailSection ||
+ formSection instanceof GeoScopeDetailSection ||
formSection instanceof ScopeRestrictionSection ||
formSection instanceof TaxonomicScopeSection)) {
input = ((PolytomousKeyNode)input).getKey();
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
/** {@inheritDoc} */
@Override
public void createViewer(Composite parent) {
- //selectionService.addPostSelectionListener(this);
viewer = new DetailsViewer(parent, this);
getSite().setSelectionProvider(viewer);
if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
if(structuredSelection.size() != 1){
+ setPartName(createPartTitle(null));
showEmptyPage();
return;
}
// do show the map for distributions
Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();
if(!feature.equals(Feature.DISTRIBUTION())){
+ setPartName(createPartTitle(null));
showEmptyPage();
return;
}
}
+
+ setPartName(createPartTitle(((IStructuredSelection) selection).getFirstElement()));
showViewer(part, structuredSelection);
}else{
+ setPartName(createPartTitle(null));
showEmptyPage();
}
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.view.AbstractCdmViewPart#showEmptyPage()
- */
+ private String getViewName(){
+ return "Details";
+ }
+
+ private String createPartTitle(Object selectedObject){
+ if(selectedObject!=null){
+ if(selectedObject instanceof TreeNode){
+ selectedObject = ((TreeNode) selectedObject).getValue();
+ }
+ if(selectedObject instanceof SpecimenOrObservationBase){
+ return getViewName()+": "+HibernateProxyHelper.deproxy(selectedObject, SpecimenOrObservationBase.class).getRecordBasis();
+ }
+ if(selectedObject instanceof CdmBase){
+ return getViewName()+": "+HibernateProxyHelper.deproxy(selectedObject, CdmBase.class).getClass().getSimpleName();
+ }
+ return getViewName()+": "+selectedObject.getClass().getSimpleName();
+ }
+ return getViewName();
+ }
+
@Override
public void showEmptyPage() {
viewer.setSelection(null);
public void dispose() {
selectionService.removePostSelectionListener(this);
super.dispose();
-
+
}
- /**
- * <p>onComplete</p>
- *
- * @return a boolean.
- */
@Override
public boolean onComplete() {
return true;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
-import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.Marker;
-import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.description.CategoricalData;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.UsageTermCollection;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.RootElement;
import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
// editor
// and not derived unit facade objects,
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
- * .lang.Object)
- */
@Override
public void setInput(Object input) {
if(input instanceof TreeNode){
// END HACK TO MAKE THE DERIVED UNIT FACADE WORK
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.Viewer#refresh()
- */
+
/** {@inheritDoc} */
@Override
protected void showParts() {
}
else{
Set<Marker> descriptionMarkers = ((DescriptionBase<?>) input).getMarkers();
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
- UsageTermCollection.uuidUseMarkerType);
+
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
- if (marker.getMarkerType().equals(useMarkertype)) {
+ if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
isUseDescription = true;
}
}
}
} else if (input instanceof DescriptionElementBase) {
Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
- UsageTermCollection.uuidUseMarkerType);
+
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
- if (marker.getMarkerType().equals(useMarkertype)) {
+ if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
isUseDescription = true;
}
}
return selection;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
- * .ISelection, boolean)
- */
/** {@inheritDoc} */
@Override
public void setSelection(ISelection selection, boolean reveal) {
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
addPart(originalLabelDataSection);
//for editors working with facades
TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(taxonAssociationDetailSection);
}
-
+
}
private void createFieldUnitSection(RootElement parent) {
private void createDefinedTermSection(RootElement parent) {
destroySections();
- AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(definedTermDetailSection);
}
<classpathentry exported="true" kind="lib" path="lib/byte-buddy-0.5.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
+
Bundle-ActivationPolicy: lazy
Bundle-Vendor: EDIT
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.eclipse.ui,
+
+Require-Bundle: org.apache.log4j,
+ org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.swtbot.eclipse.core,
org.eclipse.swtbot.eclipse.finder,
/**\r
- * \r
+ *\r
*/\r
package eu.etaxonomy.taxeditor.test;\r
\r
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;\r
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
-import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;\r
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;\r
import org.junit.Before;\r
-import org.junit.runner.RunWith;\r
+\r
\r
/**\r
* @author n.hoffmann\r
*\r
*/\r
-@RunWith(SWTBotJunit4ClassRunner.class)\r
+//@RunWith(SWTBotJunit4ClassRunner.class)\r
public abstract class AbstractEditorTest {\r
- \r
+\r
protected SWTWorkbenchBot bot;\r
- \r
+\r
public SwtBotUtils utils;\r
- \r
+\r
@Before\r
public void setup() {\r
bot = new SWTWorkbenchBot();\r
SWTBotPreferences.TIMEOUT = 300000;\r
utils = new SwtBotUtils(bot);\r
- \r
+\r
// unfortunately swt bot is not available at the time this is set up\r
// if("Choose a nomenclatural code".equals(getActiveShellHeadline())){\r
// ok();\r
// bot.waitUntil(Conditions.shellIsActive("Nomenclatural code set"));\r
// ok();\r
// }\r
- \r
+\r
if("Connecting to datasource: cdm".equals(utils.getActiveShellHeadline())){\r
performLogin();\r
}\r
}\r
- \r
+\r
private void performLogin(){\r
bot.waitUntil(Conditions.shellIsActive("Login"));\r
bot.textWithLabel("Username").setText("admin");\r
bot.textWithLabel("Password").setText("00000");\r
bot.button("OK").click();\r
}\r
- \r
\r
- \r
+\r
+\r
\r
}\r
\r
import java.util.List;\r
\r
-import org.eclipse.osgi.internal.loader.FilteredSourcePackage;\r
import org.eclipse.swt.widgets.Tree;\r
import org.eclipse.swt.widgets.Widget;\r
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;\r
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;\r
\r
public class SwtBotUtils {\r
- \r
+\r
private SWTWorkbenchBot bot;\r
- \r
+\r
public SwtBotUtils(SWTWorkbenchBot bot) {\r
this.bot = bot;\r
}\r
- \r
+\r
/**\r
* @return\r
* @throws WidgetNotFoundException\r
*/\r
public SWTBotTree tree(Widget widget) throws WidgetNotFoundException {\r
List<Tree> controls = new ChildrenControlFinder(widget).findControls(WidgetMatcherFactory.widgetOfType(Tree.class));\r
- if (controls.isEmpty())\r
- throw new WidgetNotFoundException("Could not find any tree");\r
- SWTBotTree tree = new SWTBotTree((Tree) controls.get(0));\r
+ if (controls.isEmpty()) {\r
+ throw new WidgetNotFoundException("Could not find any tree");\r
+ }\r
+ SWTBotTree tree = new SWTBotTree(controls.get(0));\r
return tree;\r
}\r
- \r
+\r
/**\r
- * \r
+ *\r
* @param index the index of the SelectionElement\r
* @param dialogName the title of the expected dialog\r
*/\r
public SWTBotView view(String title) throws WidgetNotFoundException {\r
return getBot().viewByTitle(title);\r
}\r
- \r
+\r
public void cancel() {\r
clickButton("Cancel");\r
}\r
- \r
+\r
public void ok() {\r
clickButton("OK");\r
}\r
- \r
+\r
public void finish() {\r
clickButton("Finish");\r
}\r
- \r
+\r
public void clickButton(String label) {\r
getBot().button(label).click();\r
}\r
- \r
+\r
public String getActiveShellHeadline(){\r
return getBot().activeShell().getText();\r
}\r
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
--- /dev/null
+when updating the eu.etaxonomy.taxeditor.product file make sure to apply the updates on both
+eu.etaxonomy.taxeditor.product.with.jre and
+eu.etaxonomy.taxeditor.product.wo.jre
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?>
-
-<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="3.4.1.qualifier" useFeatures="true" includeLaunchers="true">
-
- <aboutInfo>
- <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
- <text>
+<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="3.5.2.qualifier">
+ <aboutInfo>
+ <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
+ <text>
%productBlurb
</text>
- </aboutInfo>
-
- <configIni use="default">
- </configIni>
-
- <launcherArgs>
- <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080</programArgs>
- <vmArgs>-Xmx512M -XX:MaxPermSize=256M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow</vmArgs>
- <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
- </launcherArgs>
-
- <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
-
- <splash
- location="eu.etaxonomy.taxeditor.application"
- startupProgressRect="5,447,366,15"
- startupMessageRect="7,432,360,20"
- startupForegroundColor="000000" />
- <launcher name="TaxonomicEditor">
- <solaris/>
- <win useIco="false">
- <bmp/>
- </win>
- </launcher>
-
- <vm>
- </vm>
-
- <plugins>
- </plugins>
-
- <features>
- <feature id="eu.etaxonomy.taxeditor.feature"/>
- </features>
-
- <configurations>
- <plugin id="eu.etaxonomy.taxeditor.application" autoStart="true" startLevel="5" />
- <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
- <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
- <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
- <plugin id="org.eclipse.equinox.p2.transport.ecf" autoStart="true" startLevel="4" />
- <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
- </configurations>
-
+ </aboutInfo>
+ <configIni use="default"></configIni>
+ <launcherArgs>
+ <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080</programArgs>
+ <vmArgs>-Xmx512M -XX:MaxPermSize=256M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow</vmArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ </launcherArgs>
+ <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
+ <splash location="eu.etaxonomy.taxeditor.application" startupForegroundColor="000000" startupMessageRect="7,432,360,20" startupProgressRect="5,447,366,15"/>
+ <launcher name="TaxonomicEditor">
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+ <vm></vm>
+ <plugins></plugins>
+ <features>
+ <feature id="eu.etaxonomy.taxeditor.feature"/>
+ </features>
+ <configurations>
+ <plugin autoStart="true" id="eu.etaxonomy.taxeditor.application" startLevel="5"/>
+ <plugin autoStart="true" id="org.eclipse.core.runtime" startLevel="4"/>
+ <plugin autoStart="true" id="org.eclipse.equinox.common" startLevel="2"/>
+ <plugin autoStart="true" id="org.eclipse.equinox.ds" startLevel="2"/>
+ <plugin autoStart="true" id="org.eclipse.equinox.p2.transport.ecf" startLevel="4"/>
+ <plugin autoStart="true" id="org.eclipse.equinox.simpleconfigurator" startLevel="1"/>
+ </configurations>
</product>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>EDIT Taxonomic Editor Product</name>
<description>The EDIT Taxonomic Desktop Editor</description>
<url>http://wp5.e-taxonomy.eu/taxeditor</url>
-
+ <properties>
+ <product.id>eu.etaxonomy.taxeditor.product</product.id>
+ </properties>
<build>
<plugins>
<plugin>
<configuration>
<products>
<product>
- <id>eu.etaxonomy.taxeditor.product</id>
+ <id>${product.id}</id>
<rootFolder>EDIT Taxonomic Editor</rootFolder>
</product>
</products>
</profile>
<profile>
<!-- Upload the repo to the server -->
- <!-- ATTENTION : This does not work well currently since the file permissions
- are set with read permission set to off after upload -->
+ <!-- ATTENTION : This does not work well currently since the file permissions
+ are set with read permission set to off after upload -->
<id>uploadRepo</id>
<build>
<plugins>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="Eclipse Indigo Target" sequenceNumber="5">
+<?pde version="3.8"?><target name="Eclipse Indigo Target" sequenceNumber="28">
<locations>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
-<unit id="org.eclipse.swtbot.eclipse.gef.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
-<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
-<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
-<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site"/>
-</location>
-<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.jdt.feature.group" version="3.7.1.r371_v20110810-0800-7z8gFcoFMLfTabvKsR5Qm9rBGEBK"/>
-<unit id="org.eclipse.pde.source.feature.group" version="3.7.1.r37x_v20110810-0800-7b7qFVtFEx2XnmZ4jlM5mjM"/>
-<unit id="org.eclipse.platform.feature.group" version="3.7.1.r37x_v20110729-9gF7UHOxFtniV7mI3T556iZN9AU8bEZ1lHMcVK"/>
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20110530-7P7NFUFFLWUl76mart"/>
-<unit id="org.eclipse.platform.source.feature.group" version="3.7.1.r37x_v20110729-9gF7UHOxFtniV7mI3T556iZN9AU8bEZ1lHMcVK"/>
-<unit id="org.eclipse.platform.sdk" version="3.7.1.M20110909-1335"/>
-<unit id="org.eclipse.rcp.feature.group" version="3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A"/>
-<unit id="org.eclipse.rcp.source.feature.group" version="3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A"/>
-<unit id="org.eclipse.rcp.sdk.id" version="3.7.1.M20110909-1335"/>
-<unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.1.R37x_v20110907-7M7W8h8eNV4Vrz-hz01A7SL_MhZP"/>
-<unit id="org.eclipse.zest.sdk.feature.group" version="1.3.0.v20110425-2050-67C08COMOGAKRUKGP_ULXbePP8ZT"/>
+<unit id="org.eclipse.jdt.feature.group" version="3.7.2.v20120120-1414-7z8gFcuFMP7BW5XTz0jLTnz0l9B1"/>
+<unit id="org.eclipse.pde.source.feature.group" version="3.7.2.v20120120-1420-7b7rFUOFEx2Xnqafnpz0E--0"/>
+<unit id="org.eclipse.platform.feature.group" version="3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q"/>
+<unit id="org.eclipse.equinox.executable.feature.group" version="3.5.1.v20111216-1653-7P7NFUIFIbaUcU77s0KQWHw5HZTZ"/>
+<unit id="org.eclipse.platform.source.feature.group" version="3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q"/>
+<unit id="org.eclipse.platform.sdk" version="3.7.2.M20120208-0800"/>
+<unit id="org.eclipse.rcp.feature.group" version="3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272"/>
+<unit id="org.eclipse.rcp.source.feature.group" version="3.7.2.v20120120-1424-9DB5FmnFq5JCf1UA38R-kz0S0272"/>
+<unit id="org.eclipse.rcp.sdk.id" version="3.7.2.M20120208-0800"/>
+<unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.1.R37x_v20110907-7M7W8i8eNV4WsRkue-4Vq4J6pCyW"/>
+<unit id="org.eclipse.zest.sdk.feature.group" version="1.3.0.v20110425-2050-67C18COMPIAKSVKGQaRTQTiSN8WP"/>
<repository location="http://download.eclipse.org/releases/indigo"/>
</location>
<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.nebula.widgets.compositetable.feature" version="1.0.0.201409040043"/>
+<unit id="org.eclipse.nebula.widgets.compositetable.feature.feature.group" version="1.0.0.201409040043"/>
<repository location="http://download.eclipse.org/technology/nebula/archives/Q32014/release/"/>
</location>
+<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site"/>
+</location>
</locations>
+<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_60"/>
+<launcherArgs>
+<vmArgs>-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m</vmArgs>
+</launcherArgs>
</target>
</prerequisites>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.4.1-SNAPSHOT</version>
+ <version>3.5.2-SNAPSHOT</version>
<name>EDIT Taxonomic Editor</name>
<description>The Taxonomic Editor for EDIT's platform for
- cybertaxonomy</description>
- <url>http://cybertaxonomy.eu/taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor/</url>
+ cybertaxonomy
+ </description>
+ <url>http://cybertaxonomy.eu/taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor/
+ </url>
<inceptionYear>2007</inceptionYear>
<packaging>pom</packaging>
<properties>
<java.codelevel>1.6</java.codelevel>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <cdmlib.version>3.4.1-SNAPSHOT</cdmlib.version>
+ <cdmlib.version>3.5.2-SNAPSHOT</cdmlib.version>
<!-- TODO can we use project.version ????? -->
- <tycho.version>0.14.0</tycho.version>
- <taxeditor.version>3.4.1-SNAPSHOT</taxeditor.version>
+ <tycho.version>0.22.0</tycho.version>
+ <taxeditor.version>3.5.2-SNAPSHOT</taxeditor.version>
<update.dir>snapshot</update.dir>
</properties>
<modules>
<module>eu.etaxonomy.taxeditor</module>
</modules>
<scm>
- <connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/taxeditor/</connection>
- <developerConnection>scm:svn:https://dev.e-taxonomy.eu/svn/trunk/taxeditor/</developerConnection>
+ <connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/taxeditor/
+ </connection>
+ <developerConnection>scm:svn:https://dev.e-taxonomy.eu/svn/trunk/taxeditor/
+ </developerConnection>
<url>https://dev.e-taxonomy.eu/trac/browser/trunk/taxeditor/</url>
</scm>
<mailingLists>
edit-taxonomic-editor+unsubscribe@googlegroups.com
</unsubscribe>
<post>edit-taxonomic-editor@googlegroups.com</post>
- <archive>http://groups.google.com/group/edit-taxonomic-editor/topics</archive>
+ <archive>http://groups.google.com/group/edit-taxonomic-editor/topics
+ </archive>
</mailingList>
</mailingLists>
<licenses>
</issueManagement>
<ciManagement>
<system>Jenkins</system>
- <url>http://160.45.63.201/jenkins/view/EDIT%20Taxonomic%20Editor/</url>
+ <url>http://160.45.63.201/jenkins/view/EDIT%20Taxonomic%20Editor/
+ </url>
</ciManagement>
<!-- **** REPOSITORIES **** -->
<profiles>
<repository>
<id>eclipse-indigo</id>
<layout>p2</layout>
- <url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/</url>
+ <url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/
+ </url>
</repository>
- <!-- The nebula repository (retention period 2 years starting Q32014) set here is an archived one
- so as to have a stable version of the jar when building the editor . Refer to #4452 for details -->
+ <!-- The nebula repository (retention period 2 years starting Q32014)
+ set here is an archived one so as to have a stable version of the jar when
+ building the editor . Refer to #4452 for details -->
<repository>
<id>eclipse-nebula</id>
<layout>p2</layout>
- <url>http://download.eclipse.org/technology/nebula/archives/Q32014/release/</url>
+ <url>http://download.eclipse.org/technology/nebula/archives/Q32014/release/
+ </url>
</repository>
<repository>
<id>eclipse-swtbot</id>
<site>
<id>wp5.e-taxonomy.eu</id>
<name>EDIT Taxonomic Editor</name>
- <url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/taxeditor/</url>
+ <url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/taxeditor/
+ </url>
</site>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>wp5.e-taxonomy.eu</id>
<name>Edit Maven Repository</name>
- <url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/mavenrepo/</url>
+ <url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/mavenrepo/
+ </url>
</repository>
</distributionManagement>
</project>
* <Modeling-\>><<Graphical Editing Framework Zest Visualization Toolkit SDK>> from update site: <http://download.eclipse.org/releases/indigo>
- * <Nebula Release Individual Widgets-\>> <<Nebula CompositeTable Widget>> from update site: <http://download.eclipse.org/technology/nebula/snapshot>
+ * <Nebula Release Individual Widgets-\>> <<Nebula CompositeTable Widget>> from update site: <http://download.eclipse.org/technology/nebula/archives/Q32014/release/>
* To Install the plugins use the Eclipse-Install-Wizard via <Help -\> Install new Software> and paste the URL in the <Work With> row. Click <Add> and use the Filter to find, check and install plugins.