merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 19 Aug 2014 09:15:06 +0000 (09:15 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 19 Aug 2014 09:15:06 +0000 (09:15 +0000)
252 files changed:
.gitattributes
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.application/build.properties
eu.etaxonomy.taxeditor.application/plugin.properties [deleted file]
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/TaxonomicEditorPlugin.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/LineAnnotationModel.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/handler/NewObjectHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorQuery.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicMarkerTypeEditingMenu.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/operation/AddDerivedUnitFacadeMediaOperation.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameRelationshipEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/ReferenceCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/UserCreator.java
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/build.properties
eu.etaxonomy.taxeditor.editor/plugin.properties [deleted file]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorStateManager.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputFactory.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/CreateChildNodeHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/CreateSiblingNodeHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/DeleteNodeHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RefreshNodeNumberingHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/SynonymContainer.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/dnd/NameEditorDropTargetListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeSynonymToAcceptedTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateHomotypicSynonymHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/SwapSynonymAndAcceptedHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptRelationshipTypeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistContentProvider.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/RankEditingSupport.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/filter/ChecklistEditorFilter.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionElementHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/OpenDistributionHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistDropdownSelectionListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistFocusListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/graph/ConceptGraphView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/AbstractDynamicConceptRelationMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/CreateConceptRelationHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/DeleteConceptRelationHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/OpenRelatedConceptHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTaxonService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDragListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDropListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateViewEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/DeleteDescriptionElementOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/EditInXper2Handler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaContentProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/MoveImageDownInListHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/MoveImageUpInListHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/MoveMediaInListOperation.java
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/build.properties
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewPart.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonLinkHelper.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/ChangeAcceptedTaxonToSynonymHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CopyHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/MoveTaxonOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateTaxonNode.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/Messages.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
eu.etaxonomy.taxeditor.navigation/src/test/java/eu/etaxonomy/taxeditor/navigation/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.printpublisher/build.properties
eu.etaxonomy.taxeditor.printpublisher/plugin.xml
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizard.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectStylesheetWizardPage.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectTaxaWizardPage.java
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/build.properties
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/CdmDataSourceRepository.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateDefinedTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateTermVocabularyHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermEditorHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateDefinedTermOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/MoveDefinedTermOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/EditFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDistributionEditorWizardHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenPasswordWizzardHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmProgressMonitorAdapter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MementoHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TemplatePreferencePage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/TeamOrPersonMatchingPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/ContextManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/EditorManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/LoginManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/UriDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmEnumSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AmplificationSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/DerivedUnitSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FieldUnitSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PrimerSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmFormElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractFormSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ImageElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/SelectionArbitrator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ToggleableTextElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlReferencePage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlSelectorElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/EditPasswordElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamOrPersonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SynonymRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/translation/TranslationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmMetaDataAwareDataSourceContainer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/Messages.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/UpdateDataSourceHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchCompositeController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java

index 817258fa912600c6ab8eca801b9e28352361b032..b75d7ac6ee138e7f99701d499baaa4c1dadfcd78 100644 (file)
@@ -4,6 +4,9 @@
 eu.etaxonomy.taxeditor.application/.classpath -text
 eu.etaxonomy.taxeditor.application/.project -text
 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/build.properties -text
 eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif -text
 eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif -text
@@ -12,7 +15,6 @@ eu.etaxonomy.taxeditor.application/icons/256color_48x48.ico -text
 eu.etaxonomy.taxeditor.application/icons/edit_16x16.gif -text
 eu.etaxonomy.taxeditor.application/icons/specimen_derivate-16x16-32.png -text
 eu.etaxonomy.taxeditor.application/p2.inf -text
-eu.etaxonomy.taxeditor.application/plugin.properties -text
 eu.etaxonomy.taxeditor.application/plugin.xml -text
 eu.etaxonomy.taxeditor.application/plugin_customization.ini -text
 eu.etaxonomy.taxeditor.application/pom.xml -text
@@ -349,6 +351,9 @@ eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/cdm.datasource
 eu.etaxonomy.taxeditor.editor/.classpath -text
 eu.etaxonomy.taxeditor.editor/.project -text
 eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties -text
+eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties -text
+eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties -text
 eu.etaxonomy.taxeditor.editor/build.properties -text
 eu.etaxonomy.taxeditor.editor/icons/address-book-new.png -text
 eu.etaxonomy.taxeditor.editor/icons/camera-photo.png -text
@@ -362,7 +367,6 @@ eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text
 eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar -text
 eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar -text
 eu.etaxonomy.taxeditor.editor/p2.inf -text
-eu.etaxonomy.taxeditor.editor/plugin.properties -text
 eu.etaxonomy.taxeditor.editor/plugin.xml -text
 eu.etaxonomy.taxeditor.editor/pom.xml -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/CdmDataTransfer.java -text
@@ -387,6 +391,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SaveAllHandler.java -text
@@ -478,6 +483,20 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/o
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/RemoveHomotypicalGroupBasionymOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistContentProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/RankEditingSupport.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/filter/ChecklistEditorFilter.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionElementHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/OpenDistributionHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistDropdownSelectionListener.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistFocusListener.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptContentProvider.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptLabelProvider.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java -text
@@ -882,6 +901,12 @@ eu.etaxonomy.taxeditor.help/tocnameparser.xml -text
 eu.etaxonomy.taxeditor.navigation/.classpath -text
 eu.etaxonomy.taxeditor.navigation/.project -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/edit_16x16.gif -text
 eu.etaxonomy.taxeditor.navigation/icons/preferences-system-windows.png -text
@@ -938,6 +963,7 @@ eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigatio
 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/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.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultLabelProvider.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultView.java -text
@@ -954,6 +980,9 @@ eu.etaxonomy.taxeditor.navigation/src/test/resources/log4j.properties -text
 eu.etaxonomy.taxeditor.printpublisher/.classpath -text
 eu.etaxonomy.taxeditor.printpublisher/.project -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
@@ -978,6 +1007,12 @@ eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/print
 eu.etaxonomy.taxeditor.store/.classpath -text
 eu.etaxonomy.taxeditor.store/.project -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
@@ -1180,6 +1215,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/Fe
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/OpenFeatureTreeEditorWizardHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/SelectFeatureTreeWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDistributionEditorWizardHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenPasswordWizzardHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/identificationkey/AbstractIdentificaitonKeyWizard.java -text
@@ -1213,6 +1249,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/labels/Zoologi
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractDataChangeBehaviour.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AuthorHelper.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmObjectTransfer.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmProgressMonitorAdapter.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CommonHelper.java -text
@@ -1234,6 +1271,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartCon
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/LineSelection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MementoHelper.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MultiLanguageText.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NameHelper.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NomenclaturalCodeHelper.java -text
@@ -1275,6 +1313,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/IPos
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/MatchStrategyConfigurator.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/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/FeatureTreePreferences.java -text
@@ -1290,6 +1329,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/Res
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicPreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TemplatePreferencePage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TypeDesignationPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/AbstractMatchingPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/NonViralNameMatchingPreference.java -text
@@ -1313,6 +1353,8 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/men
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/SpecimenTypeDesignationStatusMenuPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/StageMenuPreferences.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/TaxonRelationshipTypeMenuPreferences.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/security/AuthenticationSourceProvider.java -text
@@ -1681,6 +1723,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasourc
 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
index 4d75b2ec5fd0c5175038690bcbe135b8c810d95c..9e0c6eb5987f878b879eb6470c4f0ba0647c63fc 100644 (file)
@@ -5,7 +5,7 @@ Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
 Bundle-Version: 3.3.7.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
 Bundle-Vendor: EDIT
-Bundle-Localization: plugin
+Bundle-Localization: OSGI-INF/l10n/plugin
 Export-Package: eu.etaxonomy.taxeditor
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties b/eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin.properties
new file mode 100644 (file)
index 0000000..9e64cfd
--- /dev/null
@@ -0,0 +1,43 @@
+productName=EDIT Taxonomic Editor\r
+productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
+\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
diff --git a/eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties b/eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_de.properties
new file mode 100644 (file)
index 0000000..2283ab3
--- /dev/null
@@ -0,0 +1,43 @@
+productName=EDIT Taxonomischer Editor
+productBlurb=EDIT Taxonomischer Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu
+
+extension.name = Taxonomischer Editor
+perspective.name = Taxonomisch
+perspective.name.0 = Polytomer Key
+perspective.name.1 = Anwendungen
+perspective.name.2 = Derivate
+menu.label = Datei
+menu.label.0 = Bearbeiten
+menu.label.1 = Extras
+menu.label.2 = Hilfe
+menu.label.3 = Neu
+command.label = Schlie\u00dfen
+command.label.0 = Schlie\u00dfe alle
+command.label.1 = Speichern
+command.label.2 = Speichere alle
+command.label.3 = Import...
+command.label.4 = Export...
+command.label.5 = Beenden
+command.label.6 = R\u00fcckg\u00e4ngig
+command.label.7 = Letzen Befehl wiederholen
+command.label.8 = Ausschneiden
+command.label.9 = Kopieren
+command.label.10 = Einf\u00fcgen
+command.label.11 = L\u00f6schen
+command.label.12 = Einstellungen
+command.label.13 = Hilfeinhalt
+command.label.14 = Suchen
+command.label.15 = Dynamische Hilfe
+command.label.16 = Parser Hilfe Webseite (in Englisch)
+command.label.17 = Suche nach Updates
+command.label.18 = Installiere Neue Software...
+command.label.19 = \u00dcber den Taxonomischen Editor
+command.label.20 = \u00dcber die EDIT Platform
+command.label.21 = Neu
+command.label.22 = Speichern
+product.name = EDIT Taxonomischer Editor
+command.name = Parser Hilfe
+command.name.0 = \u00dcber die EDIT Platform
+activity.description = Schalte unerw\u00fcnschte eclipse UI aus
+activity.name = Ausschalten
+product.name.0 = EDIT Taxonomischer Editor
diff --git a/eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties b/eu.etaxonomy.taxeditor.application/OSGI-INF/l10n/plugin_en.properties
new file mode 100644 (file)
index 0000000..9e64cfd
--- /dev/null
@@ -0,0 +1,43 @@
+productName=EDIT Taxonomic Editor\r
+productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
+\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
index 7280c0755469c1a996c677c30196c3b4aa970eb6..af4a4e99ecc9ad8a94528b68e253041a4df3e18f 100644 (file)
@@ -6,6 +6,8 @@ bin.includes = META-INF/,\
                plugin.xml,\
                plugin_customization.ini,\
                icons/,\
-               plugin.properties,\
+               OSGI-INF/l10n/plugin.properties,\
                splash.bmp,\
-               p2.inf
+               p2.inf,\
+               OSGI-INF/l10n/plugin_de.properties,\
+               OSGI-INF/l10n/plugin_en.properties
diff --git a/eu.etaxonomy.taxeditor.application/plugin.properties b/eu.etaxonomy.taxeditor.application/plugin.properties
deleted file mode 100644 (file)
index ee8803d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-productName=EDIT Taxonomic Editor\r
-productBlurb=EDIT Taxonomic Editor\n\Version: 3.3\n\n\Copyright (C) 2009 EDIT\n\European Distributed Institute of Taxonomy\n\http://www.e-taxonomy.eu\r
index ff3de6627b6965c9472a256f2b5cdfd8b6a02f32..4921f4a52f82295fa979d04fea4ff0ac6e47f23a 100644 (file)
@@ -3,7 +3,7 @@
 <plugin>\r
    <extension\r
          id="application"\r
-         name="Taxonomic Editor"\r
+         name="%extension.name"\r
          point="org.eclipse.core.runtime.applications">\r
       <application\r
             cardinality="singleton-global"\r
@@ -19,7 +19,7 @@
       <perspective\r
             class="eu.etaxonomy.taxeditor.perspective.Taxonomic"\r
             id="eu.etaxonomy.taxeditor.application.perspective.taxonomic"\r
-            name="Taxonomic">\r
+            name="%perspective.name">\r
       </perspective>\r
       <!--perspective\r
             class="eu.etaxonomy.taxeditor.perspective.BulkEditing"\r
       <perspective\r
             class="eu.etaxonomy.taxeditor.perspective.PolytomousKey"\r
             id="eu.etaxonomy.taxeditor.application.perspective.polytomous"\r
-            name="Polytomous Key">\r
+            name="%perspective.name.0">\r
       </perspective>\r
       <perspective\r
             class="eu.etaxonomy.taxeditor.perspective.Uses"\r
             id="eu.etaxonomy.taxeditor.application.perspective.uses"\r
-            name="Uses">\r
+            name="%perspective.name.1">\r
       </perspective>\r
       <perspective\r
             class="eu.etaxonomy.taxeditor.perspective.DerivatePerspective"\r
             icon="icons/specimen_derivate-16x16-32.png"\r
             id="eu.etaxonomy.taxeditor.application.perspective.derivates"\r
-            name="Derivates">\r
+            name="%perspective.name.2">\r
       </perspective>\r
      \r
    </extension>\r
             locationURI="menu:org.eclipse.ui.main.menu">\r
          <menu\r
                id="org.eclipse.ui.main.menu.file"\r
-               label="General">\r
+               label="%menu.label">\r
          </menu>\r
          <menu\r
                id="org.eclipse.ui.main.menu.edit"\r
-               label="Edit">\r
+               label="%menu.label.0">\r
          </menu>\r
          <menu\r
                id="org.eclipse.ui.main.menu.window"\r
-               label="Window">\r
+               label="%menu.label.1">\r
          </menu>\r
          <menu\r
                id="org.eclipse.ui.main.menu.help"\r
-               label="Help">\r
+               label="%menu.label.2">\r
          </menu>\r
       </menuContribution>\r
       <menuContribution\r
             locationURI="menu:org.eclipse.ui.main.menu.file">\r
          <menu\r
                id="eu.etaxonomy.navigation.menu.new"\r
-               label="New">\r
+               label="%menu.label.3">\r
          </menu>\r
          <separator\r
                name="eu.etaxonomy.taxeditor.application.filemenu.new"\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.file.close"\r
-               label="Close"\r
+               label="%command.label"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.file.closeAll"\r
-               label="Close All"\r
+               label="%command.label.0"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.file.save"\r
-               label="Save"\r
+               label="%command.label.1"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.file.saveAll"\r
-               label="Save All"\r
+               label="%command.label.2"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.file.import"\r
-               label="Import..."\r
+               label="%command.label.3"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.file.export"\r
-               label="Export..."\r
+               label="%command.label.4"\r
                style="push">\r
          </command>\r
          <separator\r
          <command\r
                commandId="org.eclipse.ui.file.exit"\r
                id="eu.etaxonomy.taxeditor.application.menu.exit"\r
-               label="Exit"\r
+               label="%command.label.5"\r
                style="push">\r
          </command>\r
       </menuContribution>\r
             locationURI="menu:org.eclipse.ui.main.menu.edit">\r
          <command\r
                commandId="org.eclipse.ui.edit.undo"\r
-               label="Undo">\r
+               label="%command.label.6">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.edit.redo"\r
-               label="Redo"\r
+               label="%command.label.7"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.edit.cut"\r
-               label="Cut"\r
+               label="%command.label.8"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.edit.copy"\r
-               label="Copy"\r
+               label="%command.label.9"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.edit.paste"\r
-               label="Paste"\r
+               label="%command.label.10"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.edit.delete"\r
-               label="Delete"\r
+               label="%command.label.11"\r
                style="push">\r
          </command>\r
       </menuContribution>\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.window.preferences"\r
-               label="Preferences"\r
+               label="%command.label.12"\r
                style="push">\r
          </command>\r
       </menuContribution>\r
             locationURI="menu:org.eclipse.ui.main.menu.help">\r
          <command\r
                commandId="org.eclipse.ui.help.helpContents"\r
-               label="Help Contents"\r
+               label="%command.label.13"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.ui.help.helpSearch"\r
-               label="Search"\r
+               label="%command.label.14"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.help.dynamicHelp"\r
-               label="Dynamic Help"\r
+               label="%command.label.15"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="eu.etaxonomy.taxeditor.application.help.parser"\r
-               label="Parser Help Website"\r
+               label="%command.label.16"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.equinox.p2.ui.sdk.update"\r
-               label="Check for Updates"\r
+               label="%command.label.17"\r
                style="push">\r
          </command>\r
          <command\r
                commandId="org.eclipse.equinox.p2.ui.sdk.install"\r
-               label="Install New Software..."\r
+               label="%command.label.18"\r
                style="push">\r
          </command>\r
          <separator\r
          </separator>\r
          <command\r
                commandId="org.eclipse.ui.help.aboutAction"\r
-               label="About Taxonomic Editor">\r
+               label="%command.label.19">\r
          </command>\r
          <command\r
                commandId="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
-               label="About the EDIT Platform"\r
+               label="%command.label.20"\r
                style="push">\r
          </command>\r
       </menuContribution>\r
                id="eu.etaxonomy.taxeditor.editor.main">\r
             <command\r
                   commandId="org.eclipse.ui.newWizard"\r
-                  label="New"\r
+                  label="%command.label.21"\r
                   style="push">\r
             </command>\r
             <command\r
                   commandId="org.eclipse.ui.file.save"\r
-                  label="Save"\r
+                  label="%command.label.22"\r
                   style="push">\r
             </command>\r
          </toolbar>\r
          point="org.eclipse.core.runtime.products">\r
       <product\r
             application="eu.etaxonomy.taxeditor.application.application"\r
-            name="EDIT Taxonomic Editor">\r
+            name="%product.name">\r
          <property\r
                name="windowImages"\r
                value="icons/256color_16x16.gif,icons/256color_32x32.gif,icons/256color_48x48.gif">\r
       <command\r
             defaultHandler="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler"\r
             id="eu.etaxonomy.taxeditor.application.help.parser"\r
-            name="Parser Help">\r
+            name="%command.name">\r
       </command>\r
       <command\r
             defaultHandler="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler"\r
             id="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
-            name="About the EDIT Platform">\r
+            name="%command.name.0">\r
       </command>\r
    </extension>\r
 \r
        <extension\r
                point="org.eclipse.ui.activities">\r
                <activity\r
-                       description="Disable unwanted eclipse UI"\r
+                       description="%activity.description"\r
                        id="eu.etaxonomy.taxeditor.disable"\r
-                       name="Disable">\r
+                       name="%activity.name">\r
                </activity>\r
                <activityPatternBinding\r
                        activityId="eu.etaxonomy.taxeditor.disable"\r
        point="org.eclipse.core.runtime.products">\r
     <product\r
           application="eu.etaxonomy.taxeditor.application.application"\r
-          name="EDIT Taxonomic Editor">\r
+          name="%product.name.0">\r
        <property\r
              name="appName"\r
              value="EDIT Taxonomic Editor">\r
index cac70d6a0db1f5d49e07a50fae9e73c783499688..18ac99ecf3935013e0d38fe0baebc4a78d044b35 100644 (file)
@@ -1,9 +1,24 @@
 package eu.etaxonomy.taxeditor;
 
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.rmi.activation.Activator;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.application.IWorkbenchConfigurer;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.application.WorkbenchAdvisor;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.eclipse.ui.statushandlers.AbstractStatusHandler;
+import org.eclipse.ui.statushandlers.StatusAdapter;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
 
 
 /**
@@ -14,6 +29,7 @@ import org.eclipse.ui.application.WorkbenchWindowAdvisor;
  */
 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 
+       private CdmStatusHandler cdmStatusHandler;
        /*
         * (non-Javadoc)
         * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
@@ -96,6 +112,66 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 //             return workspace.getRoot();
 //     }
 
+//     @Override
+//     public void eventLoopException(Throwable exception) {
+//             super.eventLoopException(exception);
+//             StoreUtil.messageDialog("Unexpected error", null, exception.getMessage(), exception);
+//     }
+       
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.application.WorkbenchAdvisor#getWorkbenchErrorHandler()
+        */
+       @Override
+       public synchronized AbstractStatusHandler getWorkbenchErrorHandler() {
+           if (cdmStatusHandler == null) {
+               cdmStatusHandler = new CdmStatusHandler();
+           }
+           return cdmStatusHandler;
+       }
+       
+
+       /**
+        * Custom status handler for handling scenarios which are 
+        * not handled by the editor (e.g. runtime exceptions).
+        * 
+        * The default {@link org.eclipse.ui.statushandlers.WorkbenchErrorHandler}
+        * is not used or extended because we need a handler for specific scenarios
+        * which displays a custom built error dialog.
+        * 
+        * @author cmathew
+        *
+        */
+       class CdmStatusHandler extends AbstractStatusHandler {
+               
+               /* (non-Javadoc)
+                * @see org.eclipse.ui.statushandlers.AbstractStatusHandler#handle(org.eclipse.ui.statushandlers.StatusAdapter, int)
+                */
+               @Override
+               public void handle(StatusAdapter statusAdapter, int style)
+               {
+                   if(statusAdapter.getStatus().matches(IStatus.ERROR)) {
+                       
+                       IStatus status = statusAdapter.getStatus();                                     
+                       Throwable t = statusAdapter.getStatus().getException();         
+                       // NOTE : Currently we only allow RuntimeExceptions since
+                       //        allowing all kinds of exceptions would also include 
+                       //        those in generated status objects coming from from logging triggers 
+                       //        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) {                                                        
+                               MessagingUtils.errorDialog("Unexpected error", 
+                                               null, 
+                                               MessagingUtils.UNEXPECTED_ERROR_MESSAGE, 
+                                               statusAdapter.getStatus().getPlugin(), 
+                                               t,
+                                               true);                                          
+                       }                           
+                   }
+               }
+       }
        
 
+       
 }
index f7bcbe89b597117612798eaea02baa0686b51b28..00a48ec537aca90ef3a80f95112033c888ed91ee 100644 (file)
@@ -13,6 +13,7 @@ import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 import org.osgi.framework.ServiceReference;
 
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
@@ -84,15 +85,15 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
                try {
                        agent = agentProvider.createAgent(null);//new URI("file:/Applications/eclipse36/p2"));
                        if (agent == null) {
-                               ApplicationUtil.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
+                               MessagingUtils.error(this.getClass(), "No provisioning agent found. This application is not set up for updates.", null);
                                return;
                        }
 
                        IStatus status = P2Util.checkForUpdates(agent, null);
 
-                       ApplicationUtil.info(status);
+                       MessagingUtils.info(status);
                } catch (ProvisionException e) {
-                       ApplicationUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } finally {
                        if(agent != null) agent.stop();
                }
index 521c2d1b340a35f23ef29685ad0387d9f09459ec..50d279ef76dfb9d019320672cfb7e5760879f0a0 100644 (file)
@@ -8,6 +8,8 @@ import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.packageadmin.PackageAdmin;
 
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
 /**
  * The activator class controls the plug-in life cycle
  *
@@ -83,7 +85,7 @@ public class TaxonomicEditorPlugin extends AbstractUIPlugin {
        public void stop(BundleContext context) throws Exception {
                plugin = null;
                super.stop(context);
-               ApplicationUtil.info("Taxonomic Editor stopped.");
+               MessagingUtils.info("Taxonomic Editor stopped.");
        }
 
        /**
index cad73b3e085be0a82042337e93ea6300b0a558af..5469cb0693d406f40536e6a60776f43933ad8c14 100644 (file)
@@ -26,7 +26,7 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.texteditor.AbstractDocumentProvider;
 
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 
 
@@ -113,7 +113,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                                        try {
                                                createAnnotatedLine(input, entity);
                                        } catch (BadLocationException e) {
-                                               AbstractUtility.error(getClass(), "Problems creating annotated line: ", e);
+                                               MessagingUtils.error(getClass(), "Problems creating annotated line: ", e);
                                        }
                                }
                        }
@@ -206,7 +206,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                        }
                        document.replace(offset, lineLength, text);
                } catch (BadLocationException e) {
-                       AbstractUtility.error(getClass(), "Problem updating annotated line: " ,e);
+                       MessagingUtils.error(getClass(), "Problem updating annotated line: " ,e);
                }
        }
 
@@ -363,13 +363,13 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                                        length += 2;
                                }
                        } catch (BadLocationException e1) {
-                               AbstractUtility.error(getClass(), "Problems removing annotated line", e1);
+                               MessagingUtils.error(getClass(), "Problems removing annotated line", e1);
                        }
 
                        try {
                                document.replace(offset, length, "");
                        } catch (BadLocationException e) {
-                               AbstractUtility.error(getClass(), "Problems removing annotated line", e);
+                               MessagingUtils.error(getClass(), "Problems removing annotated line", e);
                        }
                }
        }
index f45d45100cf398fd279948ad69720fb6b4495fd4..08876fef01d643cd5a2869b83dd2472903ec86aa 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.text.source.IVerticalRuler;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.TextEditor;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 
@@ -258,6 +259,7 @@ public class AnnotatedLineEditor extends TextEditor implements IConversationEnab
                if (getConversationHolder() != null) {
                        getConversationHolder().bind();
                }
+               PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
                // TODO pass focus to underlying widgets
        }
 
index 6056d0c6d4a3ab19eaab5c91542accdc67497c0c..f48b073e6114ea30971988ea058b815610b40ba7 100644 (file)
@@ -26,7 +26,7 @@ import org.eclipse.jface.text.source.Annotation;
 import org.eclipse.jface.text.source.AnnotationModel;
 import org.eclipse.jface.text.source.AnnotationModelEvent;
 
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * An <code>AnnotationModel</code> which holds <code>LineAnnotation</code>'s.
@@ -181,7 +181,7 @@ public class LineAnnotationModel extends AnnotationModel {
         * <p>printAnnotations</p>
         */
        public void printAnnotations() {
-               Logger logger = BulkEditorUtil.getLog4JLogger(getClass());
+               Logger logger = MessagingUtils.getLog4JLogger(getClass());
                logger.debug("------------------------");
                logger.debug("Active annotations");
                logger.debug("------------------------");
index 77e5606dd93f109a5cd2bb71127a99f31227aed7..fade7f89bf3e898a9ae0b5d487cbfaefdb3e8d52 100644 (file)
 
 package eu.etaxonomy.taxeditor.annotatedlineeditor.handler;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.IInputValidator;
 import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Event;
@@ -47,7 +51,31 @@ public class NewObjectHandler extends AbstractHandler {
                        if (key != null) {
                                if(!(key instanceof SpecimenOrObservationType)) {
                                        String text = ((Event)event.getTrigger()).text; 
-                                       InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), "Create " + text, "Enter new " + text, "", null); 
+                                       
+                                       //FIXME : This should probably go into some ValidatorFactory
+                                       IInputValidator nonEmptyInputValidator = null;
+                                       //FIXME : This is a workaround to not allow empty strings in the 
+                                       //        input dialog for User and Group entities. 
+                                       //        Normally this should be default
+                                       //        behaviour, so we need to discuss whether this handler
+                                       //        should be used to handle the creating new entities of
+                                       //        type other than User and Group.
+                                       //        Once #4348 is fixed this check can be removed.
+                                       if(text.equals("User") || text.equals("Group")) {
+                                               nonEmptyInputValidator = new IInputValidator() {
+                                                       public String isValid(String text) {                                                    
+                                                               if(text == null || text.isEmpty()) {
+                                                                       return "Input cannot be empty";
+                                                               }
+                                                               return null;
+                                                       }                       
+                                               };
+                                       }
+                                       InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), 
+                                                       "Create " + text, 
+                                                       "Enter new " + text, "",
+                                                       nonEmptyInputValidator); 
+
                                        if (dialog.open() != Window.CANCEL) { 
                                                ((AnnotatedLineEditor) editor).createAnnotatedLineNewObject(key, dialog.getValue()); 
                                        }
index 00519c8e4510fd871ab1588745e92814b6697309..b32f182c54fcd21831987ed1ae04bd728b8e81c7 100644 (file)
@@ -24,7 +24,7 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 public class BulkEditorQuery {
                
        private String searchString;
-       private Comparator comparator;
+       private Comparator<?> comparator;
        private IIdentifiableEntityServiceConfigurator searchConfigurator;
 
        public BulkEditorQuery (String searchString, Comparator comparator) {
index d244ab961a840973aef747cc764d0413e0585514..8444de4f4468bb26a4206ae4a9979ee77637f769 100644 (file)
@@ -27,7 +27,7 @@ import org.eclipse.ui.actions.CompoundContributionItem;
 import org.eclipse.ui.handlers.IHandlerService;
 
 import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -88,13 +88,13 @@ public class DynamicMarkerTypeEditingMenu extends CompoundContributionItem {
                        event.data = new Object[]{markerType, flag};
                        handlerService.executeCommand("taxeditor-bulkeditor.command.setMarkerFlag", event);
                } catch (ExecutionException e) {
-                       BulkEditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (NotDefinedException e) {
-                       BulkEditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (NotEnabledException e) {
-                       BulkEditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (NotHandledException e) {
-                       BulkEditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                
        }               
index a1b78438cf11e50af7cb2975550a6443f6d4c9c5..4402368b6a53b72c1917f3877c0ef28a96ad2f0d 100644 (file)
@@ -26,6 +26,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
 import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
 import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -61,7 +62,7 @@ public abstract class AbstractAddDerivedUnitFacadeMediaHandler extends AbstractH
                                                AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnit) element, getMode(), postOperationEnabled);
                                                BulkEditorUtil.executeOperation(operation);
                                        } catch (NotDefinedException e) {
-                                               BulkEditorUtil.warn(getClass(), "Command name not set.");
+                                               MessagingUtils.warn(getClass(), "Command name not set.");
                                        }                                       
                                }
                        }
index e673e513c7c43f65d2087e5c87af2b5a292a396d..41948253e4b6a94dae2eeacb96c5492102590c9c 100644 (file)
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -64,7 +64,7 @@ public class AddDerivedUnitFacadeMediaOperation extends
 
                        createImageGallery(facade);
                } catch (DerivedUnitFacadeNotSupportedException e) {
-                       BulkEditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                
                return postExecute(derivedUnit);
index 8e4759ab69a7d1c47b9d1eaf80a4da5a729f9d85..73c2c8022f83bfbfbd5d787b32e93904dcb666d5 100644 (file)
@@ -46,7 +46,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -119,17 +119,17 @@ public class DeleteHandler extends AbstractHandler {
                                                        result = service.delete((TeamOrPersonBase)object);
                                                }
                                        } catch (Exception e){
-                                               BulkEditorUtil.errorDialog("Could not delete", getClass(), e.getMessage(), null);
+                                               MessagingUtils.messageDialog("Could not delete", getClass(), e.getMessage(), null);
                                        }
                                        if (result.isError()){
-                                               BulkEditorUtil.errorDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null);
+                                               MessagingUtils.messageDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null);
                                        }
                                        ((BulkEditor) editor).removeAnnotatedLine(annotation);
                                        
                                }                               
                        }
                }else{
-                       BulkEditorUtil.warningDialog("Feature not enabled", getClass(), "Deletion is currently an experimental feature." +
+                       MessagingUtils.warningDialog("Feature not enabled", getClass(), "Deletion is currently an experimental feature." +
                                        "Enable it via Preferences at your own risk.");
                }
                
index 0e42064630d8ec3f9afadee97b52ed01b2c95b1f..f9d5845ccfce29db85ab0997ad1cb3124dcbac3f 100644 (file)
@@ -34,7 +34,8 @@ import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -224,9 +225,14 @@ public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEd
     public boolean merge(T entity, T mergeTarget) {
                if (entity instanceof IMergable) {
                        try {
-                               CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);
+                               CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);                               
                        } catch (MergeException e) {
-                               AbstractUtility.error(getClass(), 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;
index 1956b9476cb3e47e898f290ee15a8bee2cb37bb9..a317feca144f1e561b25e3eaadc674c90650745d 100644 (file)
@@ -17,7 +17,7 @@ import java.util.UUID;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -114,7 +114,7 @@ public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRel
         */
        @Override
        protected IEntityCreator<NameRelationship> createEntityCreator() {
-               BulkEditorUtil.notImplementedMessage(getClass());
+               MessagingUtils.notImplementedMessage(getClass());
                return null;
        }
        
index 92d94ee4ad882a651d6865e834d96bf1db54cd16..0bdd381a6b4911dbb6be274bd4ad5677c801348f 100644 (file)
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.reference.ReferenceType;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>ReferenceCreator class.</p>
@@ -93,7 +93,7 @@ public class ReferenceCreator implements IEntityCreator<Reference> {
                        reference = ReferenceFactory.newWebPage();
                }
                if (reference == null) {
-                       BulkEditorUtil.warn(getClass(), "Reference type " + key + " not found. Creating reference with default type.");
+                       MessagingUtils.warn(getClass(), "Reference type " + key + " not found. Creating reference with default type.");
                        reference = ReferenceFactory.newGeneric();
                }
                reference.setTitleCache(text, true);
index d092ce03a6be1020437b9f9765c7f09f948ca03d..aba437843535c3a7afac76042df26592e35a13e9 100644 (file)
@@ -18,7 +18,7 @@ import org.springframework.security.access.AccessDeniedException;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -46,7 +46,7 @@ public class UserCreator  implements IEntityCreator<User>{
                        CdmStore.getService(IUserService.class).createUser(user);
                        return user;
                } catch (AccessDeniedException e){
-                       BulkEditorUtil.errorDialog("Access denied", getClass(), e.getMessage(), e);
+                       MessagingUtils.messageDialog("Access denied", getClass(), e.getMessage(), e);
                        return null;
                }
        }
index 2ec26937c916b9a915e70b94089df5724ab7788a..aa65cdca82536139c78aaec3dc25ca665a37febd 100644 (file)
@@ -2,9 +2,10 @@
 <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/main/java/"/>
-       <classpathentry kind="src" path="src/main/resources/"/>
-       <classpathentry kind="src" path="src/test/java/"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="src" path="src/test/java"/>
+       <classpathentry kind="src" path="src/main/resources"/>
+       <classpathentry kind="src" path="src/test/resources"/>
        <classpathentry exported="true" kind="lib" path="lib/activation-1.1.1.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
@@ -50,7 +51,7 @@
        <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.8.3.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/commons-codec-20041127.091804.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar" sourcepath="lib/commons-dbcp-1.4-sources.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.2.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.2.2.RELEASE-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.2.2.RELEASE-sources.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.2.2.RELEASE.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.test-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.2.2.RELEASE-sources.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.2.2.RELEASE.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/osgi-3.6.0.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/h2mig_pagestore_addon.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>
-       <classpathentry kind="output" path="bin"/>
+       <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 5a7ae1ba65d0b4a22526703c7b339e179a274222..bd8e72267e0acf841e47c62a7ee2a28790d89596 100644 (file)
@@ -249,6 +249,7 @@ Export-Package: com.google.api,
  org.apache.lucene.util,
  org.apache.sanselan;uses:="org.apache.sanselan.common,org.apache.sanselan.common.byteSources",
  org.apache.xerces.dom,
+ org.eclipse.osgi.util,
  org.h2.jdbc,
  org.hamcrest,
  org.hibernate,
index 9fb167cc8644ced846238dee40784f7341832719..4cf488ee33f1a17bac6e7badc2adfac6cf54f75d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
index 25f118068392d39fda76feea6c855dfb3633db17..f131a431cbf20a8f2194c84912950bd3e0a6485b 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index 6e489f2d0f4334e5ac3233808930a399f218544c..756b8e24fbc30a15a53de282b30062fa77d41550 100644 (file)
@@ -5,7 +5,7 @@ Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
 Bundle-Version: 3.3.7.qualifier
 Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
+Bundle-Localization: OSGI-INF/l10n/plugin
 Export-Package: eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.editor.handler,
  eu.etaxonomy.taxeditor.editor.internal,
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
new file mode 100644 (file)
index 0000000..3f16773
--- /dev/null
@@ -0,0 +1,116 @@
+#Properties file for taxeditor-editor\r
+Bundle-Vendor.0 = EDIT\r
+Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
+command.name.17 = Set Basionym\r
+command.name.18 = Remove Basionym\r
+editor.name = Multipage Taxon Editor\r
+editor.name.0 = Taxon Name Editor\r
+editor.name.1 = Key\r
+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
+view.name = Factual Data\r
+view.name.0 = Uses\r
+view.name.1 = Media\r
+view.name.2 = Concept Relations\r
+view.name.3 = Concept Graph\r
+category.name = Taxonomic Editor\r
+command.label = Reference\r
+command.label.0 = Name\r
+command.label.1 = Team\r
+command.label.2 = Person\r
+command.label.3 = Specimen\r
+command.label.4 = Factual Data\r
+command.label.5 = Media\r
+command.label.6 = Concept\r
+command.label.7 = Concept Graph\r
+command.label.8 = Open Parent\r
+menu.label = New\r
+command.label.9 = Heterotypic Synonym\r
+command.label.10 = Homotypic Synonym\r
+command.label.11 = Synonym In Homotypical Group\r
+menu.label.0 = Change To\r
+command.label.12 = Accepted Taxon\r
+command.label.13 = Synonym\r
+command.label.14 = Misapplication\r
+command.label.15 = Delete\r
+command.label.16 = Delete All Empty Names\r
+command.label.17 = Swap Synonym With Accepted\r
+command.label.18 = Show Details\r
+command.label.19 = Save\r
+command.label.20 = New Node\r
+command.label.21 = Delete\r
+command.label.22 = Apply Layout\r
+command.label.23 = New Key Number\r
+command.label.24 = New Alternative\r
+command.label.25 = Refresh Nodes\r
+command.label.26 = Delete\r
+command.label.27 = New Factual Data\r
+menu.label.1 = New\r
+command.label.28 = Move Description to Taxon\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
+command.label.32 = New Use\r
+command.label.33 = New Use Summary\r
+command.label.34 = New Use Record\r
+command.label.35 = Delete\r
+command.label.36 = Save\r
+command.label.37 = New Image Gallery\r
+command.label.38 = New Image\r
+command.label.39 = Move Image Up In List\r
+command.label.40 = Move Image Down In List\r
+command.label.41 = Delete\r
+command.label.42 = Save\r
+menu.label.3 = New\r
+command.label.43 = Open Related Concept\r
+command.label.44 = Delete\r
+command.label.45 = Edit Authorities\r
+extension.name = Name Commands\r
+category.name.0 = -- Name Editor\r
+command.name = Open Parent\r
+command.name.0 = Create Homotypic Synonym\r
+command.name.1 = Create Heterotypic Synonym\r
+command.name.2 = Create Synonym In Homotypical Group\r
+command.name.3 = Change To Synonym\r
+command.name.4 = Change To Accepted Taxon\r
+command.name.5 = Change To Misapplication\r
+command.name.6 = Swap Synonym With Accepted\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
+category.name.1 = -- Factual\r
+command.name.10 = Create Description Element\r
+command.name.11 = New Description\r
+command.name.12 = Move Description Elements to Taxon\r
+command.name.13 = Move Description to Taxon\r
+category.name.2 = -- New Uses\r
+command.name.14 = New Use\r
+command.name.15 = New Use Summary\r
+command.name.16 = New Use Record\r
+category.name.3 = -- Media\r
+command.name.19 = Move Image Down In List\r
+command.name.20 = New Image Gallery\r
+command.name.21 = New Image\r
+command.name.22 = Move Image Up In List\r
+category.name.4 = -- New Entity\r
+command.name.23 = New Reference\r
+command.name.24 = New Name\r
+command.name.25 = New Team\r
+command.name.26 = New Person\r
+command.name.27 = New Specimen\r
+category.name.5 = -- Polytomous Keys\r
+command.name.28 = New Child Node\r
+command.name.29 = New Sibling Node\r
+command.name.30 = Refresh Node Numbering\r
+command.name.31 = Apply Layout\r
+category.name.6 = -- Concept Relations\r
+command.name.32 = Create Concept Relation\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
+scheme.description = The default key binding scheme for the Taxonomic Editor\r
+scheme.name = Taxonomic Editor Default Key Bindings
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties
new file mode 100644 (file)
index 0000000..09784a8
--- /dev/null
@@ -0,0 +1,116 @@
+# Properties file for taxeditor-editor
+Bundle-Vendor.0 = EDIT
+Bundle-Name.0 = EDIT Taxonomischer Editor - Editor Bundle
+command.name.17 = Setze Basionym
+command.name.18 = Entferne Basionym
+editor.name = Multipage Taxon Editor
+editor.name.0 = Editor Taxonname
+editor.name.1 = Bestimmungsschl\u00fcssel
+editor.name.2 = Polytomer Bestimmungsschl\u00fcssel Graph Editor
+editor.name.3 = Polytomer Bestimmungsschl\u00fcssel List Editor
+editor.name.4 = CDM Rechtemanagement
+editor.name.5 = Ansicht Derivate
+view.name = Faktendaten
+view.name.0 = Nutzung
+view.name.1 = Medien
+view.name.2 = Konzeptrelationen
+view.name.3 = Konzeptgraph
+category.name = Taxonomischer Editor
+command.label = Referenz
+command.label.0 = Name
+command.label.1 = Team
+command.label.2 = Person
+command.label.3 = Beleg
+command.label.4 = Faktendaten
+command.label.5 = Medien
+command.label.6 = Konzept
+command.label.7 = Konzeptgraph
+command.label.8 = \u00d6ffne Parent
+menu.label = Neue
+command.label.9 = Heterotypisches Synonym
+command.label.10 = Homotypisches Synonym
+command.label.11 = Synonym in Homotypischer Gruppe
+menu.label.0 = \u00c4ndere zu
+command.label.12 = Akzeptiertes Taxon
+command.label.13 = Synonym
+command.label.14 = Misapplication
+command.label.15 = L\u00f6schen
+command.label.16 = L\u00f6sche alle leeren Namen
+command.label.17 = Tausche Synonym mit akzeptiertem Namen
+command.label.18 = Zeige Details
+command.label.19 = Speichern
+command.label.20 = Neue Knoten
+command.label.21 = L\u00f6schen
+command.label.22 = Wende Layout an
+command.label.23 = Neue Bestimmungsschl\u00fcsselnummer
+command.label.24 = Neue Alternative
+command.label.25 = Erneuere Knoten
+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.30 = L\u00f6schen
+command.label.31 = Speichern
+menu.label.2 = Neue Derivate
+command.label.32 = Neue Nutzung
+command.label.33 = Neue Zusammenfassung
+command.label.34 = Neuer Nutzungsdatensatz
+command.label.35 = L\u00f6schen
+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.41 = L\u00f6schen
+command.label.42 = Speichern
+menu.label.3 = Neue
+command.label.43 = \u00d6ffne verbundenes Konzept
+command.label.44 = L\u00f6schen
+command.label.45 = Bearbeite Rechte
+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.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.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.11 = Neue Beschreibung
+command.name.12 = Bewege Beschreibungselement zu Taxon
+command.name.13 = Bewege Beschreibung zu Taxon
+category.name.2 = -- Neue Nutzung
+command.name.14 = Neue Nutzung
+command.name.15 = Neue Zusammenfassung
+command.name.16 = Neuer Nutzungsdatensatz
+category.name.3 = -- Media
+command.name.19 = Bewege Bild nach unten
+command.name.20 = Neue Bildergalerie
+command.name.21 = Neues Bild
+command.name.22 = Bewege Bild nach oben
+category.name.4 = -- Neue Entit\u00e4t
+command.name.23 = Neue Referenz
+command.name.24 = Neuer Name
+command.name.25 = Neues Team
+command.name.26 = Neue Person
+command.name.27 = Neuer Beleg
+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
+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
diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties
new file mode 100644 (file)
index 0000000..3f16773
--- /dev/null
@@ -0,0 +1,116 @@
+#Properties file for taxeditor-editor\r
+Bundle-Vendor.0 = EDIT\r
+Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
+command.name.17 = Set Basionym\r
+command.name.18 = Remove Basionym\r
+editor.name = Multipage Taxon Editor\r
+editor.name.0 = Taxon Name Editor\r
+editor.name.1 = Key\r
+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
+view.name = Factual Data\r
+view.name.0 = Uses\r
+view.name.1 = Media\r
+view.name.2 = Concept Relations\r
+view.name.3 = Concept Graph\r
+category.name = Taxonomic Editor\r
+command.label = Reference\r
+command.label.0 = Name\r
+command.label.1 = Team\r
+command.label.2 = Person\r
+command.label.3 = Specimen\r
+command.label.4 = Factual Data\r
+command.label.5 = Media\r
+command.label.6 = Concept\r
+command.label.7 = Concept Graph\r
+command.label.8 = Open Parent\r
+menu.label = New\r
+command.label.9 = Heterotypic Synonym\r
+command.label.10 = Homotypic Synonym\r
+command.label.11 = Synonym In Homotypical Group\r
+menu.label.0 = Change To\r
+command.label.12 = Accepted Taxon\r
+command.label.13 = Synonym\r
+command.label.14 = Misapplication\r
+command.label.15 = Delete\r
+command.label.16 = Delete All Empty Names\r
+command.label.17 = Swap Synonym With Accepted\r
+command.label.18 = Show Details\r
+command.label.19 = Save\r
+command.label.20 = New Node\r
+command.label.21 = Delete\r
+command.label.22 = Apply Layout\r
+command.label.23 = New Key Number\r
+command.label.24 = New Alternative\r
+command.label.25 = Refresh Nodes\r
+command.label.26 = Delete\r
+command.label.27 = New Factual Data\r
+menu.label.1 = New\r
+command.label.28 = Move Description to Taxon\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
+command.label.32 = New Use\r
+command.label.33 = New Use Summary\r
+command.label.34 = New Use Record\r
+command.label.35 = Delete\r
+command.label.36 = Save\r
+command.label.37 = New Image Gallery\r
+command.label.38 = New Image\r
+command.label.39 = Move Image Up In List\r
+command.label.40 = Move Image Down In List\r
+command.label.41 = Delete\r
+command.label.42 = Save\r
+menu.label.3 = New\r
+command.label.43 = Open Related Concept\r
+command.label.44 = Delete\r
+command.label.45 = Edit Authorities\r
+extension.name = Name Commands\r
+category.name.0 = -- Name Editor\r
+command.name = Open Parent\r
+command.name.0 = Create Homotypic Synonym\r
+command.name.1 = Create Heterotypic Synonym\r
+command.name.2 = Create Synonym In Homotypical Group\r
+command.name.3 = Change To Synonym\r
+command.name.4 = Change To Accepted Taxon\r
+command.name.5 = Change To Misapplication\r
+command.name.6 = Swap Synonym With Accepted\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
+category.name.1 = -- Factual\r
+command.name.10 = Create Description Element\r
+command.name.11 = New Description\r
+command.name.12 = Move Description Elements to Taxon\r
+command.name.13 = Move Description to Taxon\r
+category.name.2 = -- New Uses\r
+command.name.14 = New Use\r
+command.name.15 = New Use Summary\r
+command.name.16 = New Use Record\r
+category.name.3 = -- Media\r
+command.name.19 = Move Image Down In List\r
+command.name.20 = New Image Gallery\r
+command.name.21 = New Image\r
+command.name.22 = Move Image Up In List\r
+category.name.4 = -- New Entity\r
+command.name.23 = New Reference\r
+command.name.24 = New Name\r
+command.name.25 = New Team\r
+command.name.26 = New Person\r
+command.name.27 = New Specimen\r
+category.name.5 = -- Polytomous Keys\r
+command.name.28 = New Child Node\r
+command.name.29 = New Sibling Node\r
+command.name.30 = Refresh Node Numbering\r
+command.name.31 = Apply Layout\r
+category.name.6 = -- Concept Relations\r
+command.name.32 = Create Concept Relation\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
+scheme.description = The default key binding scheme for the Taxonomic Editor\r
+scheme.name = Taxonomic Editor Default Key Bindings
\ No newline at end of file
index 506d9dbd52bf5203ba7bd483baaf048d8fc74e78..91c9366ccd8cceb0e4822c88c9175f36bc7e8df9 100644 (file)
@@ -3,9 +3,11 @@ source.. = src/main/java/,\
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               plugin.properties,\
+               OSGI-INF/l10n/plugin.properties,\
                icons/,\
                p2.inf,\
+               OSGI-INF/l10n/plugin_de.properties,\
+               OSGI-INF/l10n/plugin_en.properties,\
                lib/biojava3-alignment-3.0.7.jar,\
                lib/biojava3-core-3.0.7.jar,\
                lib/core-1.8.5.jar,\
diff --git a/eu.etaxonomy.taxeditor.editor/plugin.properties b/eu.etaxonomy.taxeditor.editor/plugin.properties
deleted file mode 100644 (file)
index 090394d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#Properties file for taxeditor-editor\r
-Bundle-Vendor.0 = EDIT\r
-Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
-command.name.17 = Set Basionym\r
-command.name.18 = Remove Basionym
\ No newline at end of file
index 881d760a0c780791a56055d9f13edb8344aa3f83..1cd71ee2541b3c521d0f4a81631f5e9211b1ccc7 100644 (file)
            class="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor"
            icon="icons/edit_16x16.gif"
            id="eu.etaxonomy.taxeditor.editor.taxon"
-           name="Multipage Taxon Editor">
+           name="%editor.name">
          </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor"
             default="true"
             id="eu.etaxonomy.taxeditor.editor.taxon.name"
-            name="Taxon Name Editor">
+            name="%editor.name.0">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.key.KeyEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.key"
-            name="Key">
+            name="%editor.name.1">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.key.polytomous.graph"
-            name="Polytomous Key Graph Editor">
+            name="%editor.name.2">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.key.polytomous.list"
-            name="Polytomous Key List Editor">
+            name="%editor.name.3">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.group.authority"
-            name="Cdm Authority Editor">
+            name="%editor.name.4">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
             default="false"
             icon="icons/derivate_view-16x16-32.png"
             id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView"
-            name="Derivate View">
+            name="%editor.name.5">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor"
             name="Gbif Import Editor">
+      </editor>
+         <editor
+            class="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
+            icon="icons/address-book-new.png"
+            id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
+            name="Checklist Editor">
       </editor>
       <editor
             class="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
@@ -92,7 +98,7 @@
                class="eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart"
                icon="icons/address-book-new.png"
                id="eu.etaxonomy.taxeditor.editor.view.descriptive"
-               name="Factual Data"
+               name="%view.name"
                restorable="true">
          </view>
           <view
                 class="eu.etaxonomy.taxeditor.editor.view.uses.UsesViewPart"
                 icon="icons/leaf.png"
                 id="eu.etaxonomy.taxeditor.editor.view.uses"
-                name="Uses"
+                name="%view.name.0"
                 restorable="true">
          </view>
          <view
                class="eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart"
                icon="icons/camera-photo.png"
                id="eu.etaxonomy.taxeditor.editor.view.media"
-               name="Media"
+               name="%view.name.1"
                restorable="true">
          </view>
          <view
                category="eu.etaxonomy.taxeditor.editor.category"
                class="eu.etaxonomy.taxeditor.editor.view.concept.ConceptViewPart"
                id="eu.etaxonomy.taxeditor.editor.view.concept"
-               name="Concept Relations"
+               name="%view.name.2"
                restorable="true">
          </view>
          <view
                class="eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphView"
                icon="icons/address-book-new.png"
                id="eu.etaxonomy.taxeditor.editor.view.concept.graph"
-               name="Concept Graph"
+               name="%view.name.3"
                restorable="true">
          </view>
          <category
                id="eu.etaxonomy.taxeditor.editor.category"
-               name="Taxonomic Editor">
+               name="%category.name">
          </category>
       </extension>
    <extension
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.team"
-               label="Team"
+               label="%command.label.1"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.person"
-               label="Person"
+               label="%command.label.2"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.specimen"
-               label="Specimen"
+               label="%command.label.3"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Factual Data"
+               label="%command.label.4"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Media"
+               label="%command.label.5"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Concept"
+               label="%command.label.6"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Concept Graph"
+               label="%command.label.7"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
             locationURI="menu:org.eclipse.ui.main.menu.navigate">
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.openParent"
-               label="Open Parent"
+               label="%command.label.8"
                style="push">
          </command>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.taxon.name">
          <menu
-               label="New">
+               label="%menu.label">
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.createHeterotypicSynoym"
-                  label="Heterotypic Synonym"
+                  label="%command.label.9"
                   style="push">
                <visibleWhen>
                   <reference
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.createHomotypicSynoym"
-                  label="Homotypic Synonym"
+                  label="%command.label.10"
                   style="push">
                <visibleWhen>
                   <reference
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.createSynonymInHomotypicalGroup"
-                  label="Synonym In Homotypical Group"
+                  label="%command.label.11"
                   style="push">
                <visibleWhen>
                   <reference
                </visibleWhen>
          </command>-->
          <menu
-               label="Change To">
+               label="%menu.label.0">
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.changeToAcceptedTaxon"
-                  label="Accepted Taxon"
+                  label="%command.label.12"
                   style="push">
                <visibleWhen>
                   <not>
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.changeToSynonym"
-                  label="Synonym"
+                  label="%command.label.13"
                   style="push">
                <visibleWhen>
                   <not>
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.name.changeToMisapplication"
-                  label="Misapplication"
+                  label="%command.label.14"
                   style="push">
                <visibleWhen>
                   <not>
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.15"
                style="push">
             <visibleWhen>
                <or>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.name.deleteAllEmptyNames"
-               label="Delete All Empty Names"
+               label="%command.label.16"
                style="push">
             <visibleWhen>
                <reference
          </dynamic>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.name.swapSynonymAndAccepted"
-               label="Swap Synonym With Accepted"
+               label="%command.label.17"
                style="push">
             <visibleWhen>
                <reference
          </separator>
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Show Details"
+               label="%command.label.18"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
          </separator>
          <command
                commandId="org.eclipse.ui.file.save"
-               label="Save"
+               label="%command.label.19"
                style="push">
          </command>
       </menuContribution>
             locationURI="popup:eu.etaxonomy.taxeditor.editor.key.polytomous">
          <command
                commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new"
-               label="New Node"
+               label="%command.label.20"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.21"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.key.command.applyLayout"
-               label="Apply Layout"
+               label="%command.label.22"
                style="push">
          </command>
          <separator
             locationURI="popup:eu.etaxonomy.taxeditor.editor.key.polytomous.list">
          <command
                commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.child"
-               label="New Key Number"
+               label="%command.label.23"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.sibling"
-               label="New Alternative"
+               label="%command.label.24"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.key.polytomous.command.refresh"
-               label="Refresh Nodes"
+               label="%command.label.25"
                style="push">
          </command>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="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"
-               label="New Factual Data"
+               label="%command.label.27"
                style="push">
          </command>
          <separator
                visible="true">
          </separator>
          <menu
-               label="New">
+               label="%menu.label.1">
             <dynamic
                   class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DynamicFeatureMenu"
                   id="eu.etaxonomy.taxeditor.dynamicFeatureMenu">
          </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.commands.description.moveDescriptionToTaxon"
-               label="Move Description to Taxon"
+               label="%command.label.28"
                style="push">
             <visibleWhen
                   checkEnabled="true">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
-               label="Move Elements to Taxon"
+               label="%command.label.29"
                style="push">
             <visibleWhen
                   checkEnabled="true">
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.30"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="org.eclipse.ui.file.save"
-               label="Save"
+               label="%command.label.31"
                style="push">
          </command>
       </menuContribution>
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.uses">
          <command
                commandId="eu.etaxonomy.taxeditor.use.commands.adduse"
-               label="New Use"
+               label="%command.label.32"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.use.createUseSummary"
-               label="New Use Summary"
+               label="%command.label.33"
                style="push">
             <visibleWhen
                   checkEnabled="true">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
-               label="New Use Record"
+               label="%command.label.34"
                style="push">
             <visibleWhen
                   checkEnabled="true">
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.35"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="org.eclipse.ui.file.save"
-               label="Save"
+               label="%command.label.36"
                style="push">
          </command>
       </menuContribution>
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">
          <command
                commandId="taxeditor-editor.command.newimagegallery"
-               label="New Image Gallery"
+               label="%command.label.37"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="taxeditor-editor.newimage"
-               label="New Image"
+               label="%command.label.38"
                style="push">
             <visibleWhen>
                <reference
          </command>
          <command
                commandId="taxeditor-editor.command.moveimgdown"
-               label="Move Image Up In List"
+               label="%command.label.39"
                style="push">
             <visibleWhen>
                <reference
          </command>
          <command
                commandId="taxeditor-editor.command.moveimgup"
-               label="Move Image Down In List"
+               label="%command.label.40"
                style="push">
             <visibleWhen>
                <reference
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.41"
                style="push">
          </command>
          <command
                commandId="org.eclipse.ui.file.save"
-               label="Save"
+               label="%command.label.42"
                style="push">
          </command>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.concept">
          <menu
-               label="New">
+               label="%menu.label.3">
             <dynamic
                   class="eu.etaxonomy.taxeditor.editor.view.concept.handler.CreateConceptRelationMenu"
                   id="eu.etaxonomy.taxeditor.editor.view.concept.menus.new">
          </menu>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
-               label="Open Related Concept"
+               label="%command.label.43"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.44"
                style="push">
          </command>
       </menuContribution>
             locationURI="popup:#BulkEditorContext?before=taxeditor-bulkeditor.separator1">
          <command
                commandId="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
-               label="Edit Authorities"
+               label="%command.label.45"
                style="push">
             <visibleWhen>
                <reference
             </with>
          </activeWhen>
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler">
+      </handler>
    </extension>
    <extension
-         name="Name Commands"
+         name="%extension.name"
          point="org.eclipse.ui.commands">
       <category
             id="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
-            name="-- Name Editor">
+            name="%category.name.0">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenParentHandler"
             id="eu.etaxonomy.taxeditor.editor.command.openParent"
-            name="Open Parent">
+            name="%command.name">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateHomotypicSynonymHandler"
             id="eu.etaxonomy.taxeditor.editor.name.createHomotypicSynoym"
-            name="Create Homotypic Synonym">
+            name="%command.name.0">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateHeterotypicSynonymHandler"
             id="eu.etaxonomy.taxeditor.editor.name.createHeterotypicSynoym"
-            name="Create Heterotypic Synonym">
+            name="%command.name.1">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.CreateSynonymInHomotypicalGroupHandler"
             id="eu.etaxonomy.taxeditor.editor.name.createSynonymInHomotypicalGroup"
-            name="Create Synonym In Homotypical Group">
+            name="%command.name.2">
       </command>
      <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeToSynonymHandler"
             id="eu.etaxonomy.taxeditor.editor.name.changeToSynonym"
-            name="Change To Synonym">
+            name="%command.name.3">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeSynonymToAcceptedTaxonHandler"
             id="eu.etaxonomy.taxeditor.editor.name.changeToAcceptedTaxon"
-            name="Change To Accepted Taxon">
+            name="%command.name.4">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeToMisapplicationHandler"
             id="eu.etaxonomy.taxeditor.editor.name.changeToMisapplication"
-            name="Change To Misapplication">
+            name="%command.name.5">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.SwapSynonymAndAcceptedHandler"
             id="eu.etaxonomy.taxeditor.editor.name.swapSynonymAndAccepted"
-            name="Swap Synonym With Accepted">
+            name="%command.name.6">
       </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.setBasionym"
-            name="Set Basionym / Original Combination">
+            name="%command.name.7">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.RemoveBasionymHandler"
             id="eu.etaxonomy.taxeditor.editor.name.removeBasionym"
-            name="Remove Basionym / Original Combination">
+            name="%command.name.8">
       </command>
      <!-- <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.DeleteAllEmptyNamesHandler"
             id="eu.etaxonomy.taxeditor.editor.name.deleteAllEmptyNames"
-            name="Delete All Empty Names">
+            name="%command.name.9">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
-            name="-- Factual">
+            name="%category.name.1">
       </category>
       <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"
-            name="Create Description Element">
+            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"
-            name="New Description">
+            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="Move Description Elements to Taxon">
+            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="Move Description to Taxon">
+            name="%command.name.13">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
-            name="-- New Uses">
+            name="%category.name.2">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseHandler"
             id="eu.etaxonomy.taxeditor.use.commands.adduse"
-            name="New Use">
+            name="%command.name.14">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseSummaryHandler"
             id="eu.etaxonomy.taxeditor.editor.use.createUseSummary"
-            name="New Use Summary">
+            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="New Use Record">
+            name="%command.name.16">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.media.category"
-            name="-- Media">
+            name="%category.name.3">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.media.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.MoveImageDownInListHandler"
             id="taxeditor-editor.command.moveimgdown"
-            name="Move Image Down In List">
+            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"
-            name="New Image Gallery">
+            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"
-            name="New Image">
+            name="%command.name.21">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.media.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.media.handler.MoveImageUpInListHandler"
             id="taxeditor-editor.command.moveimgup"
-            name="Move Image Up In List">
+            name="%command.name.22">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.new.category"
-            name="-- New Entity">
+            name="%category.name.4">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewReferenceHandler"
             id="eu.etaxonomy.taxeditor.editor.command.new.reference"
-            name="New Reference">
+            name="%command.name.23">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewNameHandler"
             id="eu.etaxonomy.taxeditor.editor.command.new.name"
-            name="New Name">
+            name="%command.name.24">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewTeamHandler"
             id="eu.etaxonomy.taxeditor.editor.command.new.team"
-            name="New Team">
+            name="%command.name.25">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewPersonHandler"
             id="eu.etaxonomy.taxeditor.editor.command.new.person"
-            name="New Person">
+            name="%command.name.26">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.create.NewSpecimenHandler"
             id="eu.etaxonomy.taxeditor.editor.command.new.specimen"
-            name="New Specimen">
+            name="%command.name.27">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.key.category"
-            name="-- Polytomous Keys">
+            name="%category.name.5">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.key.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.CreateChildNodeHandler"
             id="eu.etaxonomy.taxeditor.key.polytomous.command.new.child"
-            name="New Child Node">
+            name="%command.name.28">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.key.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.CreateSiblingNodeHandler"
             id="eu.etaxonomy.taxeditor.key.polytomous.command.new.sibling"
-            name="New Sibling Node">
+            name="%command.name.29">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.key.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.RefreshNodeNumberingHandler"
             id="eu.etaxonomy.taxeditor.key.polytomous.command.refresh"
-            name="Refresh Node Numbering">
+            name="%command.name.30">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.key.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.key.handler.ApplyLayoutHandler"
             id="eu.etaxonomy.taxeditor.key.command.applyLayout"
-            name="Apply Layout">
+            name="%command.name.31">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.editor.view.concept.category"
-            name="-- Concept Relations">
+            name="%category.name.6">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.CreateConceptRelationHandler"
             id="eu.etaxonomy.taxeditor.editor.name.createConceptRelation"
-            name="Create Concept Relation">
+            name="%command.name.32">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.concept.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.concept.handler.OpenRelatedConceptHandler"
             id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
-            name="Open Related Concept">
+            name="%command.name.33">
       </command>
       <category
             id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
-            name="-- Group">
+            name="%category.name.7">
       </category>
       <command
             categoryId="eu.etaxonomy.taxeditor.bulkeditor.group.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.group.authority.handler.EditCdmAuthoritiesHandler"
             id="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
-            name="Edit CDM Authorities">
+            name="%command.name.34">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenDerivateViewHandler"
             id="eu.etaxonomy.taxeditor.editor.handler.openDerivateView"
-            name="Open Derivate View">
+            name="%command.name.35">
+      </command>
+       <command
+             defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
+             id="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
+             name="Open Checklist Editor">
       </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
    <extension
          point="org.eclipse.ui.bindings">   
       <scheme
-            description="The default key binding scheme for the Taxonomic Editor"
+            description="%scheme.description"
             id="eu.etaxonomy.taxeditor.bindings.scheme.default"
-            name="Taxonomic Editor Default Key Bindings">
+            name="%scheme.name">
       </scheme>
    </extension>
     <extension
index 85682be0d7da937d03ddd956369beee9089a2541..96defc84558233c846ee0f7906dface98f9f5d21 100644 (file)
@@ -25,6 +25,7 @@ import eu.etaxonomy.taxeditor.editor.view.concept.ConceptViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 
 /**
@@ -140,7 +141,7 @@ public class EditorStateManager extends ContextListenerAdapter {
                                try {
                                        EditorUtil.open(input);
                                } catch (PartInitException e) {
-                                       EditorUtil.error(getClass(), "Error opening an editor window", e);
+                                       MessagingUtils.error(getClass(), "Error opening an editor window", e);
                                }
                        }
                        subProgressMonitor.worked(1);
index 5a207f501b8522c2c240d769194dda7868094b00..4ed9313d32cf8063e44cccad67ca856f13df9eb9 100644 (file)
@@ -37,6 +37,8 @@ import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
 import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor;
 import eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditorInput;
@@ -105,6 +107,17 @@ public class EditorUtil extends AbstractUtility {
            open(input, DerivateView.ID);
        }
 
+
+       /**
+        * Opens a new ChecklistView for the given input
+        * @param input a {@link ChecklistEditorInput} representing the selected checklist
+        * @throws PartInitException
+        */
+       public static void open(ChecklistEditorInput input)
+               throws PartInitException {
+           open(input, ChecklistEditor.ID);
+       }
+
        /**
         * Opens a new AlignmentEditor for the given input
         * @param input
index 4c79beba15d2496ae841f3829d5a3e4c2bc97d9c..a55a03de33824865111ca34a73e4c317c899628a 100644 (file)
@@ -38,6 +38,7 @@ import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 /**
@@ -109,7 +110,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
                        // EditorUtil.showPropertySheet();
 
                } catch (PartInitException e) {
-                       AbstractUtility.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
        }
 
@@ -142,10 +143,10 @@ public class MultiPageTaxonEditor extends FormEditor implements
                        monitor.worked(1);
 
             this.setDirty(false);
-            monitor.worked(1);
+            monitor.worked(1);            
         } catch (Exception e) {
             setFocus();
-            AbstractUtility.dialogForAbortedOperation(e, this, "saving a taxon", " Please close and reopen the taxon again.");
+            MessagingUtils.operationDialog(this, e, "saving a taxon", " Please close and reopen the taxon again.");
             disableEditor(true);
         } finally {
             monitor.done();
@@ -416,10 +417,10 @@ public class MultiPageTaxonEditor extends FormEditor implements
             if (editor instanceof IPostOperationEnabled) {
                 ((IPostOperationEnabled) editor).postOperation(objectAffectedByOperation);
             } else {
-                AbstractUtility.warn(getClass(), "postOperation not enabled for editor " + editor);
+                MessagingUtils.warn(getClass(), "postOperation not enabled for editor " + editor);
             }
         }
-        AbstractUtility.warn(getClass(), "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
+        MessagingUtils.warn(getClass(), "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
 
         return false;
     }
@@ -499,7 +500,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
      */
     public void reload() {
         if (isDirty()) {
-            AbstractUtility.warningDialog("Editor has unsaved data", getClass(), "This editor can not be "
+            MessagingUtils.warningDialog("Editor has unsaved data", getClass(), "This editor can not be "
                     + "refreshed because it contains unsaved data. Refreshing "
                     + "this editor would discard the changes. Please save this editor, "
                     + "close and reopen it manually in order to get the latest content");
@@ -517,7 +518,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
                     editorPart.redraw();
                 }
             } catch (Exception e) {
-                AbstractUtility.errorDialog("Error refreshing editor", getClass(), "Could not refresh this editor", e);
+                MessagingUtils.messageDialog("Error refreshing editor", getClass(), "Could not refresh this editor", e);
             }
         }
     }
index 2dfc5b7d6391e90d7f770b4a7a24a51e1aa7b94d..b331b88f5d9ffd68c6809371900c98d2d7e1d91b 100644 (file)
@@ -34,6 +34,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.DataChangeBridge;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -90,7 +91,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, null);
 
                if(taxonNode == null){
-                       EditorUtil.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
+                       MessagingUtils.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
                        return null;
                }
 
@@ -111,14 +112,14 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
        if (taxonBase != null){
                if(taxonBase.isOrphaned()) {
-                       EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
+                       MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
                }
                else if(taxonBase.isInstanceOf(Taxon.class)){
                        Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
        
                        if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){
                                // TODO get accepted taxon
-                               EditorUtil.info("trying to open Mispplied Name ");
+                               MessagingUtils.info("trying to open Mispplied Name ");
        
                                Set<Taxon> acceptedTaxa = new HashSet<Taxon>();
                                Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon();
@@ -158,7 +159,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                        }
                }else if(taxonNodes.size() == 0){
                        // this is an undesired state
-                       EditorUtil.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
+                       MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
                }
        return null;
     }
@@ -176,7 +177,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                        return getInputForMultipleNodes(conversation, taxonNodes);
                }else if(taxa.size() == 0){
                        // this is an undesired state
-                       EditorUtil.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
+                       MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
                                        " no accepted taxa are present. This should not have happened.");
                }
        return null;
index c5457f4d17374f3a6465f9bedfd2424bb57e1d48..7ee5da308126a8864268d581e962e0d0dfbc026f 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.ui.IElementFactory;
 import org.eclipse.ui.IMemento;
 
 import eu.etaxonomy.cdm.api.service.IClassificationService;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 
@@ -51,13 +52,13 @@ public class TaxonEditorInputFactory implements IElementFactory {
                return null;
         }
         if (taxonNodeUuid == null || CdmStore.getService(IClassificationService.class).getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
-               EditorUtil.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid);
+               MessagingUtils.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid);
                return null;
         }
         try {
                        return TaxonEditorInput.NewInstance(UUID.fromString(taxonNodeUuid));
                } catch (Exception e) {
-                       EditorUtil.warningDialog("Could not create element", TaxonEditorInputFactory.class, e.getMessage());
+                       MessagingUtils.warningDialog("Could not create element", TaxonEditorInputFactory.class, e.getMessage());
                }
                return null;
        }       
index d22a6a60930e1ea4a290bacb0cd111015f7736f4..bbfd588007c9957feec1a74296d26879cb141cc2 100644 (file)
@@ -27,8 +27,8 @@ import eu.etaxonomy.cdm.model.description.FeatureNode;
 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.StoreUtil;\r
 \r
 /**\r
  * The context listener will call this class when the uses view is being loaded.\r
@@ -47,7 +47,7 @@ public class UseObjectManager extends ContextListenerAdapter{
        @Override\r
        public void contextRefresh(IProgressMonitor monitor) {\r
                monitor.subTask("Refreshing the Uses View");\r
-               StoreUtil.warn(getClass(), "Refreshing Uses View warn");\r
+               MessagingUtils.warn(getClass(), "Refreshing Uses View warn");\r
                setupNecessaryItems(monitor);\r
        }\r
 \r
@@ -55,7 +55,7 @@ public class UseObjectManager extends ContextListenerAdapter{
        @Override\r
        public void contextStart(IMemento memento, IProgressMonitor monitor) {\r
                monitor.subTask("Starting the Uses View");\r
-               StoreUtil.warn(getClass(), "Starting Uses View warn");\r
+               MessagingUtils.warn(getClass(), "Starting Uses View warn");\r
                setupNecessaryItems(monitor);\r
        }\r
 \r
index b82a717a45b728aee16a7a65a07264b68cb1d4fa..a68fda35cff9b852b64089547f821bffd06e0a13 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -10,12 +10,13 @@ package eu.etaxonomy.taxeditor.editor.group.authority;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.EditorPart;
-import org.eclipse.swt.layout.FillLayout;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
@@ -26,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityCompositeVie
 
 /**
  * Editor responsible for editing authorities related to a particular {@link Group} entity.
- * 
+ *
  * @author cmathew
  * @created Mar 28, 2013
  *
@@ -38,9 +39,9 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        private boolean dirty;
        private ConversationHolder conversation;
        private CdmAuthorityCompositeViewer viewer;
-       
-       public CdmAuthorityEditor() {                   
-               
+
+       public CdmAuthorityEditor() {
+
        }
 
        /**
@@ -51,11 +52,11 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        public void createPartControl(Composite parent) {
                Composite container = new Composite(parent, SWT.NONE);
                container.setLayout(new FillLayout(SWT.HORIZONTAL));
-               
+
                this.viewer = new CdmAuthorityCompositeViewer(container, this,((CdmAuthorityEditorInput) getEditorInput()).getGroup());
 
                conversation = ((CdmAuthorityEditorInput) getEditorInput()).getConversationHolder();
-               setPartName(getEditorInput().getName());                        
+               setPartName(getEditorInput().getName());
 
        }
 
@@ -64,7 +65,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
         */
        @Override
        public void setFocus() {
-       
+           PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
        }
 
        /* (non-Javadoc)
@@ -74,7 +75,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        public void doSave(IProgressMonitor monitor) {
                try {
                        monitor.beginTask("Saving CDM Authority Editor", 1);
-                       getConversationHolder().commit(true);                   
+                       getConversationHolder().commit(true);
                        dirty = false;
                        firePropertyChange(PROP_DIRTY);
                        monitor.worked(1);
@@ -100,7 +101,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
                        throws PartInitException {
                setSite(site);
                setInput(input);
-       }       
+       }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.EditorPart#isDirty()
@@ -124,7 +125,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        @Override
        public void update(CdmDataChangeMap changeEvents) {
                // TODO Auto-generated method stub
-               
+
        }
 
        /* (non-Javadoc)
@@ -132,18 +133,18 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
         */
        @Override
        public void changed(Object element) {
-               //FIXME : should be optimised to split changes into adding / removing authorities 
+               //FIXME : should be optimised to split changes into adding / removing authorities
                //        vs updating authorites
                dirty = viewer.isDirty();
                firePropertyChange(PROP_DIRTY);
                // if the change has happened on the group then refresh the table
                if(element instanceof Group) {
-                       
+
                        //FIXME: activating (setting focus) on the editor happens on every change
                        //       This should be changed to only when the drop is successful
                        getSite().getPage().activate(this);
                }
-               
+
        }
 
        /* (non-Javadoc)
@@ -153,10 +154,10 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        public ConversationHolder getConversationHolder() {
                return conversation;
        }
-       
+
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
         */
        @Override
index 3d1940a643e96cc00e7b34655e3b168059b52a27..71a9b0c77eda800adaba84c2230f22bb815c730d 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
 import eu.etaxonomy.taxeditor.model.LineSelection;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 
 /**
@@ -63,7 +64,7 @@ public class EditCdmAuthoritiesHandler  extends AbstractHandler {
                                                                        try {
                                                                                EditorUtil.openCdmAuthorities(((Group)selectedObject).getUuid());
                                                                        } catch (Exception e) {
-                                                                               EditorUtil.warningDialog("Could not open CDM Authority Editor", EditorUtil.class, e.getMessage());
+                                                                               MessagingUtils.warningDialog("Could not open CDM Authority Editor", EditorUtil.class, e.getMessage());
                                                                        }
                                                                }
                                                                
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java
new file mode 100644 (file)
index 0000000..cc2bbf0
--- /dev/null
@@ -0,0 +1,65 @@
+package eu.etaxonomy.taxeditor.editor.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.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+public class OpenChecklistEditorHandler extends AbstractHandler {
+
+    private static final Logger logger = Logger.getLogger(OpenChecklistEditorHandler.class);
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+     * ExecutionEvent)
+     */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        boolean isChecklistEditorActivated = PreferencesUtil.getPreferenceStore().getBoolean(
+                IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
+        if (isChecklistEditorActivated) {
+            ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+            if (currentSelection instanceof IStructuredSelection) {
+                Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
+                if (selectedElement instanceof Classification) {
+                    ChecklistEditorInput input = new ChecklistEditorInput(((Classification) selectedElement));
+                    try {
+                        EditorUtil.open(input);
+                    } catch (PartInitException e) {
+                       MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+                    } catch (NullPointerException npe) {
+                       MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
+                                "Could not open ChecklistView. The hierarchy is corrupted!", npe);
+                    }
+                } else if (selectedElement instanceof TaxonNode) {
+                    ChecklistEditorInput input = new ChecklistEditorInput(((TaxonNode) selectedElement));
+                    try {
+                        EditorUtil.open(input);
+                    } catch (PartInitException e) {
+                       MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+                    } catch (NullPointerException npe) {
+                       MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
+                                "Could not open ChecklistView. The hierarchy is corrupted!", npe);
+                    }
+                }
+            }
+        }
+        return null;
+    }
+}
index a718ba5b0b80cc2212beac33bdfe26ab89e1caa2..d6f0df7e6295919e1ff516db44d7c115dfe021f8 100644 (file)
@@ -11,7 +11,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 public class OpenDerivateViewHandler extends AbstractHandler {
 
@@ -29,9 +29,9 @@ public class OpenDerivateViewHandler extends AbstractHandler {
                 try {
                     EditorUtil.open(input);
                 } catch (PartInitException e) {
-                    AbstractUtility.error(OpenDerivateViewHandler.class, "Could not open DerivateView", e);
+                    MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open DerivateView", e);
                 } catch (NullPointerException npe){
-                    AbstractUtility.errorDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open DerivateView. The derivate hierarchy is corrupted!", npe);
+                    MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open DerivateView. The derivate hierarchy is corrupted!", npe);
                 }
             }
         }
index 2b562ca0072ca8d302ce3ad06faa8fe574168ac0..f8e3350a48f83acd44238c49237e91cc0a0c5dd8 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.ui.PartInitException;
 
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>OpenParentHandler class.</p>
@@ -41,7 +42,7 @@ public class OpenParentHandler extends AbstractHandler implements IHandler {
                        } catch (PartInitException e) {
                                throw new RuntimeException("Error opening parent taxon", e);
                        } catch (Exception e) {
-                               EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+                               MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                        }
                }
                
index 0886e1fc27b6b841140217c1064a5071fcb463c5..51b81499f6f5afef860297b04345e4d8e1a4167b 100644 (file)
@@ -19,12 +19,12 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
 import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * @author n.hoffmann
@@ -192,7 +192,7 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
                        addPage(1, new PolytomousKeyGraphEditor(this), input);
                        setPageText(1, "Graph");
                } catch (PartInitException e) {
-                       EditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
 
                
index 35015c699ab22979a35eff8cf67fbbd73385bd56..5ef5246d8239befe0ff06b5ddb3f86e8d4ef97b5 100644 (file)
@@ -46,6 +46,7 @@ import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * @author n.hoffmann
@@ -88,7 +89,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
                                try {
                                    EditorUtil.openTaxonBase((taxon).getUuid());
                                } catch (PartInitException e) {
-                                   EditorUtil.error(getClass(), e);
+                                   MessagingUtils.error(getClass(), e);
                                }
                            }
                        }
index c65115942dc472a742ae4d7307320a949b1b97ce..e9df7653e513c966c10a8fbbedaf35d366ba6f4c 100644 (file)
@@ -20,6 +20,7 @@ import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 /**
@@ -57,7 +58,7 @@ public class CreateChildNodeHandler extends AbstractHandler {
                                    label, undoContext, pk.getRoot(), editorPage);
                            EditorUtil.executeOperation(operation);
                        } catch (NotDefinedException e) {
-                           EditorUtil.warn(getClass(), "Command name not set.");
+                           MessagingUtils.warn(getClass(), "Command name not set.");
                        }
                    } else {
 
@@ -76,7 +77,7 @@ public class CreateChildNodeHandler extends AbstractHandler {
                                        label, undoContext, keyNode, editorPage);
                                EditorUtil.executeOperation(operation);
                            } catch (NotDefinedException e) {
-                               EditorUtil.warn(getClass(), "Command name not set.");
+                               MessagingUtils.warn(getClass(), "Command name not set.");
                            }
                        } else {
                            MessageDialog.openInformation(
index 74cd04b4af2722847a136cf5504e4450ca78a17e..f0c00125aaf61fb3cc668e18af5c8642dfe5ad92 100644 (file)
@@ -17,6 +17,7 @@ import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 /**
@@ -60,7 +61,7 @@ public class CreateSiblingNodeHandler extends AbstractHandler {
                                                                label, undoContext, keyNode.getParent(), editorPage);
                                                EditorUtil.executeOperation(operation);
                                        } catch (NotDefinedException e) {
-                                               EditorUtil.warn(getClass(), "Command name not set.");
+                                               MessagingUtils.warn(getClass(), "Command name not set.");
                                        }
                                } else {
                                        MessageDialog.openInformation(
index b027da92a995a67d4bda5c35ac5da9d9426790cb..f65f3fdc455c9b7e83959049037b0a5af03154e5 100644 (file)
@@ -25,6 +25,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.DeleteNodeOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 /**
@@ -66,7 +67,7 @@ public class DeleteNodeHandler extends AbstractHandler {
                                        }
 
                                } catch (NotDefinedException e) {
-                                       EditorUtil.warn(getClass(), "Command name not set.");
+                                       MessagingUtils.warn(getClass(), "Command name not set.");
                                }
                        } else {
                        MessageDialog.openInformation(
index 9ba957882b5e2600fa0485aab6ddce9a6b1aace0..e077a60ae26de5de8bd7abf893cddef5fb8cb889 100644 (file)
@@ -17,6 +17,7 @@ import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RefreshNodeNumberingOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 public class RefreshNodeNumberingHandler extends AbstractHandler {
@@ -46,7 +47,7 @@ public class RefreshNodeNumberingHandler extends AbstractHandler {
                                                                label, undoContext, keyNode, editorPage);
                                                EditorUtil.executeOperation(operation);
                                        } catch (NotDefinedException e) {
-                                               EditorUtil.warn(getClass(), "Command name not set.");
+                                               MessagingUtils.warn(getClass(), "Command name not set.");
                                        }
                                } 
                        }
index 492e597fb1621aacefb488728c06fe5aacbdbc36..8f1921f382ee69ba8e72effc689946fd33d0067e 100644 (file)
@@ -1,8 +1,8 @@
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -16,7 +16,6 @@ import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.jface.action.MenuManager;
@@ -36,6 +35,7 @@ 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;
@@ -67,10 +67,10 @@ import eu.etaxonomy.taxeditor.editor.name.container.ContainerFactory;
 import eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup;
 import eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup;
 import eu.etaxonomy.taxeditor.editor.name.dnd.NameEditorDropTargetListener;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IPartChangeListener;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.TaxeditorPartService;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.security.RequiredPermissions;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -80,15 +80,15 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * <p>
  * TaxonNameEditor class.
  * </p>
- * 
+ *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 15.05.2008
  * @version 1.0
  */
 public class TaxonNameEditor extends EditorPart implements
-               IMultiPageTaxonEditorPage, IAdaptable, IConversationEnabled,
-               IPostOperationEnabled, IPartContentHasDetails, IPartChangeListener,
+               IMultiPageTaxonEditorPage, IConversationEnabled,
+               IPartContentHasDetails, IPartChangeListener,
                ISelectionListener, IDropTargetable, ISecuredEditor {
 
        /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon.name"</code> */
@@ -124,7 +124,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Constructor for TaxonNameEditor.
         * </p>
-        * 
+        *
         * @param editor
         *            a {@link eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor}
         *            object.
@@ -138,7 +138,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getUndoContext
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.core.commands.operations.IUndoContext}
         *         object.
         */
@@ -148,7 +148,7 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
         * .Composite)
@@ -169,7 +169,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * createManagedForm
         * </p>
-        * 
+        *
         * @param composite
         *            a {@link org.eclipse.swt.widgets.Composite} object.
         */
@@ -191,8 +191,8 @@ public class TaxonNameEditor extends EditorPart implements
                                        selection = null;
                                        getSite().getSelectionProvider().setSelection(new StructuredSelection());
                                }
-                               
-                               
+
+
                                return super.setInput(input);
                        }
                };
@@ -218,7 +218,7 @@ public class TaxonNameEditor extends EditorPart implements
                layout.horizontalSpacing = 0;
 
                parent.setLayout(layout);
-               parent.setBackground(EditorUtil
+               parent.setBackground(AbstractUtility
                                .getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
 
                createOrUpdateNameComposites();
@@ -247,7 +247,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Getter for the field <code>taxon</code>.
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
         */
        public Taxon getTaxon() {
@@ -265,18 +265,19 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
         */
        /** {@inheritDoc} */
        @Override
        public void setFocus() {
+           PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setFocus();
                if (getSelectedContainer() == null) {
                        throw new IllegalStateException(
                                        "There should always be a selected object.");
                }
                getSelectedContainer().setSelected();
-               
+
                // check permissions
                boolean doEnable = permissionsSatisfied();
                setEnabled(doEnable);
@@ -300,7 +301,7 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
         * ()
@@ -309,41 +310,45 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                return conversation;
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu
         * .etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
         */
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap events) {
+       @Override
+    public void update(CdmDataChangeMap events) {
                // redraw();
        }
 
        /**
         * Redraws this editor return true on success
-        * 
+        *
         * @return a boolean.
         */
-       public boolean redraw() {
+       @Override
+    public boolean redraw() {
                return redraw(true);
        }
 
        /**
         * {@inheritDoc}
-        * 
+        *
         * Redraws the editor controls
         */
-       public boolean redraw(boolean focus) {
+       @Override
+    public boolean redraw(boolean focus) {
 
                createOrUpdateNameComposites();
 
@@ -358,7 +363,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getMultiPageTaxonEditor
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor}
         *         object.
         */
@@ -368,16 +373,17 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation
         * ()
         */
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
 
                editor.changed(objectAffectedByOperation);
-               
+
                redraw(false);
 
                if (objectAffectedByOperation instanceof TaxonBase) {
@@ -391,7 +397,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Getter for the field <code>managedForm</code>.
         * </p>
-        * 
+        *
         * @return the managedForm
         */
        public ManagedForm getManagedForm() {
@@ -402,10 +408,11 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getControl
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.swt.widgets.Composite} object.
         */
-       public Composite getControl() {
+       @Override
+    public Composite getControl() {
                return this.getManagedForm().getForm().getBody();
        }
 
@@ -413,7 +420,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Getter for the field <code>menu</code>.
         * </p>
-        * 
+        *
         * @return the menu
         */
        public Menu getMenu() {
@@ -429,7 +436,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * checkForEmptyNames
         * </p>
-        * 
+        *
         * @return true if there are empty names
         */
        public boolean checkForEmptyNames() {
@@ -495,8 +502,9 @@ public class TaxonNameEditor extends EditorPart implements
        public void init(IEditorSite site, IEditorInput input)
                        throws PartInitException {
 
-               if (!(input instanceof IEditorInput))
-                       throw new PartInitException("Invalid Input: Must be IEditorInput");
+               if (!(input != null)) {
+            throw new PartInitException("Invalid Input: Must be IEditorInput");
+        }
 
                if (input.getAdapter(Taxon.class) != null) {
                        taxon = (Taxon) input.getAdapter(Taxon.class);
@@ -513,7 +521,7 @@ public class TaxonNameEditor extends EditorPart implements
 
 
        /**
-        * 
+        *
         */
        private void createDragSupport() {
                // Listen for names being dragged outside of existing homotypic groups -
@@ -531,7 +539,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Getter for the field <code>acceptedNameContainer</code>.
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.taxeditor.editor.name.container.AcceptedNameContainer}
         *         object.
@@ -544,7 +552,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getSynonymGroup
         * </p>
-        * 
+        *
         * @param homotypicalGroup
         *            a {@link eu.etaxonomy.cdm.model.name.HomotypicalGroup} object.
         * @return a
@@ -566,7 +574,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getDirtyNames
         * </p>
-        * 
+        *
         * @return a Set containing all composites that have been edited
         */
        public Set<AbstractGroupedContainer> getDirtyNames() {
@@ -585,7 +593,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getGroupedContainers
         * </p>
-        * 
+        *
         * @return a {@link java.util.List} object.
         */
        public List<AbstractGroupedContainer> getGroupedContainers() {
@@ -602,7 +610,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getAllGroups
         * </p>
-        * 
+        *
         * @return a {@link java.util.List} object.
         */
        public List<AbstractGroup> getAllGroups() {
@@ -611,9 +619,9 @@ public class TaxonNameEditor extends EditorPart implements
                allGroups.add(getAcceptedGroup());
 
 //             List<HomotypicalSynonymGroup> grps = getHeterotypicSynonymGroups(); // UNUSED => remove
-               
+
                heterotypicSynonymGroups = getHeterotypicSynonymGroups();
-               
+
                if (heterotypicSynonymGroups != null) {
                        allGroups.addAll(heterotypicSynonymGroups);
                }
@@ -627,7 +635,7 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#isDirty()
         */
        /** {@inheritDoc} */
@@ -638,7 +646,7 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.WorkbenchPart#dispose()
         */
        /** {@inheritDoc} */
@@ -649,7 +657,7 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
         */
        /** {@inheritDoc} */
@@ -660,12 +668,13 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
         * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
         */
        /** {@inheritDoc} */
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+       @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
 
        }
 
@@ -673,11 +682,12 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getNameEditor
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor}
         *         object.
         */
-       public TaxonNameEditor getEditor() {
+       @Override
+    public TaxonNameEditor getEditor() {
                return this;
        }
 
@@ -685,7 +695,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Getter for the field <code>selectedObject</code>.
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer}
         *         object.
@@ -712,10 +722,11 @@ public class TaxonNameEditor extends EditorPart implements
         * dragEntered
         * </p>
         */
-       public void dragEntered() {
+       @Override
+    public void dragEntered() {
                // TODO change this
                getControl().setBackground(
-                               EditorUtil.getColor(Resources.COLOR_DRAG_ENTER));
+                               AbstractUtility.getColor(Resources.COLOR_DRAG_ENTER));
        }
 
        /**
@@ -723,9 +734,10 @@ public class TaxonNameEditor extends EditorPart implements
         * dragLeft
         * </p>
         */
-       public void dragLeft() {
+       @Override
+    public void dragLeft() {
                getControl().setBackground(
-                               EditorUtil.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
+                               AbstractUtility.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
        }
 
 
@@ -733,7 +745,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * setMisapplicationsGroup
         * </p>
-        * 
+        *
         * @param misappliedGroup
         *            a
         *            {@link eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup}
@@ -745,7 +757,7 @@ public class TaxonNameEditor extends EditorPart implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#isRedrawing()
         */
@@ -753,10 +765,11 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * isRedrawing
         * </p>
-        * 
+        *
         * @return a boolean.
         */
-       public boolean isRedrawing() {
+       @Override
+    public boolean isRedrawing() {
                return false;
        }
 
@@ -764,7 +777,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getToolkit
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.ui.forms.widgets.FormToolkit} object.
         */
        public FormToolkit getToolkit() {
@@ -775,7 +788,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getHeterotypicSynonymGroups
         * </p>
-        * 
+        *
         * @return a {@link java.util.List} object.
         */
        public List<HomotypicalSynonymGroup> getHeterotypicSynonymGroups() {
@@ -786,7 +799,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * addHeterotypicSynonymGroup
         * </p>
-        * 
+        *
         * @param group
         *            a
         *            {@link eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup}
@@ -800,7 +813,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * getHomotypicSynonymGroup
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup}
         *         object.
@@ -810,7 +823,7 @@ public class TaxonNameEditor extends EditorPart implements
        }
 
        /**
-        * 
+        *
         * @param acceptedGroup
         */
        public void setAcceptedGroup(AcceptedGroup acceptedGroup) {
@@ -821,7 +834,7 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * Getter for the field <code>misappliedGroup</code>.
         * </p>
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup}
         *         object.
@@ -835,11 +848,11 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * isActive
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public boolean isActive() {
-               IWorkbenchPart activePart = EditorUtil.getActivePart();
+               IWorkbenchPart activePart = AbstractUtility.getActivePart();
                return editor.equals(activePart);
        }
 
@@ -847,16 +860,18 @@ public class TaxonNameEditor extends EditorPart implements
         * <p>
         * onComplete
         * </p>
-        * 
+        *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                getContainer(objectAffectedByLastOperation).setSelected();
                return true;
        }
 
        /** {@inheritDoc} */
-       public void partChanged(Integer eventType, IWorkbenchPartReference partRef) {
+       @Override
+    public void partChanged(Integer eventType, IWorkbenchPartReference partRef) {
                if (!partRef.getPart(false).equals(editor)) {
                        // getSelectedObject().colorSelected(AbstractGroupedContainer.SELECTED_NO_FOCUS);
                }
@@ -868,7 +883,7 @@ public class TaxonNameEditor extends EditorPart implements
        public void removeGroup(AbstractGroup group) {
                if (group != null) {
                        group.dispose();
-                       
+
                        //if (heterotypicSynonymGroups != null) {
                        heterotypicSynonymGroups.remove(group);
                        //}
@@ -889,12 +904,13 @@ public class TaxonNameEditor extends EditorPart implements
                }
                return getAcceptedNameContainer();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#setOnError()
         */
-       public void setOnError() {
-               Color disabledColor =  StoreUtil.getColor(Resources.COLOR_EDITOR_ERROR);
+       @Override
+    public void setOnError() {
+               Color disabledColor =  AbstractUtility.getColor(Resources.COLOR_EDITOR_ERROR);
                setEnabled(false, disabledColor);
        }
 
@@ -903,16 +919,16 @@ public class TaxonNameEditor extends EditorPart implements
         */
        @Override
        public void setDisabled(){
-               Color disabledColor =  StoreUtil.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
+               Color disabledColor =  AbstractUtility.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
                setEnabled(false);
        }
-       
+
        protected void setEnabled(boolean enabled, Color background) {
-       
+
                for(AbstractGroupedContainer groupedContainer : getGroupedContainers()){
                        groupedContainer.setEnabled(enabled);
                }
-               
+
                // send an empty selection to the current provider - TODO only on error ???
                if (!enabled) {
                        getManagedForm().setInput(null);
@@ -923,10 +939,10 @@ public class TaxonNameEditor extends EditorPart implements
                }
                getControl().setBackground(background);
        }
-       
+
        @Override
        public void setEnabled(boolean enabled) {
-               Color background =  StoreUtil.getColor(enabled ? Resources.COLOR_COMPOSITE_BACKGROUND : Resources.COLOR_TEXT_DISABLED_BACKGROUND);
+               Color background =  AbstractUtility.getColor(enabled ? Resources.COLOR_COMPOSITE_BACKGROUND : Resources.COLOR_TEXT_DISABLED_BACKGROUND);
                setEnabled(enabled, background);
        }
 }
index e69cf6ebda40c8e3588e954a1fe8dde5d221e7c6..a267b0cb0ad804a857c20d24c904d707181aa294 100644 (file)
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.Resources;
 
 /**
@@ -61,7 +62,7 @@ public class SynonymContainer extends AbstractGroupedContainer<Synonym> {
                setFont(getViewerFont());
                
                if(getName() == null){
-                       EditorUtil.warn(getClass(), "Synonym with a null name detected. This should never happen.");
+                       MessagingUtils.warn(getClass(), "Synonym with a null name detected. This should never happen.");
                }
                
                initTextViewer();
index 18dd1c771cff6addc1586f6112541166f4395bd5..dc2f9bc37c2e5e7332f074bc2e4b295d87538dee 100644 (file)
@@ -24,6 +24,7 @@ import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptRelationshipTyp
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicGroupOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToMisapplicationOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 
 /**
@@ -77,7 +78,7 @@ public class NameEditorDropTargetListener extends DropTargetAdapter {
                
                // Execute operation if it has been initiated
                if (operation == null) {
-                       EditorUtil.warn(getClass(), "User unsuccessfully tried to drop: " + taxonBase.getClass() +
+                       MessagingUtils.warn(getClass(), "User unsuccessfully tried to drop: " + taxonBase.getClass() +
                                        ". Target: " + target);
                        dropTargetEvent.detail = DND.DROP_NONE;
                } else {
index 72a08ae9f9f9b8f4cef118c0eb6d4e9e581312ea..e76b8475e3a91bd43d8587fadb357dc6e94bd129 100644 (file)
@@ -35,6 +35,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
@@ -133,7 +134,7 @@ public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler impleme
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (Exception e) {
-                               EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+                               MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                        }
                }
                return true;
index 514d9dcae5554b00650d49971655d25e6b59acbf..9f76a0967f0cd16c447c67674e9fc46980a37053 100644 (file)
@@ -22,6 +22,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.parser.ParseHandler;
 
@@ -52,7 +53,7 @@ public class CreateHomotypicSynonymHandler extends AbstractHandler implements
                                        editor.getUndoContext(), taxon, group, newSynonymName, editor);
                        EditorUtil.executeOperation(operation);
                } catch (NotDefinedException e) {
-                       EditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                
 
index ee188ef28d78b22bdfc0e3e1d61e86aef15244cd..86240cb151f15d8270c6b60ca0ebc6caa45bfa5f 100644 (file)
@@ -29,6 +29,7 @@ import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.DeleteSynonymOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.DeleteTaxonOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -69,7 +70,7 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler,
                try {
                        commandName = event.getCommand().getName();
                } catch (NotDefinedException e) {
-                       EditorUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                
                // synonym
index 55c685bdfbc2213e4ddf4c10c1d312453b9e3036..d8c0e370fdd71db8eb35e3d8c90721fd68edc9b7 100644 (file)
@@ -26,6 +26,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 /**
@@ -102,7 +103,7 @@ public class SwapSynonymAndAcceptedHandler extends AbstractHandler implements
                                        EditorUtil.openTaxonBase(taxon.getUuid());
                                        
                                } catch (Exception e) {
-                                       EditorUtil.warningDialog("Could not open editor for taxon", this, e.getMessage());
+                                       MessagingUtils.warningDialog("Could not open editor for taxon", this, e.getMessage());
                                }
                                
                        }
index 850747b6252772404bb0d6cfbb7f5145d9914067..0b6fb5125365ebe478767cc8c1390ef7ae1edf6a 100644 (file)
@@ -20,9 +20,9 @@ import org.eclipse.core.runtime.IStatus;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>ChangeConceptRelationshipTypeOperation class.</p>
@@ -59,7 +59,7 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
                Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(relatedTaxon);
 
                if(taxonRelationships.size() > 1){
-                       StoreUtil.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
+                       MessagingUtils.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
                                        "accepted and the related taxon. This case is not handled by the software yet");
                        return;
                }
@@ -108,7 +108,7 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                // see FIXME in execute()
-               StoreUtil.warn(this.getClass(), "Not implemented yet. See developer documentation for details");
+               MessagingUtils.warn(this.getClass(), "Not implemented yet. See developer documentation for details");
                return null;
        }
 }
index 3219c650c5b21b56653f5b8f632f0ce1930bd7e3..e3657991601b789219259873cc67af3b9de223db 100644 (file)
@@ -26,10 +26,10 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>ChangeConceptToSynonymOperation class.</p>
@@ -69,7 +69,7 @@ public class ChangeConceptToSynonymOperation extends
                Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(concept);
 
                if(taxonRelationships.size() > 1){
-                       StoreUtil.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
+                       MessagingUtils.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
                                        "accepted and the related taxon. This case is not handled by the software yet");
                        return;
                }
index 38a318d6f6745f34e3d35e290096a396e2331bbb..316af1d4c4cedfd72fc434b6e1349c66931d736c 100644 (file)
@@ -25,7 +25,7 @@ import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -80,7 +80,7 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
                try {
                        newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, element, true, true, null, null);
                } catch (HomotypicalGroupChangeException e) {
-                       AbstractUtility.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
+                       MessagingUtils.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
                        return postExecute(null);
                }
                monitor.worked(20);
@@ -120,7 +120,7 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
                        throws ExecutionException {
 
                // TODO implement - biggest problem is that any window open for new taxon must be closed first
-               AbstractUtility.warn(this.getClass(), "Not yet implemented");
+               MessagingUtils.warn(this.getClass(), "Not yet implemented");
 
                return postExecute(element);
        }
index 97850acbbfb547d933a4e4eca69828ea4e7e390b..e73e355a8fccf4f0e72de98a3ab8a8798b1c31ab 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -66,6 +67,7 @@ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation {
                        throws ExecutionException {
 
                // Find misapplication relation, save citation information
+
                for (TaxonRelationship relationship : element.getTaxonRelations()) {
                        if (relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())
                                        && relationship.getFromTaxon().equals(misapplication)) {
@@ -83,7 +85,9 @@ public class DeleteMisapplicationOperation extends AbstractPostTaxonOperation {
 
                ITaxonService service = controller.getTaxonService();
                TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
-               
+               NameDeletionConfigurator nameConfig = new NameDeletionConfigurator();
+               nameConfig.setRemoveAllNameRelationships(true);
+               config.setNameDeletionConfig(nameConfig);
                service.deleteTaxon(misapplication, config, null);
                monitor.worked(40);
 
index a30c1f9d394a6e3b32b97ad477605510ebf2d4fd..1c7da40a872f184372609304c2907d6214083cea 100644 (file)
@@ -20,10 +20,10 @@ import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>SwapSynonymAndAcceptedOperation class.</p>
@@ -89,7 +89,7 @@ public class SwapSynonymAndAcceptedOperation extends AbstractPostTaxonOperation
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               StoreUtil.error(this.getClass(), "Not yet implemented", null);
+               MessagingUtils.error(this.getClass(), "Not yet implemented", null);
                return null;
        }
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistContentProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistContentProvider.java
new file mode 100644 (file)
index 0000000..d25a306
--- /dev/null
@@ -0,0 +1,57 @@
+// $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.editor.view.checklist;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ *
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistContentProvider implements IStructuredContentProvider {
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+        */
+       /**
+        * <p>dispose</p>
+        */
+       @Override
+    public void dispose() {
+
+       }
+
+       /* (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) {
+
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public Object[] getElements(Object inputElement) {
+               if(inputElement instanceof List){
+                       return ((List) inputElement).toArray();
+               }
+               return new Object[]{};
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
new file mode 100644 (file)
index 0000000..b38fd59
--- /dev/null
@@ -0,0 +1,645 @@
+// $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.editor.view.checklist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.SimpleSelectionProvider;
+import eu.etaxonomy.taxeditor.editor.view.checklist.edit.DistributionEditingSupport;
+import eu.etaxonomy.taxeditor.editor.view.checklist.edit.RankEditingSupport;
+import eu.etaxonomy.taxeditor.editor.view.checklist.filter.ChecklistEditorFilter;
+import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistDropdownSelectionListener;
+import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistFocusListener;
+import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistModifyListener;
+import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * <p>
+ * ChecklistViewPart class.
+ * </p>
+ *
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistEditor extends EditorPart implements ISelectionListener, IPartContentHasFactualData,
+        IConversationEnabled, IContextListener, IPartContentHasDetails, IDirtyMarkableSelectionProvider {
+
+    private static final Logger logger = Logger.getLogger(ChecklistEditor.class);
+    /**
+     * Key used for storing Checklist Editor View
+     */
+    private static final String CHECKLIST_EDITOR_MEMENTO_KEY = "checklistEditor";
+
+    private class ChecklistJob extends Job {
+
+        private List<TaxonNode> taxonNodes;
+
+        /**
+         * @param name
+         */
+        public ChecklistJob(String title, List<TaxonNode> listTaxonNodes) {
+            super(title);
+            this.taxonNodes = listTaxonNodes;
+
+        }
+
+        /*
+         * (non-Javadoc)
+         *
+         * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
+         * IProgressMonitor)
+         */
+        @Override
+        public IStatus run(final IProgressMonitor monitor) {
+            try {
+                logger.debug("Begin of eclipse core runtime Job to Retrieve datasources");
+                monitor.beginTask("Retrieving TaxonNodes", taxonNodes.size() + 1);
+
+                final List<Taxon> taxonList = new ArrayList<Taxon>();
+
+                for (TaxonNode taxonNode : taxonNodes) {
+                    HibernateProxyHelper hh = new HibernateProxyHelper();
+                    Taxon taxon = hh.deproxy(taxonNode.getTaxon(), Taxon.class);
+                    taxonList.add(taxon);
+                }
+                // set View input
+                Display.getDefault().asyncExec(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        viewer.setInput(taxonList);
+                    }
+                });
+                monitor.worked(1);
+
+            } finally {
+                monitor.done();
+                taxonNodes = null;
+            }
+            return Status.OK_STATUS;
+        }
+    }
+
+    /**
+     * Constant
+     * <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code>
+     */
+    public static String ID = "eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor";
+
+    private TableViewer viewer;
+
+    private String partNameCache;
+
+    private IWorkbenchSiteProgressService service;
+
+    private ITaxonNodeService taxonNodeService;
+
+    private ChecklistEditorComparator comparator;
+
+    private ChecklistEditorInput checklistEditorInput;
+
+    private SimpleSelectionProvider simpleSelectionProvider;
+
+    private ISelectionService selectionService;
+
+    private ConversationHolder conversation;
+
+    private Integer countNodes;
+
+    private List<TaxonNode> selectedTaxonNodes;
+
+    private boolean dirty;
+
+    private ChecklistEditorFilter filter;
+
+    private Menu headerMenu;
+
+    private Label statusLabel;
+
+    private SortedSet<DefinedTermBase> terms = null;
+
+    /**
+     * @return the selectedTaxonNodes
+     */
+    public List<TaxonNode> getSelectedTaxonNodes() {
+        return selectedTaxonNodes;
+    }
+
+    /**
+     * @param selectedTaxonNodes
+     *            the selectedTaxonNodes to set
+     */
+    public void setSelectedTaxonNodes(List<TaxonNode> selectedTaxonNodes) {
+        this.selectedTaxonNodes = selectedTaxonNodes;
+    }
+
+    /**
+     * <p>
+     * Constructor for CdmDataSourceViewPart.
+     * </p>
+     */
+    public ChecklistEditor() {
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void createPartControl(Composite parent) {
+        service = (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);
+        taxonNodeService = CdmStore.getService(ITaxonNodeService.class);
+        selectionService = getSite().getWorkbenchWindow().getSelectionService();
+        selectionService.addSelectionListener(this);
+        filter = new ChecklistEditorFilter();
+        ChecklistLabelProvider labelProvider = new ChecklistLabelProvider();
+        terms = (SortedSet<DefinedTermBase>) labelProvider.getTermsOrderedByLabels(labelProvider.getNamedAreas(),
+                CdmStore.getDefaultLanguage());
+        createTopComposite(parent);
+        loadDataInput();
+    }
+
+    /**
+     * @param parent
+     */
+    private void createTopComposite(Composite parent) {
+        GridLayout gridLayout = new GridLayout(3, false);
+        gridLayout.marginWidth = 0;
+        gridLayout.marginHeight = 0;
+        parent.setLayout(gridLayout);
+
+        final Text searchText = createSearchBar(parent);
+
+        if (terms != null && !terms.isEmpty()) {
+            createToolbar(parent);
+        }
+        viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
+        getSite().setSelectionProvider(viewer);
+
+        final ModifyListener modifyListener = new ChecklistModifyListener(viewer, filter, searchText);
+
+        searchText.addFocusListener(new ChecklistFocusListener(searchText, modifyListener));
+        searchText.addModifyListener(modifyListener);
+
+        // Layout the viewer
+        GridData gridData = new GridData();
+        gridData.verticalAlignment = GridData.FILL;
+        gridData.horizontalSpan = 3;
+        gridData.grabExcessHorizontalSpace = true;
+        gridData.grabExcessVerticalSpace = true;
+        gridData.horizontalAlignment = GridData.FILL;
+        viewer.getControl().setLayoutData(gridData);
+
+        viewer.addFilter(filter);
+        createColumns(viewer);
+
+        viewer.setContentProvider(new ChecklistContentProvider());
+        viewer.setLabelProvider(new ChecklistLabelProvider());
+        comparator = new ChecklistEditorComparator();
+        viewer.setComparator(comparator);
+
+        createStatusBar(parent);
+    }
+
+    /**
+     * @param parent
+     * @return
+     */
+    private Text createSearchBar(Composite parent) {
+        Label searchLabel = new Label(parent, SWT.NONE);
+        searchLabel.setText("Search: ");
+        final Text searchText = new Text(parent, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.CANCEL);
+        searchText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+        searchText.setForeground(EditorUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
+        searchText.setText("type filter text");
+        return searchText;
+    }
+
+    /**
+     * @param parent
+     */
+    private void createToolbar(Composite parent) {
+        ToolBar toolBar = new ToolBar(parent, SWT.NONE);
+        ToolItem toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
+        toolItem.setText("Distribution Status");
+        toolItem.setToolTipText("Show Distribution Status for selected Areas");
+        ChecklistDropdownSelectionListener dropListener = new ChecklistDropdownSelectionListener(toolItem, this, terms);
+        for (DefinedTermBase<DefinedTermBase> term : terms) {
+            if(term!=null){
+                dropListener.add(term);
+            }
+        }
+        toolItem.addSelectionListener(dropListener);
+        toolBar.pack();
+    }
+
+    private void createStatusBar(Composite composite) {
+        GridData gridData = new GridData();
+        gridData.horizontalSpan = 3;
+        gridData.grabExcessHorizontalSpace = true;
+        gridData.horizontalAlignment = GridData.FILL;
+
+        statusLabel = new Label(composite, SWT.LEFT);
+        statusLabel.setText("Anzahl der Elemente: " + (countNodes != null ? countNodes : "uknown"));
+        statusLabel.setLayoutData(gridData);
+    }
+
+    // This will create the columns for the table
+    private void createColumns(TableViewer viewer) {
+        Table table = viewer.getTable();
+        List<String> titles = new ArrayList<String>();
+        Collections.addAll(titles, "Taxon", "Author", "Reference", "Rank");
+        List<Integer> bounds = new ArrayList<Integer>();
+        Collections.addAll(bounds, 300, 200, 200, 200);
+        Map<Integer, Boolean>restoreColumnWidth = new HashMap<Integer, Boolean>();
+        if (terms != null) {
+            int i = 4;
+            for (DefinedTermBase<DefinedTermBase> term : terms) {
+                if(term != null){
+                    restoreColumnWidth.put(i, PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString()));
+                    titles.add(term.getTitleCache());
+                    bounds.add(200);
+                    i++;
+                }
+            }
+        }
+
+        for (int i = 0; i < titles.size(); i++) {
+            TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+            column.getColumn().setText(titles.get(i));
+            column.getColumn().setWidth(bounds.get(i));
+            column.getColumn().setResizable(true);
+            column.getColumn().setMoveable(true);
+            column.getColumn().addSelectionListener(getSelectionAdapter(column.getColumn(), i));
+            if (i == 1) {
+                table.setSortColumn(column.getColumn());
+            }
+            if (i == 3) {
+                column.setEditingSupport(new RankEditingSupport(viewer, this));
+            }
+            if (i >= 4) {
+                //read PrefrenceStore to setWidth according to last saved state
+                if(restoreColumnWidth.get(i)){
+                    column.getColumn().setWidth(100);
+                }else{
+                    column.getColumn().setWidth(0);
+                }
+                column.setEditingSupport(new DistributionEditingSupport(viewer, this, i));
+            }
+        }
+        table.setSortDirection(SWT.DOWN);
+        table.setHeaderVisible(true);
+        table.setLinesVisible(true);
+    }
+
+    /**
+     *
+     * pull data from database and set input for view
+     *
+     */
+    private void loadDataInput() {
+        Classification classification = checklistEditorInput.getClassification();
+        TaxonNode taxonNode = checklistEditorInput.getTaxonNode();
+        if (classification != null && taxonNode == null) {
+            countNodes = taxonNodeService.countAllNodesForClassification(classification);
+            statusLabel.setText("Anzahl der Elemente: " + (countNodes != null ? countNodes : "uknown"));
+            // This should not kill the view nor the editor if something goes
+            // wrong
+            // TODO: don't load the whole taxonNode Object but rather a small
+            // and simple Solution
+            // FIXME: May be don't open classification which are greater than
+            // 3000 Taxa
+            selectedTaxonNodes = taxonNodeService.listAllNodesForClassification(classification, 0, countNodes);
+            getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes), Job.LONG);
+        }
+        if (taxonNode != null) {
+            selectedTaxonNodes = taxonNodeService.loadChildNodesOfTaxonNode(taxonNode, NODE_INIT_STRATEGY, true, false);
+            getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes), Job.LONG);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        super.dispose();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setFocus() {
+        viewer.getControl().setFocus();
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void showBusy(boolean busy) {
+        super.showBusy(busy);
+        // viewer.getTable().setEnabled(!busy);
+        if (busy) {
+            partNameCache = getPartName();
+            setPartName("Loading " + countNodes + " Taxa...");
+        } else {
+            if (partNameCache != null) {
+                setPartName(partNameCache);
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>viewer</code>.
+     * </p>
+     *
+     * @return a {@link org.eclipse.jface.viewers.StructuredViewer} object.
+     */
+    public StructuredViewer getViewer() {
+        return viewer;
+    }
+
+    public void refresh() {
+        viewer.refresh();
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>service</code>.
+     * </p>
+     *
+     * @return the service
+     */
+    public IWorkbenchSiteProgressService getService() {
+        return service;
+    }
+
+    private SelectionAdapter getSelectionAdapter(final TableColumn column, final int index) {
+        SelectionAdapter selectionAdapter = new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                comparator.setColumn(index);
+                int dir = viewer.getTable().getSortDirection();
+                if (viewer.getTable().getSortColumn() == column) {
+                    dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
+                } else {
+                    dir = SWT.DOWN;
+                }
+                viewer.getTable().setSortDirection(dir);
+                viewer.getTable().setSortColumn(column);
+                viewer.refresh();
+            }
+        };
+        return selectionAdapter;
+    }
+
+    @Override
+    public void doSave(IProgressMonitor monitor) {
+        try {
+            monitor.beginTask("Saving Editor", 1);
+            getConversationHolder().bind();
+            getConversationHolder().commit(true);
+            setDirty(false);
+            monitor.worked(1);
+        } finally {
+            monitor.done();
+        }
+
+    }
+
+    @Override
+    public void doSaveAs() {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+        setSite(site);
+        setInput(input);
+        if (input instanceof ChecklistEditorInput) {
+            checklistEditorInput = (ChecklistEditorInput) input;
+            setPartName(getPartName() + ": " + checklistEditorInput.getName());
+            conversation = ((ChecklistEditorInput) input).getConversationHolder();
+        }
+        simpleSelectionProvider = new SimpleSelectionProvider();
+        getSite().setSelectionProvider(simpleSelectionProvider);
+    }
+
+    @Override
+    public boolean isSaveAsAllowed() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
+     * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+     */
+    @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
+     * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+     */
+    @Override
+    public void update(CdmDataChangeMap changeEvents) {
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
+     * ()
+     */
+    @Override
+    public ConversationHolder getConversationHolder() {
+        return conversation;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.
+     * eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+     */
+
+    @Override
+    public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse
+     * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void contextStop(IMemento memento, IProgressMonitor monitor) {
+        // TODO Auto-generated method stub
+//        IStructuredSelection sel = (IStructuredSelection) this.viewer.getSelection();
+//        if (sel.isEmpty()) {
+//            return;
+//        }
+//        memento = memento.createChild("tree-selections");
+//        Iterator iter = sel.iterator();
+//        while (iter.hasNext()) {
+//            String nodeName = (String) iter.next();
+//            memento.createChild("selected-nodes", nodeName);
+//        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse
+     * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void contextStart(IMemento memento, IProgressMonitor monitor) {
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse
+     * .core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void contextRefresh(IProgressMonitor monitor) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse
+     * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
+        conversation.clear();
+        conversation.close();
+        conversation = null;
+    }
+
+    private static final List<String> NODE_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions",
+            "descriptions.*", "description.state", "feature", "feature.*", "childNodes", "childNodes.taxon",
+            "childNodes.taxon.name", "taxonNodes", "taxonNodes.*", "taxonNodes.taxon.*", "taxon.*",
+            "taxon.descriptions", "taxon.sec", "taxon.name.*", "taxon.synonymRelations", "terms", "name.*",
+            "name.rank.representations", "name.status.type.representations", "sources.$", "stateData.$" });
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
+     * java.lang.Object)
+     */
+    @Override
+    public void changed(Object element) {
+        if (element != null) {
+            viewer.update(element, null);
+            setDirty(true);
+            firePropertyChange(PROP_DIRTY);
+        }
+    }
+
+    public void setDirty(boolean dirty) {
+        this.dirty = dirty;
+        firePropertyChange(PROP_DIRTY);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
+     */
+    @Override
+    public boolean isDirty() {
+        return dirty;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java
new file mode 100644 (file)
index 0000000..ae7a0c4
--- /dev/null
@@ -0,0 +1,68 @@
+// $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.editor.view.checklist;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+/**
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistEditorComparator extends ViewerComparator {
+
+       private int propertyIndex;
+       private static final int ASCENDING = 0;
+       private static final int DESCENDING = 1;
+       private int direction = ASCENDING;
+
+       public ChecklistEditorComparator() {
+               this.propertyIndex = 1;
+               direction = ASCENDING;
+       }
+
+       public void setColumn(int column) {
+               if (column == this.propertyIndex) {
+                       // Same column as last sort; toggle the direction
+                       direction = 1 - direction;
+               } else {
+                       // New column; do an ascending sort
+                       this.propertyIndex = column;
+                       direction = DESCENDING;
+               }
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+        */
+       @Override
+       public int compare(Viewer viewer, Object e1, Object e2) {
+         Taxon d1 = (Taxon) e1;
+         Taxon d2 = (Taxon) e2;
+
+               int result = 0;
+
+               switch (propertyIndex) {
+
+                       default:
+                               result = d1.getTitleCache().compareTo(d2.getTitleCache());
+               }
+
+               // If descending order, flip the direction
+               if (direction == DESCENDING) {
+                       result = -result;
+               }
+               return result;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java
new file mode 100644 (file)
index 0000000..0bc2b24
--- /dev/null
@@ -0,0 +1,197 @@
+// $Id$
+/**
+* Copyright (C) 2013 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.view.checklist;
+
+import java.util.UUID;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistable;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ *
+ * @author a.oppermann
+ * @date 25.04.2014
+ *
+ */
+public class ChecklistEditorInput implements IEditorInput, IPersistable {
+
+    /**
+     * The selected classification
+     */
+    private TaxonNode taxonNode = null;
+
+    private Classification classification = null;
+
+    private final ConversationHolder conversationHolder;
+
+
+    /**
+     * Creates an editor input for the {@link ChecklistView} with the currently selected TaxonNode
+     * and its childNodes.
+     * @param taxonNode
+     */
+    public ChecklistEditorInput(TaxonNode taxonNode){
+        super();
+        this.conversationHolder = CdmStore.createConversation();
+        this.taxonNode = CdmStore.getCurrentApplicationConfiguration().getTaxonNodeService().load(taxonNode.getUuid());
+        classification = taxonNode.getClassification();
+    }
+
+    /**
+     * Creates an editor input for the {@link ChecklistView} with the currently selected classification.
+     * @param classificationUuid
+     */
+    public ChecklistEditorInput(Classification classification) {
+        super();
+        this.conversationHolder = CdmStore.createConversation();
+        this.classification = CdmStore.getCurrentApplicationConfiguration().getClassificationService().load(classification.getUuid());
+
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+     */
+    @Override
+    public Object getAdapter(Class adapter) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#exists()
+     */
+    @Override
+    public boolean exists() {
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+     */
+    @Override
+    public ImageDescriptor getImageDescriptor() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getName()
+     */
+    @Override
+    public String getName() {
+        if(taxonNode != null){
+            return taxonNode.getTaxon().getName().getTitleCache();
+        }else{
+            return classification.getTitleCache();
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getPersistable()
+     */
+    @Override
+    public IPersistableElement getPersistable() {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getToolTipText()
+     */
+    @Override
+    public String getToolTipText() {
+        return classification.getTitleCache();
+    }
+
+    /**
+     * @return the taxonNode
+     */
+    public TaxonNode getTaxonNode() {
+        return taxonNode;
+    }
+
+    /**
+     * @return classification
+     */
+    public Classification getClassification(){
+       return classification;
+    }
+
+    /**
+     * @return the conversationHolder
+     */
+    public ConversationHolder getConversationHolder() {
+        return conversationHolder;
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((classification == null) ? 0 : classification.hashCode());
+        result = prime * result + ((taxonNode == null) ? 0 : taxonNode.hashCode());
+        return result;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        ChecklistEditorInput other = (ChecklistEditorInput) obj;
+        if (classification == null) {
+            if (other.classification != null) {
+                return false;
+            }
+        } else if (!classification.equals(other.classification)) {
+            return false;
+        }
+        if (taxonNode == null) {
+            if (other.taxonNode != null) {
+                return false;
+            }
+        } else if (!taxonNode.equals(other.taxonNode)) {
+            return false;
+        }
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+     */
+    @Override
+    public void saveState(IMemento memento) {
+        UUID uuid = classification.getUuid();
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java
new file mode 100644 (file)
index 0000000..16a5e26
--- /dev/null
@@ -0,0 +1,182 @@
+// $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.editor.view.checklist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.TermLanguageComparator;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+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;
+
+/**
+ *
+ * @author a.oppermann
+ * @created 30.04.2014
+ * @version 1.0
+ */
+public class ChecklistLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+    public static final String DEFAULT_ENTRY = "-";
+    private IDescriptionService descriptionService;
+    private final List<DefinedTermBase<?>> namedAreas;
+
+
+
+    /**
+     *
+     */
+    public ChecklistLabelProvider() {
+        namedAreas = loadNamedAreas();
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang
+     * .Object, int)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public Image getColumnImage(Object element, int columnIndex) {
+        // TODO
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang
+     * .Object, int)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public String getColumnText(Object element, int columnIndex) {
+        descriptionService = CdmStore.getService(IDescriptionService.class);
+        Taxon taxon = (Taxon) element;
+        //TODO load areas by this list
+        SortedSet<DefinedTermBase<?>> sortedNamedAreas = (SortedSet<DefinedTermBase<?>>) getTermsOrderedByLabels(namedAreas, CdmStore.getDefaultLanguage());
+
+        List<TaxonDescription> listTaxonDescriptions = descriptionService.listTaxonDescriptions(taxon, null, null, null, null, null, DESC_INIT_STRATEGY);;
+        NonViralName<?> nonVirlaName = HibernateProxyHelper.deproxy(taxon.getName(), NonViralName.class);
+
+        switch (columnIndex) {
+        case 0:
+            String taxonName = null;
+            taxonName = (nonVirlaName != null) ? nonVirlaName.getNameCache() : null;
+            return (taxonName != null) ? taxonName : DEFAULT_ENTRY;
+
+        case 1:
+            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 3:
+            String rank = null;
+            if (taxon.getName().getRank() != null) {
+                rank = taxon.getName().getRank().toString();
+            }
+            return (rank != null) ? rank : DEFAULT_ENTRY;
+        }
+
+        if(columnIndex >3){
+
+            for (TaxonDescription td : listTaxonDescriptions) {
+                for (DescriptionElementBase deb : td.getElements()) {
+                    if (deb instanceof Distribution) {
+                        Distribution distribution = (Distribution) deb;
+                        String area = distribution.toString();
+                        if(sortedNamedAreas != null){
+                            Object[] array = sortedNamedAreas.toArray();
+                            DefinedTermBase<DefinedTermBase> term = (DefinedTermBase<DefinedTermBase>) array[columnIndex-4];
+                            if(term != null){
+                                if (area.equalsIgnoreCase(term.getTitleCache())) {
+                                    return (distribution.getStatus().getTitleCache() != null)?distribution.getStatus().getTitleCache():DEFAULT_ENTRY;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return DEFAULT_ENTRY;
+
+    }
+
+    private static final List<String> DESC_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions",
+            "descriptions.*", "description.state" });
+
+
+    private List<DefinedTermBase<?>> loadNamedAreas() {
+        IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+        String values = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
+        if (values != null && values != "") {
+            String[] split = values.split(",");
+            List<String> listValue = Arrays.asList(split);
+            ArrayList<DefinedTermBase<?>> termlist = new ArrayList<DefinedTermBase<?>>();
+            for(String s : listValue){
+                UUID uuid = UUID.fromString(s);
+                ITermService service = CdmStore.getService(ITermService.class);
+                DefinedTermBase definedTermBase = service.load(uuid);
+                termlist.add(definedTermBase);
+            }
+            return termlist;
+        }
+        return null;
+    }
+
+    public SortedSet<?> getTermsOrderedByLabels(List<DefinedTermBase<?>> listTerm,Language language){
+        TermLanguageComparator comp = new TermLanguageComparator();
+        comp.setCompareLanguage(language);
+        SortedSet result = new TreeSet(comp);
+        if(listTerm != null){
+            result.addAll(listTerm);
+        }
+        return result;
+    }
+
+    /**
+     * @return the namedAreas
+     */
+    public List<DefinedTermBase<?>> getNamedAreas() {
+        return namedAreas;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java
new file mode 100644 (file)
index 0000000..c30985b
--- /dev/null
@@ -0,0 +1,155 @@
+package eu.etaxonomy.taxeditor.editor.view.checklist.edit;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxViewerCellEditor;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableColumn;
+
+import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Distribution;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistLabelProvider;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public final class DistributionEditingSupport extends EditingSupport {
+
+    private ComboBoxViewerCellEditor cellEditor = null;
+    private final TableViewer viewer;
+    private final ChecklistEditor editor;
+    private final IDescriptionService descriptionService;
+    private final int columnIndex;
+
+    private static final Logger logger = Logger.getLogger(DistributionEditingSupport.class);
+
+    public DistributionEditingSupport(TableViewer viewer, ChecklistEditor checklistEditor, int columnIndex) {
+        super(viewer);
+        this.viewer = viewer;
+        this.columnIndex = columnIndex;
+        descriptionService = CdmStore.getService(IDescriptionService.class);
+        editor = checklistEditor;
+        cellEditor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.READ_ONLY);
+        cellEditor.setLabelProvider(new LabelProvider());
+        cellEditor.setContentProvider(new ArrayContentProvider());
+        // TODO set input
+        List<PresenceAbsenceTermBase> input = CdmStore.getTermManager()
+                .getPreferredTerms(PresenceAbsenceTermBase.class);
+        cellEditor.setInput(input);
+    }
+
+    @Override
+    protected CellEditor getCellEditor(Object element) {
+        return cellEditor;
+    }
+
+    @Override
+    protected boolean canEdit(Object element) {
+        return true;
+    }
+
+    @Override
+    protected Object getValue(Object element) {
+        if (element instanceof Taxon) {
+            Taxon taxon = (Taxon) element;
+            Distribution distributionForColumn = getDistributionForColumn(taxon);
+            if (distributionForColumn != null) {
+                distributionForColumn.getStatus().getTitleCache();
+            }
+            // return PresenceAbsenceTerms
+        }
+        return null;
+    }
+
+    @Override
+    protected void setValue(Object element, Object value) {
+        if (element instanceof Taxon && value instanceof PresenceAbsenceTermBase) {
+            Taxon taxon = (Taxon) element;
+            PresenceAbsenceTermBase occurenceStatus = (PresenceAbsenceTermBase) value;
+            Distribution distribution = getDistributionForColumn(taxon);
+            if (distribution != null) {
+                // change status for already exsiting distribution
+                distribution.setStatus(occurenceStatus);
+            } else {
+                createDistributionForColumn(taxon, occurenceStatus);
+            }
+            // viewer.update(distribution, null);
+            viewer.update(element, null);
+            viewer.refresh();
+            editor.setDirty(true);
+            editor.changed(element);
+            viewer.refresh();
+        }
+    }
+
+    private static final List<String> DESC_INIT_STRATEGY = Arrays.asList(new String[] { "descriptions",
+            "descriptions.*", "description.state" });
+
+    /**
+     *
+     * @param taxon
+     * @return
+     */
+    private Distribution getDistributionForColumn(Taxon taxon) {
+        List<TaxonDescription> listTaxonDescriptions = descriptionService.listTaxonDescriptions(taxon, null, null,
+                null, null, null, DESC_INIT_STRATEGY);
+        TableColumn column = viewer.getTable().getColumn(columnIndex);
+        for (TaxonDescription td : listTaxonDescriptions) {
+            for (DescriptionElementBase deb : td.getElements()) {
+                if (deb instanceof Distribution) {
+                    Distribution distribution = (Distribution) deb;
+                    if (column.getText().equalsIgnoreCase(distribution.getArea().getTitleCache())) {
+                        return distribution;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    private void createDistributionForColumn(Taxon taxon, PresenceAbsenceTermBase occurenceStatus) {
+        TableColumn column = viewer.getTable().getColumn(columnIndex);
+
+        ChecklistLabelProvider labelProvider = new ChecklistLabelProvider();
+        List<DefinedTermBase<?>> namedAreas = labelProvider.getNamedAreas();
+        SortedSet<DefinedTermBase<?>> terms = (SortedSet<DefinedTermBase<?>>) labelProvider.getTermsOrderedByLabels(
+                namedAreas, CdmStore.getDefaultLanguage());
+
+        if (terms != null) {
+            for (DefinedTermBase term : terms) {
+                if (column.getText().equalsIgnoreCase(term.getTitleCache())) {
+                    NamedArea area = (NamedArea) term;
+                    Distribution distribution = Distribution.NewInstance(area, occurenceStatus);
+                    Set<TaxonDescription> descriptions = taxon.getDescriptions();
+                    if (descriptions != null) {
+                        for (TaxonDescription desc : descriptions) {
+                            // add to first taxon description
+                            desc.addElement(distribution);
+                            break;
+                        }
+                    } else {// there are no TaxonDescription yet.
+                        TaxonDescription td = TaxonDescription.NewInstance(taxon);
+                        td.addElement(distribution);
+                    }
+                }
+            }
+        }
+
+        return;
+    }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/RankEditingSupport.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/RankEditingSupport.java
new file mode 100644 (file)
index 0000000..9e59a05
--- /dev/null
@@ -0,0 +1,74 @@
+package eu.etaxonomy.taxeditor.editor.view.checklist.edit;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxViewerCellEditor;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public final class RankEditingSupport extends EditingSupport{
+
+    private ComboBoxViewerCellEditor cellEditor = null;
+    private final TableViewer viewer;
+    private final ChecklistEditor editor;
+
+
+    private static final Logger logger = Logger.getLogger(RankEditingSupport.class);
+
+    public RankEditingSupport(TableViewer viewer, ChecklistEditor checklistEditor) {
+        super(viewer);
+        this.viewer = viewer;
+        editor = checklistEditor;
+        cellEditor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.READ_ONLY);
+        cellEditor.setLabelProvider(new LabelProvider());
+        cellEditor.setContentProvider(new ArrayContentProvider());
+        //TODO set input
+        List<Rank> input = CdmStore.getTermManager().getPreferredTerms(Rank.class);
+        cellEditor.setInput(input);
+    }
+
+    @Override
+    protected CellEditor getCellEditor(Object element) {
+        return cellEditor;
+    }
+
+    @Override
+    protected boolean canEdit(Object element) {
+        return true;
+    }
+
+    @Override
+    protected Object getValue(Object element) {
+        if (element instanceof Taxon) {
+            Taxon taxon = (Taxon)element;
+            Rank rank = (taxon.getName().getRank() != null)?taxon.getName().getRank() : null;
+            return rank;
+        }
+        return null;
+    }
+
+    @Override
+    protected void setValue(Object element, Object value) {
+        if (element instanceof Taxon && value instanceof Rank) {
+            Taxon taxon = (Taxon)element;
+            Rank rank = (Rank) value;
+            taxon.getName().setRank(rank);
+            viewer.update(element, null);
+            viewer.refresh();
+            editor.setDirty(true);
+            editor.changed(element);
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/filter/ChecklistEditorFilter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/filter/ChecklistEditorFilter.java
new file mode 100644 (file)
index 0000000..bcbc27f
--- /dev/null
@@ -0,0 +1,51 @@
+package eu.etaxonomy.taxeditor.editor.view.checklist.filter;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+public class ChecklistEditorFilter extends ViewerFilter {
+
+    private String searchString;
+
+    public void setSearchText(String s) {
+        // Search must be a substring of the existing value
+        if(s.contains("*")){
+            s=s.replace("*", "");
+        }
+        this.searchString = "(?i).*" + s + ".*";
+    }
+
+    @Override
+    public boolean select(Viewer viewer, Object parentElement, Object element) {
+        if (searchString == null || searchString.length() == 0) {
+            return true;
+        }
+        Taxon taxon = (Taxon) element;
+        NonViralName<?> nonVirlaName = HibernateProxyHelper.deproxy(taxon.getName(), NonViralName.class);
+        Reference reference = HibernateProxyHelper.deproxy(nonVirlaName.getNomenclaturalReference(), Reference.class);
+        String rank = taxon.getName().getRank().toString();
+        //TaxonName
+        if (nonVirlaName.getNameCache()!=null && nonVirlaName.getNameCache().matches(searchString)) {
+            return true;
+        }
+        //Author
+        if (nonVirlaName.getAuthorshipCache() != null && nonVirlaName.getAuthorshipCache().matches(searchString)) {
+            return true;
+        }
+        //Reference
+        if(reference != null && reference.getAbbrevTitleCache().matches(searchString)){
+            return true;
+        }
+        //Rank
+        if (rank != null && rank.matches(searchString)) {
+            return true;
+        }
+        return false;
+    }
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionElementHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionElementHandler.java
new file mode 100644 (file)
index 0000000..318a446
--- /dev/null
@@ -0,0 +1,104 @@
+// $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.editor.view.checklist.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+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.view.descriptive.operation.CreateDescriptionElementOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ * <p>CreateDescriptionElementHandler class.</p>
+ *
+ * @author n.hoffmann
+ * @created 16.04.2009
+ * @version 1.0
+ */
+public class CreateDescriptionElementHandler extends AbstractHandler {
+
+       /*
+        * (non-Javadoc)
+        *
+        * @see
+        * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+        * ExecutionEvent)
+        */
+    /** {@inheritDoc} */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IWorkbenchPart part = HandlerUtil.getActivePart(event);
+        IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part
+                : null;
+
+
+        DescriptionBase<?> description = null;
+
+        ISelection selection = HandlerUtil.getCurrentSelection(event);
+        Object selectedElement = null;
+        if (selection instanceof ITreeSelection) {
+            TreePath[] paths = ((ITreeSelection) selection).getPaths();
+            selectedElement = paths[0].getFirstSegment();
+        }
+        else if (selection instanceof IStructuredSelection) {
+            selectedElement = ((IStructuredSelection) selection).getFirstElement();
+        }
+        if (selectedElement instanceof DescriptionBase<?>) {
+            description = (DescriptionBase<?>) selectedElement;
+        }
+
+        if (description != null) {
+            AbstractPostOperation operation = null;
+            try {
+                // TODO use undo context specific to editor
+                operation = operationCreationInstance(event.getCommand().getName(), event, description, postOperationEnabled);
+                AbstractUtility.executeOperation(operation);
+            } catch (NotDefinedException e) {
+               MessagingUtils.warn(getClass(), "Command name not set");
+            }
+        } else {
+            MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description"));
+            return null;
+        }
+        return null;
+
+    }
+
+    /**
+        * Added to make the Class more generic and limit the amount of code changes required
+        * @param label
+        * @param event
+        * @param taxon
+        * @param description
+        * @param postOperationEnabled
+        * @return
+        */
+       protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) {
+               Feature feature = (Feature) ((Event) event.getTrigger()).data;
+               return new CreateDescriptionElementOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled);
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.java
new file mode 100644 (file)
index 0000000..a95e327
--- /dev/null
@@ -0,0 +1,89 @@
+// $Id$
+/**
+* Copyright (C) 2011 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.view.checklist.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ * <p>AddDescriptionHandler class.</p>
+ *
+ * @author p.ciardelli
+ * @created 11.08.2009
+ * @version 1.0
+ */
+public class CreateDescriptionHandler extends AbstractHandler {
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+               IWorkbenchPart part = HandlerUtil.getActivePart(event);
+               IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
+
+               IEditorPart editor = HandlerUtil.getActiveEditor(event);
+               if (editor instanceof FormEditor) {
+                       editor = ((FormEditor) editor).getActiveEditor();
+               }
+               IEditorInput input = editor.getEditorInput();
+               AbstractPostOperation<?> operation;
+
+               // taxon description
+               if (input instanceof TaxonEditorInput) {
+                       Taxon taxon = ((TaxonEditorInput) input).getTaxon();
+                       try {
+                           operation = createTaxonOperation(event.getCommand().getName(), taxon, postOperationEnabled);
+                               AbstractUtility.executeOperation(operation);
+                       } catch (NotDefinedException e) {
+                               MessagingUtils.warn(getClass(), "Command name not set.");
+                       }
+               }
+               // specimen description
+               else if(part instanceof DescriptiveViewPart){
+                   Object viewerInput = ((DescriptiveViewPart)part).getViewer().getInput();
+                   if(viewerInput instanceof SpecimenOrObservationBase<?>){
+                       try {
+                           operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled);
+                           AbstractUtility.executeOperation(operation);
+                       } catch (NotDefinedException e) {
+                               MessagingUtils.warn(getClass(), "Command name not set.");
+                       }
+                   }
+               }
+               return null;
+       }
+
+          /** {@inheritDoc} */
+    protected CreateTaxonDescriptionOperation createTaxonOperation(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {
+        return new CreateTaxonDescriptionOperation(eventLabel, EditorUtil.getUndoContext(), taxon, postOperationEnabled);
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/OpenDistributionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/OpenDistributionHandler.java
new file mode 100644 (file)
index 0000000..051b06b
--- /dev/null
@@ -0,0 +1,65 @@
+// $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.editor.view.checklist.handler;
+
+import java.util.Arrays;
+import java.util.List;
+
+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.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+
+/**
+ * @author a.oppermann
+ * @date 15.05.2014
+ *
+ */
+public class OpenDistributionHandler extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
+        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+        ChecklistEditor editor = (ChecklistEditor) EditorUtil.getActiveEditor();
+
+        if (currentSelection instanceof IStructuredSelection) {
+
+            Object selectedElement = ((IStructuredSelection) currentSelection).getFirstElement();
+            if (selectedElement instanceof Taxon) {
+                TableViewer viewer = (TableViewer)editor.getViewer();
+                final Table table = viewer.getTable();
+
+                TableColumn column2 = table.getColumn(4);
+                column2.setWidth(100);
+                viewer.refresh();
+
+            }
+        }
+        return null;
+    }
+    private static final List<String> DESC_INIT_STRATEGY = Arrays.asList(new String[]{
+            "descriptions",
+            "descriptions.*",
+            "description.state"
+    });
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistDropdownSelectionListener.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistDropdownSelectionListener.java
new file mode 100644 (file)
index 0000000..68a1a94
--- /dev/null
@@ -0,0 +1,104 @@
+package eu.etaxonomy.taxeditor.editor.view.checklist.listener;
+
+import java.util.SortedSet;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.ToolItem;
+
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * Handles drop down menu selection. Available items are defined in the
+ * enumeration SearchOption.
+ *
+ * @author n.hoffmann
+ * @created Feb 2, 2010
+ * @version 1.0
+ */
+public class ChecklistDropdownSelectionListener extends SelectionAdapter {
+
+    private final Menu menu;
+    private final ToolItem dropdown;
+    private final ChecklistEditor editor;
+    private final SortedSet<DefinedTermBase> termSet;
+
+    public ChecklistDropdownSelectionListener(ToolItem dropdown, ChecklistEditor editor,
+            SortedSet<DefinedTermBase> termSet) {
+        this.dropdown = dropdown;
+        this.editor = editor;
+        this.termSet = termSet;
+        menu = new Menu(dropdown.getParent().getShell());
+    }
+
+    // SearchOption option
+    public void add(DefinedTermBase<DefinedTermBase> term) {
+        MenuItem menuItem = new MenuItem(menu, SWT.CHECK);
+        menuItem.setText(term.getTitleCache());
+        if (PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString())) {
+            menuItem.setSelection(true);
+        } else {
+            menuItem.setSelection(false);
+        }
+        menuItem.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent event) {
+                MenuItem selected = (MenuItem) event.widget;
+
+                TableViewer viewer = (TableViewer) editor.getViewer();
+                final Table table = viewer.getTable();
+                // TODO make it selectable according to selection event
+                TableColumn column = null;
+                DefinedTermBase<DefinedTermBase> selectedTerm = null;
+                if (termSet != null) {
+                    int i = 0;
+                    for (DefinedTermBase<DefinedTermBase> term : termSet) {
+                        if (term != null) {
+                            if (selected.getText().equalsIgnoreCase(term.getTitleCache())) {
+                                selectedTerm = term;
+                                column = table.getColumn(4 + i);
+                            }
+                            i++;
+                        }
+                    }
+                }
+                if (column != null && column.getWidth() == 0) {
+                    // save column status if shown or not
+                    if (selectedTerm != null) {
+                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), true);
+                    }
+                    column.setWidth(100);
+                } else if (column != null) {
+                    if (selectedTerm != null) {
+                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), false);
+                    }
+                    column.setWidth(0);
+                }
+                viewer.refresh();
+            }
+        });
+    }
+
+    @Override
+    public void widgetSelected(SelectionEvent event) {
+        if (event.detail == SWT.ARROW) {
+            ToolItem item = (ToolItem) event.widget;
+            Rectangle rect = item.getBounds();
+            Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
+            menu.setLocation(pt.x, pt.y + rect.height);
+            menu.setVisible(true);
+        } else {
+            menu.setVisible(true);
+        }
+    }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistFocusListener.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistFocusListener.java
new file mode 100644 (file)
index 0000000..ca4e4a8
--- /dev/null
@@ -0,0 +1,48 @@
+package eu.etaxonomy.taxeditor.editor.view.checklist.listener;
+
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.preference.Resources;
+
+public class ChecklistFocusListener implements FocusListener{
+
+   private final Text searchText;
+   private final ModifyListener modifyListener;
+
+    /**
+     *
+     */
+    public ChecklistFocusListener(Text searchText, ModifyListener modifyListener) {
+        this.searchText = searchText;
+        this.modifyListener = modifyListener;
+    }
+
+
+    @Override
+    public void focusGained(FocusEvent e) {
+        if ("type filter text".equals(searchText.getText())) {
+            searchText.setForeground(EditorUtil.getColor(Resources.SEARCH_VIEW_FOCUS));
+            searchText.setText("");
+        }
+    }
+
+    @Override
+    public void focusLost(FocusEvent e) {
+        if ("".equals(searchText.getText())) {
+            //TODO: set demo string
+            searchText.removeModifyListener(modifyListener);
+
+            searchText.setForeground(EditorUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
+            searchText.setText("type filter text");
+
+            searchText.addModifyListener(modifyListener);
+        }
+    }
+
+
+
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java
new file mode 100644 (file)
index 0000000..1fe7a6f
--- /dev/null
@@ -0,0 +1,48 @@
+// $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.editor.view.checklist.listener;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.taxeditor.editor.view.checklist.filter.ChecklistEditorFilter;
+
+/**
+ * @author alex
+ * @date 27.06.2014
+ *
+ */
+public class ChecklistModifyListener implements ModifyListener {
+
+    private final Text searchText;
+    private final TableViewer viewer;
+    private final ChecklistEditorFilter filter;
+
+    /**
+     *
+     */
+    public ChecklistModifyListener(TableViewer viewer, ChecklistEditorFilter filter, Text searchText) {
+        this.viewer = viewer;
+        this.filter = filter;
+        this.searchText = searchText;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+     */
+    @Override
+    public void modifyText(ModifyEvent e) {
+        filter.setSearchText(searchText.getText());
+        viewer.refresh();
+    }
+
+}
index ebebe817afdb9cef1fb6e6ec70e316b44004877b..171ad1bcbae8183aa98d2be540ac9f8954e592d7 100644 (file)
@@ -26,9 +26,9 @@ import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 
@@ -47,8 +47,8 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartC
         * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
         */
        @Override
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-               if(EditorUtil.getActiveEditor() == null){
+       protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
+               if(AbstractUtility.getActiveEditor() == null){
                        showEmptyPage();
                        return;
                }
index c7a2f9c06921d9f7cae01190347f07c0b9a7f0ad..47f8c13dc544bb9a546e3d821d75c169e7af030b 100644 (file)
@@ -1,10 +1,9 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.view.concept.graph;
 
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
@@ -21,7 +20,6 @@ import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 
 /**
@@ -29,7 +27,7 @@ import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
  *
  */
 public class ConceptGraphView extends AbstractCdmEditorViewPart {
-       
+
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept.graph";
 
        private GraphViewer viewer;
@@ -39,24 +37,24 @@ public class ConceptGraphView extends AbstractCdmEditorViewPart {
         * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
         */
        @Override
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+       protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
 
 //             if(part instanceof ConceptGraphView){
 //                     // ConceptGraphView is maximized
 //                     return;
 //             }
-               
+
                if(EditorUtil.getActiveEditor() == null){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof BulkEditor){
                        showEmptyPage();
                        return;
                }
-               
-               
+
+
                if(part instanceof MultiPageTaxonEditor){
                        if(! part.equals(this.part)){
                                IEditorInput input = ((IEditorPart) part).getEditorInput();
@@ -89,7 +87,7 @@ public class ConceptGraphView extends AbstractCdmEditorViewPart {
         */
        @Override
        public void createViewer(Composite parent) {
-               
+
                viewer = new GraphViewer(parent, SWT.NONE);
                getSite().setSelectionProvider(viewer);
 
index defca9003c1d5e36b25e4ae108a4953e20fdf589..2d63caf0d0595aef43023d3c03a268c77ccc9da9 100644 (file)
@@ -12,8 +12,8 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.handlers.IHandlerService;
 
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -68,7 +68,7 @@ public abstract class AbstractDynamicConceptRelationMenu extends ContributionIte
                                        try {
                                                handlerService.executeCommand(getCommandName(), event);
                                        } catch (Exception e) {
-                                               EditorUtil.error(getClass(), "Error executing command", e);
+                                               MessagingUtils.error(getClass(), "Error executing command", e);
                                        }
                                }                               
                        });
index 533d3b8865953644927411a3bbb2dc6b6c52571b..d850131f91bf2080072cc03dfe833a459dd35a16 100644 (file)
 
 package eu.etaxonomy.taxeditor.editor.view.concept.handler;
 
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.expressions.IEvaluationContext;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -45,6 +45,7 @@ public class CreateConceptRelationHandler extends AbstractHandler {
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
+       @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
                TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(
                                Page.NAME);
@@ -63,8 +64,9 @@ public class CreateConceptRelationHandler extends AbstractHandler {
                if(relatedConcept == null){
                        return Status.CANCEL_STATUS;
                }
-               
-               TaxonRelationshipTypeInverseContainer typeInverseContainer = (TaxonRelationshipTypeInverseContainer) ((Event)event.getTrigger()).data;
+               TaxonRelationshipType type = (TaxonRelationshipType) ((Event)event.getTrigger()).data;
+               boolean isInverse = type.getInverseLabel().isEmpty()?false:true;
+               TaxonRelationshipTypeInverseContainer typeInverseContainer =new TaxonRelationshipTypeInverseContainer(type, isInverse) ;
                
 
                IPostOperationEnabled postOperationEnabled = (activePart instanceof IPostOperationEnabled) ? (IPostOperationEnabled) activePart : null;
@@ -72,9 +74,9 @@ public class CreateConceptRelationHandler extends AbstractHandler {
                try {
                        AbstractPostOperation operation = new CreateConceptRelationOperation(event.getCommand().getName(), 
                                        editor.getUndoContext(), editor.getTaxon(), relatedConcept, typeInverseContainer, postOperationEnabled);
-                       EditorUtil.executeOperation(operation);
+                       AbstractUtility.executeOperation(operation);
                } catch (NotDefinedException e) {
-                       EditorUtil.warn(getClass(), "Command name not set");
+                       MessagingUtils.warn(getClass(), "Command name not set");
                }
                
                return null;
index bc5a8eb654d170c85e8b185fb0c97036feccff67..b9a93dfde227c94f2c0829ea7809d355611be7eb 100644 (file)
@@ -28,6 +28,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.DeleteConceptRelationOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -70,7 +71,7 @@ public class DeleteConceptRelationHandler extends AbstractHandler {
                                        editor.getUndoContext(), editor.getTaxon(), relations, postOperationEnabled);
                        EditorUtil.executeOperation(operation);
                } catch (NotDefinedException e) {
-                       EditorUtil.warn(getClass(), "Command name not set");
+                       MessagingUtils.warn(getClass(), "Command name not set");
                }
                
                return null;
index 502d9b94b0573e58905e5895fc4f77ad2f5eae29..dcc1b44fb8b835b25beeaae23b82133e1a3d514b 100644 (file)
@@ -24,6 +24,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * @author n.hoffmann
@@ -53,7 +54,7 @@ public class OpenRelatedConceptHandler extends AbstractHandler {
                                        try {
                                                EditorUtil.openTaxonBase(relatedTaxon.getUuid());
                                        } catch (PartInitException e) {
-                                               EditorUtil.errorDialog("Could not open taxon", getClass(), 
+                                               MessagingUtils.messageDialog("Could not open taxon", getClass(), 
                                                                String.format("Could not open the taxon: %s" ,relatedTaxon), e);
                                        }
                                }
index 6e460a71995d208f712b487043f934c9ddd899cf..9cf41e4d99770e6b5a4c7da6e22002412920e257 100644 (file)
@@ -82,6 +82,7 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
      */
     @Override
     public void setFocus() {
+        tableViewer.getControl().setFocus();
         //make sure to bind again if maybe in another view the conversation was unbound
         if(!conversation.isBound()){
             conversation.bind();
index c5745650597dc1fd1140dbc9c5b150ec742ed1bf..e5cf609ec1f1b0107d1390e490281e41dfe9a094 100644 (file)
@@ -1409,6 +1409,14 @@ public class TransientTaxonService implements ITaxonService {
                return defaultTaxonService.findWithoutFlush(uuid);
        }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaByName(eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator)
+     */
+    @Override
+    public List<TaxonBase> findTaxaByName(MatchingTaxonConfigurator config) {
+        return defaultTaxonService.findTaxaByName(config);
+    }
+
 
 
 
index 72debf1d133f1571d3c38336b139a185d00fec4d..c597eca6c8d21910272feb68ca94b23a994d7b54 100644 (file)
@@ -15,7 +15,7 @@ import org.eclipse.swt.dnd.DragSourceAdapter;
 import org.eclipse.swt.dnd.DragSourceEvent;
 
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * @author pplitzner
@@ -51,7 +51,7 @@ public class DerivateDragListener extends DragSourceAdapter{
     public void dragStart(DragSourceEvent event) {
         if(derivateView.isDirty()){
             event.doit = false;
-            AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+            MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
             return;
         }
         ISelection selection = derivateView.getViewer().getSelection();
index 3849041811b1790ec1e068a27f433a4c8837b1bb..66bcff1ec2be4fa0340d97b32995cdb842b4b70f 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
 
@@ -49,7 +49,7 @@ public class DerivateDropListener extends ViewerDropAdapter {
     @Override
     public boolean performDrop(Object data) {
         if(derivateView.isDirty()){
-            AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+            MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
             return false;
         }
         Object target = getCurrentTarget();
@@ -76,7 +76,7 @@ public class DerivateDropListener extends ViewerDropAdapter {
                     return true;
                 }
                 else{
-                    AbstractUtility.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+DerivateLabelProvider.getDerivateText(draggednode)+"\" to \""+DerivateLabelProvider.getDerivateText(targetNode)+"\" is not possible!");
+                    MessagingUtils.warningDialog("Moving derivate not possible!", derivateView, "Moving \""+DerivateLabelProvider.getDerivateText(draggednode)+"\" to \""+DerivateLabelProvider.getDerivateText(targetNode)+"\" is not possible!");
                 }
             }
         }
index bab27cfed83353fb37aa25949f082ea979737abf..90fc97eeb9c9f4fdb5297f5594529e3a05556bff 100644 (file)
@@ -195,6 +195,7 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
      */
     @Override
     public void setFocus() {
+        viewer.getControl().setFocus();
         //make sure to bind again if maybe in another view the conversation was unbound
         if(!conversation.isBound()){
             conversation.bind();
index 71abe76c56f284112e69140553901953e175f0ef..18f89f0f035806eeb6dfc9511315a88db8a7bd91 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -70,7 +70,7 @@ public class DerivateViewEditorInput implements IEditorInput, IPersistable {
             }
         }
         if(root==null){
-            AbstractUtility.errorDialog("Failed initializing editor", DerivateViewEditorInput.class, "No root element found!");
+            MessagingUtils.messageDialog("Failed initializing editor", DerivateViewEditorInput.class, "No root element found!");
         }
     }
 
index 3b8caea01275b1a8c48e14c24c5904372cdced7c..b3164a4586ad66bf81e18c829ad23aff663db6ef 100644 (file)
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -100,7 +100,7 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
             switch (commandType) {
             case REMOVE_FROM_SEQUENCE:
                 if(activeEditor.isDirty()){
-                    AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
                     return;
                 }
                 if(selectedTreeNode!=null && selectedTreeNode.getParent()!=null &&
@@ -118,7 +118,7 @@ public class SingleReadSequenceContextMenu extends CompoundContributionItem {
                 break;
             case ADD_TO_SEQUENCE:
                 if(activeEditor.isDirty()){
-                    AbstractUtility.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
+                    MessagingUtils.warningDialog("View has unsaved changes", this, "You need to save before performing this action");
                     return;
                 }
                 if(clipBoardTreeNode!=null && clipBoardTreeNode.getValue() instanceof SingleRead
index ce60deeca9b8383cce8cc3a4143f9be8e41247bd..488cc775b7e87432c1332de543d7ed07c623d6cd 100644 (file)
@@ -22,8 +22,8 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * @author n.hoffmann
@@ -54,7 +54,7 @@ public class DescriptionElementDropAdapter extends ViewerDropAdapter {
                // cannot drop a feature node onto itself
                for (Object droppedElement : droppedElements) {                 
                        if (droppedElement == null){
-                               StoreUtil.warningDialog("Operation not supported yet", this, "We are currently unable to drag and drop a newly created element. Please save the editor to make this work.");
+                               MessagingUtils.warningDialog("Operation not supported yet", this, "We are currently unable to drag and drop a newly created element. Please save the editor to make this work.");
                                return false;
                        }
                        if(! (droppedElement instanceof DescriptionElementBase)){
index b912c7d97873c12f1da9b37d84531810ddb6821e..ae0b59688e609d8035352d2fd3dbf4b6692a9ed1 100644 (file)
@@ -41,7 +41,9 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.IDescribable;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -152,7 +154,7 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
 
        /** {@inheritDoc} */
        @Override
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+    protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
                if(AbstractUtility.getActiveEditor() == null){
                        showEmptyPage();
                        return;
@@ -172,7 +174,12 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                        selection = new StructuredSelection(treeNodeOfSelection.getValue());
                    }
                }
-
+        else if(part instanceof ChecklistEditor){
+            if(selection instanceof StructuredSelection  && ((IStructuredSelection) selection).getFirstElement() instanceof Taxon){
+                Taxon taxon = (Taxon)((IStructuredSelection) selection).getFirstElement();
+                selection = new StructuredSelection(taxon);
+            }
+        }
                if(selection instanceof IStructuredSelection
                        && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
                        && part instanceof IPartContentHasFactualData){
index d8b1bf94b9f529c23c2bbc1ae8f0cfbebcfdb9e5..85d0ede84eb8b27d39a851ea4ec41d71b74e4ab3 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -76,10 +77,10 @@ public class CreateDescriptionElementHandler extends AbstractHandler {
                 operation = operationCreationInstance(event.getCommand().getName(), event, description, postOperationEnabled);
                 AbstractUtility.executeOperation(operation);
             } catch (NotDefinedException e) {
-                AbstractUtility.warn(getClass(), "Command name not set");
+                MessagingUtils.warn(getClass(), "Command name not set");
             }
         } else {
-            AbstractUtility.error(getClass(), new IllegalArgumentException("Could not determine the taxon description"));
+            MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description"));
             return null;
         }
         return null;
index 165205e2ed8f0e62dca3e08bdffba976e115eb6f..2f33924064864a8392e22b8b7f3951672c5fda8f 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -62,7 +63,7 @@ public class CreateDescriptionHandler extends AbstractHandler {
                            operation = createTaxonOperation(event.getCommand().getName(), taxon, postOperationEnabled);
                                AbstractUtility.executeOperation(operation);
                        } catch (NotDefinedException e) {
-                               AbstractUtility.warn(getClass(), "Command name not set.");
+                               MessagingUtils.warn(getClass(), "Command name not set.");
                        }
                }
                // specimen description
@@ -73,7 +74,7 @@ public class CreateDescriptionHandler extends AbstractHandler {
                            operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled);
                            AbstractUtility.executeOperation(operation);
                        } catch (NotDefinedException e) {
-                           AbstractUtility.warn(getClass(), "Command name not set.");
+                           MessagingUtils.warn(getClass(), "Command name not set.");
                        }
                    }
                }
index ce6aaef14301ada49c906c784b737f39f4150dc7..753f38769c7d592ed1b4765bd83803b71fe8ff17 100644 (file)
@@ -32,6 +32,7 @@ import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptio
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteTaxonDescriptionOperation;
 import eu.etaxonomy.taxeditor.editor.view.media.operation.DeleteMediaOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -92,7 +93,7 @@ public class DeleteHandler extends AbstractHandler {
                                        operations.add(new DeleteMediaOperation(label, undoContext, imageGallery, (Media) object, postOperationEnabled));
                                }
                                else{
-                                       EditorUtil.error(getClass(), "Selection is not valid for this delete handler", null);
+                                       MessagingUtils.error(getClass(), "Selection is not valid for this delete handler", null);
                                }       
                        }
                        
@@ -102,7 +103,7 @@ public class DeleteHandler extends AbstractHandler {
                        }
                        
                } catch (NotDefinedException e) {
-                       EditorUtil.warn(getClass(), "Command name not set.");
+                       MessagingUtils.warn(getClass(), "Command name not set.");
                }
                
                
index 7c3a65669a66ab367ac873fafb7c3083510c8209..d67e421692702c5a30d7b73989cc1c465d661d94 100644 (file)
@@ -33,6 +33,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -122,7 +123,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                                        handlerService.executeCommand(
                                                        CreateDescriptionElementOperation.ID, event);
                                } catch (Exception e) {
-                                       EditorUtil.error(getClass(), e);
+                                       MessagingUtils.error(getClass(), e);
                                }
                        }
                });
index 2ccfea94774506665600a3386c94ae94e2af9a57..0c2306ba6081a6da06c1e32e6b2dedc3cd552664 100644 (file)
@@ -34,6 +34,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -104,7 +105,7 @@ public class MoveDescriptionElementsHandler extends AbstractHandler {
                                CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
                                
                        } catch (NotDefinedException e) {
-                               EditorUtil.error(getClass(), e);
+                               MessagingUtils.error(getClass(), e);
                        }
                }
                
index 945af220e58d31f4733deda4aacfa0cc2350874d..726b217db43996520759c42b9f3306456d301c96 100644 (file)
@@ -33,6 +33,7 @@ import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 //import eu.etaxonomy.taxeditor.navigator.operation.ChangeAcceptedTaxonToSynonymOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
@@ -128,10 +129,10 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
                                        }
                                        EditorUtil.openTaxonNode(newAcceptedTaxonNodeUuid);
                                } catch (PartInitException e) {
-                                       EditorUtil.error(this.getClass(), e);
+                                       MessagingUtils.error(this.getClass(), e);
                                        throw new RuntimeException(e);
                                } catch (Exception e) {
-                                       EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+                                       MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                                }
                        }
                        
index 195e3d715e9d6064452f9811bdbbc2a9d258e28c..ed86d4b2b6a9dc7d0590651fcb48f6d0d89a3821 100644 (file)
@@ -17,9 +17,9 @@ import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>DeleteDescriptionElementOperation class.</p>
@@ -62,7 +62,7 @@ public class DeleteDescriptionElementOperation extends AbstractPostTaxonOperatio
                
                // Remove element from description
                if (description == null) {
-                       StoreUtil.error(this.getClass(), "Couldn't find element's description!", null);
+                       MessagingUtils.error(this.getClass(), "Couldn't find element's description!", null);
                } else {
                        description.removeElement(element);
                }
index c2607953e5564a40bbbc9bcb7b7f0fac538a3270..5e22395994911bd4e22815af039833f0303b36dd 100644 (file)
@@ -7,7 +7,7 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.core.commands.ExecutionException;\r
 \r
-import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 \r
 /**\r
  * @author n.hoffmann\r
@@ -20,7 +20,7 @@ public class EditInXper2Handler extends AbstractHandler {
         */\r
        @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               EditorUtil.warningDialog("Operation not supported yet", getClass(), "This operation is not supported yet.");\r
+               MessagingUtils.warningDialog("Operation not supported yet", getClass(), "This operation is not supported yet.");\r
                return null;\r
        }\r
 \r
index bddcfbfea2434d6489214201d86b576d7ba571e0..751b345455d5e526ec16855d904121b747dab9e1 100644 (file)
@@ -27,8 +27,8 @@ import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>MediaContentProvider class.</p>
@@ -47,7 +47,7 @@ public class MediaContentProvider implements ITreeContentProvider{
                if (parentElement instanceof TaxonEditorInput) {
                        Taxon taxon = ((TaxonEditorInput) parentElement).getTaxon();
                        if(taxon == null){
-                               EditorUtil.error(getClass(), "Taxon is null", null);
+                               MessagingUtils.error(getClass(), "Taxon is null", null);
                                return NO_CHILDREN;
                        }
                        HashSet<DescriptionBase> imageGalleries = new HashSet<DescriptionBase>();
@@ -85,7 +85,7 @@ public class MediaContentProvider implements ITreeContentProvider{
                                return derivedUnitFacadeImageGalleries.toArray();
                                
                        } catch (DerivedUnitFacadeNotSupportedException e) {
-                               EditorUtil.error(this.getClass(), "DerivedUnitFacadeNotSupportedException when trying to instantiate DerivedUnitFacade", e);
+                               MessagingUtils.error(this.getClass(), "DerivedUnitFacadeNotSupportedException when trying to instantiate DerivedUnitFacade", e);
                        }
                }
                
@@ -123,7 +123,7 @@ public class MediaContentProvider implements ITreeContentProvider{
                if (elements != null) {
                        // by definition, image galleries have only one description element
                        if(elements.size() > 1){
-                               EditorUtil.error(this.getClass(), "There should be one and only one description element to hold the images. Found: " + elements.size() + " InDescription ID: " + description.getUuid(), null);
+                               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);
                        }
                                                
                        DescriptionElementBase element = elements.iterator().next();
index d31371ff2b85847db8f3f4e4de74a23ba5b55af2..60270775d3c40a8cea92cbb478fc6f78d1741721 100644 (file)
@@ -1,9 +1,9 @@
 // $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.
 */
@@ -28,8 +28,8 @@ import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
@@ -47,7 +47,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.media";
 
        private TreeViewer viewer;
-       
+
        /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createViewer(org.eclipse.swt.widgets.Composite)
@@ -55,28 +55,28 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
        /** {@inheritDoc} */
        @Override
        public void createViewer(Composite parent) {
-               
+
                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);
-               
+
                // Propagate selection from viewer
                getSite().setSelectionProvider(viewer);
-               
+
                // Add context menu to tree
                MenuManager menuMgr = new MenuManager();
                menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
                getSite().registerContextMenu(menuMgr, viewer);
-               
+
                Control control = viewer.getControl();
                Menu menu = menuMgr.createContextMenu(control);
-               control.setMenu(menu);  
-               
+               control.setMenu(menu);
+
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
         */
@@ -85,18 +85,19 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
        protected ISelection getInitialSelection() {
                if(getEditor() != null){
                        return new StructuredSelection(getEditor().getEditorInput());
-               }       
-               
+               }
+
                return super.getInitialSelection();
        }
 
        /** {@inheritDoc} */
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-               if(EditorUtil.getActiveEditor() == null){
+       @Override
+    protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
+               if(AbstractUtility.getActiveEditor() == null){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof MultiPageTaxonEditor){
                        IEditorInput input = ((IEditorPart) part).getEditorInput();
                        showViewer(part, new StructuredSelection(input));
@@ -125,7 +126,8 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                return true;
        }
 }
index a18a10293bd6517d38003be5af1a29763df8bca7..2739b337ea410875b7f351fa4ee4b118988dfcf9 100644 (file)
@@ -16,6 +16,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -48,7 +49,7 @@ public class AddImageGalleryHandler extends AbstractHandler {
                                                EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
                                EditorUtil.executeOperation(operation);
                        } catch (NotDefinedException e) {
-                               EditorUtil.warn(getClass(), "Command name not set.");
+                               MessagingUtils.warn(getClass(), "Command name not set.");
                        }
                } 
                return null;
index a03c9a36357a82d31e46ee0617b25766f33b8af1..b2aeebf4d07ee6ae24f45116104f9b83ca95c771 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.view.media.operation.AddMediaToImageGalleryOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -67,7 +68,7 @@ public class CreateMediaHandler extends AbstractHandler {
                                                EditorUtil.getUndoContext(), description, postOperationEnabled);
                                EditorUtil.executeOperation(operation);
                        } catch (NotDefinedException e) {
-                               EditorUtil.warn(getClass(), "Command name not set.");
+                               MessagingUtils.warn(getClass(), "Command name not set.");
                        }
                }
                
index 7a183518dcdd4e0361b5385a7093bebe6a37ae8b..1dfa1451dbbcbadfe3f2342c1a6ddb337e79ea53 100644 (file)
@@ -22,6 +22,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.media.operation.RemoveImageFromDescriptionElementOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -70,7 +71,7 @@ public class DeleteMediaHandler extends AbstractHandler {
                                                        EditorUtil.getUndoContext(), taxon, image, element, postOperationEnabled);
                                        EditorUtil.executeOperation(operation);
                                } catch (NotDefinedException e) {
-                                       EditorUtil.warn(getClass(), "Command name not set.");
+                                       MessagingUtils.warn(getClass(), "Command name not set.");
                                }
                        }
                }
index 67726fdf57e0767bd040d42f60451b848b61d4ef..eb01f8d5a8e527fd48379cf836ffa98cb12b8327 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.media.operation.MoveMediaInListOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -75,7 +76,7 @@ public class MoveImageDownInListHandler extends AbstractHandler {
                                                        EditorUtil.getUndoContext(), taxon, description, media, MoveMediaInListOperation.DOWN, postOperationEnabled);
                                        EditorUtil.executeOperation(operation);
                                } catch (NotDefinedException e) {
-                                       EditorUtil.warn(getClass(), "Command name not set.");
+                                       MessagingUtils.warn(getClass(), "Command name not set.");
                                }
                        }
                } 
index 2550661c5feee6f1e9b5ced0a0a4bc06d1d69fde..e5bbff375f5bb70a0be4e08341bd3139dd1cd441 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.media.operation.MoveMediaInListOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
@@ -74,7 +75,7 @@ public class MoveImageUpInListHandler extends AbstractHandler {
                                                        EditorUtil.getUndoContext(), taxon, element, media, MoveMediaInListOperation.UP, postOperationEnabled);
                                        EditorUtil.executeOperation(operation);
                                } catch (NotDefinedException e) {
-                                       EditorUtil.warn(getClass(), "Command name not set.");
+                                       MessagingUtils.warn(getClass(), "Command name not set.");
                                }
                        }
                } 
index 667598736fd8097a10c6c1feb740d5e59d546541..1b02b432cd60b3e2203021a805fd8630968203b4 100644 (file)
@@ -23,9 +23,9 @@ import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>MoveMediaInListOperation class.</p>
@@ -107,7 +107,7 @@ public class MoveMediaInListOperation extends AbstractPostTaxonOperation {
                Set<DescriptionElementBase> elements = description.getElements();
                
                if(elements.size() != 1){
-                       StoreUtil.error(this.getClass(), "More than one description element in this image gallery", null);
+                       MessagingUtils.error(this.getClass(), "More than one description element in this image gallery", null);
                }
                
                DescriptionElementBase element = elements.iterator().next();
@@ -125,7 +125,7 @@ public class MoveMediaInListOperation extends AbstractPostTaxonOperation {
                        try{
                                Collections.swap(medias, newIndex, index);
                        }catch(ArrayIndexOutOfBoundsException e){
-                               StoreUtil.error(this.getClass(), e);
+                               MessagingUtils.error(this.getClass(), e);
                        }
                }       
        }
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..402c877
--- /dev/null
@@ -0,0 +1,42 @@
+#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
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties
new file mode 100644 (file)
index 0000000..c6c5e34
--- /dev/null
@@ -0,0 +1,42 @@
+#Properties file for eu.etaxonomy.taxeditor.navigation\r
+view.name = Suchergebnis\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 = 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.8 = Importieren\r
+command.label.9 = Exportieren\r
+command.label.10 = L\u00F6schen\r
+command.label.11 = Aktualisieren\r
+command.label.12 = Kopieren\r
+command.label.13 = Taxon\r
+command.label.14 = Klassifikation\r
+command.label.15 = Neu\r
+command.label.16 = Bearbeiten\r
+menu.label.0 = Aktualisieren\r
+command.label.17 = Liste\r
+command.label.18 = Key Nodes\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
+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
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_en.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_en.properties
new file mode 100644 (file)
index 0000000..402c877
--- /dev/null
@@ -0,0 +1,42 @@
+#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
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties
new file mode 100644 (file)
index 0000000..571b000
--- /dev/null
@@ -0,0 +1,10 @@
+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
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties
new file mode 100644 (file)
index 0000000..314ea1b
--- /dev/null
@@ -0,0 +1,10 @@
+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_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
+SearchBar_9=Umgangsprachliche Namen\r
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_en.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_en.properties
new file mode 100644 (file)
index 0000000..571b000
--- /dev/null
@@ -0,0 +1,10 @@
+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
index 0699eecc070b32902c6e0d8cfca6254459f7e2ba..25703253efd9a9a42b013ca2503ad5b3bdc20152 100644 (file)
@@ -6,4 +6,6 @@ bin.includes = META-INF/,\
                .,\
                plugin.xml,\
                icons/,\
-               p2.inf
+               p2.inf,\
+               OSGI-INF/
+
index b4361204aff0dd7cd72ff2562221237d9c480e87..940095c9c62ec9ceb132fb2177d10368ae27743a 100644 (file)
@@ -17,7 +17,7 @@
             class="eu.etaxonomy.taxeditor.navigation.search.SearchResultView"
             icon="icons/system-search.png"
             id="eu.etaxonomy.taxeditor.navigation.search.searchResultView"
-            name="Search Result"
+            name="%view.name"
             restorable="false">
       </view>
       <view
             class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator"
             icon="icons/preferences-system-windows.png"
             id="eu.etaxonomy.taxeditor.navigation.navigator"
-            name="Taxon Navigator"
+            name="%view.name.0"
             restorable="true">
       </view>
       <view
             allowMultiple="false"
             class="eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart"
             id="eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart"
-            name="Polytomous Keys"
+            name="%view.name.1"
             restorable="true">
       </view>
    </extension>
@@ -53,7 +53,7 @@
             locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?before=eu.etaxonomy.taxeditor.editor.showViewMenu">
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Taxon Navigator"
+               label="%command.label"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
@@ -62,7 +62,7 @@
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
-               label="Polytomous Keys"
+               label="%command.label.0"
                style="push">
             <parameter
                   name="org.eclipse.ui.views.showView.viewId"
@@ -74,7 +74,7 @@
             locationURI="popup:eu.etaxonomy.taxeditor.navigation.search.searchResultView">
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.command.editTaxon"
-               label="Edit"
+               label="%command.label.1"
                style="push">
          </command>
       </menuContribution>
             locationURI="popup:eu.etaxonomy.taxeditor.navigation.navigatorpopup">
          <menu
                id="eu.etaxonomy.navigation.menu.new"
-               label="New">
+               label="%menu.label">
             <command
                   commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
-                  label="Taxon"
+                  label="%command.label.2"
                   style="push">
             </command>
             <separator
             <command
                   commandId="eu.etaxonomy.taxeditor.navigation.create.classification"
                   id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
-                  label="Classification"
+                  label="%command.label.3"
                   style="push">
             </command>
          </menu>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
+               icon="icons/edit_16x16.gif"
+               label="%command.label.4"
+               style="push">
+           <visibleWhen
+                 checkEnabled="true">
+              <and>
+                 <reference
+                       definitionId="isChecklistEditorEnabled">
+                 </reference>
+                 <or>
+                    <reference
+                          definitionId="isClassification">
+                    </reference>
+                    <reference
+                          definitionId="isTaxonNode">
+                    </reference>
+                 </or>
+              </and>
+            </visibleWhen>
+         </command>
          <separator
                name="taxeditor-navigation.separator1"
                visible="true">
          </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"
-               label="Edit"
+               label="%command.label.5"
                style="push">       
             <visibleWhen
                   checkEnabled="true">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
-               label="Change Accepted Taxon to Synonym"
+               label="%command.label.6"
                style="push">
                <visibleWhen
                   checkEnabled="true">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.command.update.moveTaxon"
-               label="Move Taxon (with child taxa)"
+               label="%command.label.7"
                style="push">
             <visibleWhen
                   checkEnabled="true">
          </command-->
          <command
                commandId="org.eclipse.ui.file.import"
-               label="Import..."
+               label="%command.label.8"
                style="push">
          </command>
          <command
                commandId="org.eclipse.ui.file.export"
-               label="Export..."
+               label="%command.label.9"
                style="push">
          </command>
          <separator
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.10"
                style="push">
             <visibleWhen>
                <not>
          </separator>
          <command
                commandId="org.eclipse.ui.file.refresh"
-               label="Refresh"
+               label="%command.label.11"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.command.copyTaxonName"
-               label="Copy"
+               label="%command.label.12"
                style="push">
          </command>
       </menuContribution>
       <menuContribution
             locationURI="menu:eu.etaxonomy.navigation.menu.new">
          <command
-               commandId="eu.etaxonomy.taxeditor.navigation.create.classification"
-               id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
-               label="Classification"
+               commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
+               label="%command.label.13"
                style="push">
          </command>
          <separator
-               name="eu.etaxonomy.navigation.menu.new.separator0"
+               name="eu.etaxonomy.navigation.menu.new.separator1"
                visible="true">
          </separator>
          <command
-               commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
-               label="Taxon"
+               commandId="eu.etaxonomy.taxeditor.navigation.create.classification"
+               id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
+               label="%command.label.14"
                style="push">
          </command>
-         <separator
-               name="eu.etaxonomy.navigation.menu.new.separator1"
-               visible="true">
-         </separator>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart">
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.newKey"
-               label="New"
+               label="%command.label.15"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes"
-               label="Edit"
+               label="%command.label.16"
                style="push">
          </command>
          <menu
-               label="Refresh">
+               label="%menu.label.0">
             <command
                   commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyList"
-                  label="List"
+                  label="%command.label.17"
                   style="push">
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyNodes"
-                  label="Key Nodes"
+                  label="%command.label.18"
                   style="push">
             </command>
          </menu>
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.19"
                style="push">
          </command>
          
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.NewTaxonNodeHandler"
             id="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
-            name="New Taxon Node">
+            name="%command.name">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.NewClassificationHandler"
             id="eu.etaxonomy.taxeditor.navigation.create.classification"
-            name="New Classification">
+            name="%command.name.0">
       </command>
    </extension>
    <extension
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.EditHandler"
             id="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"
-            name="Edit">
+            name="%command.name.1">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.MoveTaxonHandler"
             id="eu.etaxonomy.taxeditor.navigation.command.update.moveTaxon"
-            name="Move Taxon">
+            name="%command.name.2">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.RefreshTreeHandler"
             id="org.eclipse.ui.file.refresh"
-            name="Refresh">
+            name="%command.name.3">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.CopyHandler"
             id="eu.etaxonomy.taxeditor.navigation.command.copyTaxonName"
-            name="Copy">
+            name="%command.name.4">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.ChangeAcceptedTaxonToSynonymHandler"
             id="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
-            name="Change Accepted Taxon to Synonym">
+            name="%command.name.5">
       </command>
    </extension>
    <extension
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.NewPolytomousKeyHandler"
             id="eu.etaxonomy.taxeditor.navigation.key.polytomous.newKey"
-            name="New Polytomous Key">
+            name="%command.name.6">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.EditPolytomousKeyNodesHandler"
             id="eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes"
-            name="Edit Polytomous Key Nodes">
+            name="%command.name.7">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RefreshPolytomousKeyListHandler"
             id="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyList"
-            name="Refresh Polytomous Key List">
+            name="%command.name.8">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RefreshPolytomousKeyNodesHandler"
             id="eu.etaxonomy.taxeditor.navigation.key.polytomous.refreshKeyNodes"
-            name="Refresh Polytomous Key Nodes">
+            name="%command.name.9">
       </command>
    </extension>
    <extension
             class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator"
             icon="icons/edit_16x16.gif"
             id="eu.etaxonomy.taxeditor.navigation.navigator"
-            name="Taxonomic Tree"/>
+            name="%view.name.2"/>
    </extension>
    <extension
          point="org.eclipse.ui.navigator.navigatorContent">
             contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationContentProvider"
             id="eu.etaxonomy.taxeditor.navigation.classificationContent"
             labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationLabelProvider"
-            name="Classification">
+            name="%navigatorContent.name">
          <triggerPoints>
             <instanceof
                   value="eu.etaxonomy.taxeditor.navigation.navigator.Root">
             contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeContentProvider"
             id="eu.etaxonomy.taxeditor.navigation.taxonNodeContent"
             labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeLabelProvider"
-            name="TaxonNode">
+            name="%navigatorContent.name.0">
          <triggerPoints>
             <or>
                <instanceof
                </instanceof>
                <and>
                   <instanceof
-                     value="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
+                     value="eu.etaxonomy.cdm.model.taxon.Classification">
                   </instanceof>
                   <test
                      forcePluginActivation="true"
                         value="eu.etaxonomy.cdm.model.taxon.TaxonNode">
                   </instanceof>
                   <instanceof
-                        value="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
+                        value="eu.etaxonomy.cdm.model.taxon.Classification">
                   </instanceof>
                </or>
             </possibleDropTargets>
             contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymContentProvider"
             id="eu.etaxonomy.taxeditor.navigation.synonymContent"
             labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymLabelProvider"
-            name="Synonyms (experimental)"
+            name="%navigatorContent.name.1"
             priority="highest">
          <triggerPoints>
             <and>
          </adapter>
       </factory>
    </extension>
-   <extension
+      <extension
          point="org.eclipse.core.expressions.propertyTesters">
       <propertyTester
             class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester"
             properties="hasTaxa"
             type="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
       </propertyTester>
+      <propertyTester
+            class="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodePropertyTester"
+            id="eu.etaxonomy.taxeditor.propertytests.navigatorPropertyTester"
+            namespace="eu.etaxonomy.taxeditor.propertytests"
+            properties="hasTaxa"
+            type="eu.etaxonomy.cdm.model.taxon.Classification">
+      </propertyTester>
+   <propertyTester
+         class="eu.etaxonomy.taxeditor.preference.PreferencePropertyTester"
+         id="eu.etaxonomy.taxeditor.preferences.propertyTester"
+         namespace="eu.etaxonomy.taxeditor.preferences.propertyTester"
+         properties="isChecklistEditorEnabled"
+         type="org.eclipse.jface.viewers.IStructuredSelection">
+   </propertyTester>
    </extension>
    <extension
          point="org.eclipse.core.expressions.definitions">
             id="isTaxonNode">
          <with
                variable="selection">
-            <iterate>
+            <iterate
+                  ifEmpty="false">
                <instanceof
                      value="eu.etaxonomy.cdm.model.taxon.TaxonNode">
                </instanceof>
          </with>
       </definition>
       <definition
-            id="isTaxonomicTree">
+            id="isSynonymNode">
          <with
                variable="selection">
-            <iterate>
+            <iterate
+                  ifEmpty="false">
                <instanceof
-                     value="eu.etaxonomy.cdm.model.taxon.TaxonomicTree">
+                     value="eu.etaxonomy.cdm.model.taxon.Synonym">
                </instanceof>
             </iterate>
          </with>
       </definition>
       <definition
-            id="isSynonymNode">
+            id="isClassification">
          <with
                variable="selection">
-            <iterate>
+            <iterate
+                  ifEmpty="false">
                <instanceof
-                     value="eu.etaxonomy.cdm.model.taxon.Synonym">
+                     value="eu.etaxonomy.cdm.model.taxon.Classification">
                </instanceof>
             </iterate>
          </with>
       </definition>
+      <definition
+            id="isChecklistEditorEnabled">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.preferences.propertyTester.isChecklistEditorEnabled">
+            </test>
+         </with>
+      </definition>
    </extension>
 </plugin>
index 7ea9ed09d861b2ba5c606f843a76f140eb397994..ab46175b11a6c98cc0369d4a27a6caa82713945c 100644 (file)
@@ -40,6 +40,7 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 
@@ -64,13 +65,13 @@ public class NavigationUtil extends AbstractUtility{
                try {
                        handlerService.executeCommand(commandId, null);
                } catch (ExecutionException e) {
-                       AbstractUtility.error(NavigationUtil.class, e);
+                       MessagingUtils.error(NavigationUtil.class, e);
                } catch (NotDefinedException e) {
-                       AbstractUtility.error(NavigationUtil.class, e);
+                       MessagingUtils.error(NavigationUtil.class, e);
                } catch (NotEnabledException e) {
-                       AbstractUtility.error(NavigationUtil.class, e);
+                       MessagingUtils.error(NavigationUtil.class, e);
                } catch (NotHandledException e) {
-                       AbstractUtility.error(NavigationUtil.class, e);
+                       MessagingUtils.error(NavigationUtil.class, e);
                }
        }
 
@@ -88,16 +89,16 @@ public class NavigationUtil extends AbstractUtility{
                                EditorUtil.openTaxonBase(entityUuid);
                        }else if(selectedObject instanceof TaxonNameBase){
                                // TODO open bulk editor
-                               warningDialog("Not implemented yet", NavigationUtil.class, "You tried to open a name. This is not handled by the software yet.");
+                               MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "You tried to open a name. This is not handled by the software yet.");
                        }else if(selectedObject instanceof PolytomousKey){
                                EditorUtil.openPolytomousKey(entityUuid);
                        }else{
-                               warningDialog("Unsupported Type", NavigationUtil.class, "No editor exists for the current selection: " + selectedObject);
+                               MessagingUtils.warningDialog("Unsupported Type", NavigationUtil.class, "No editor exists for the current selection: " + selectedObject);
                        }
                } catch (PartInitException e) {
-                       AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
+                       MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
                } catch (Exception e) {
-                       AbstractUtility.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
+                       MessagingUtils.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
                }
        }
 
@@ -108,13 +109,13 @@ public class NavigationUtil extends AbstractUtility{
                                try {
                                        EditorUtil.openTaxonBase(((UuidAndTitleCache) selectedObject).getUuid());
                                } catch (PartInitException e) {
-                                       AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
+                                       MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
                                }
                        }
                }else if(selectedObject instanceof ICdmBase){
                        openEditor((ICdmBase) selectedObject);
                }else{
-                       AbstractUtility.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
+                       MessagingUtils.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
                }
        }
 
@@ -127,7 +128,7 @@ public class NavigationUtil extends AbstractUtility{
                try {
                        EditorUtil.openEmpty(parentNodeUuid);
                } catch (PartInitException e) {
-                       AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
+                       MessagingUtils.error(NavigationUtil.class, "Error opening the editor", e);
                }
        }
 
@@ -196,7 +197,7 @@ public class NavigationUtil extends AbstractUtility{
                                        }
                                }
                        } catch (PartInitException e) {
-                               AbstractUtility.error(NavigationUtil.class, e.getMessage(), e);
+                               MessagingUtils.error(NavigationUtil.class, e.getMessage(), e);
                                throw new RuntimeException(e);
                        }
 
@@ -248,7 +249,7 @@ public class NavigationUtil extends AbstractUtility{
                        handleOpeningOfMultipleTaxa(synonym.getAcceptedTaxa());
 
                }else{
-                       warningDialog("Not implemented yet", NavigationUtil.class, "You chose to open a name that has no connection to a taxon. The Editor does not support editing of such a content type at the moment.");
+                       MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "You chose to open a name that has no connection to a taxon. The Editor does not support editing of such a content type at the moment.");
                }
 
        }
@@ -258,11 +259,11 @@ public class NavigationUtil extends AbstractUtility{
                        openEditor(acceptedTaxa.iterator().next());
                }else if(acceptedTaxa.size() > 1){
                        // FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
-                       warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
+                       MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
                                        " This case is not handled yet by the software.");
                }else if(acceptedTaxa.size() == 0){
                        // this is an undesired state
-                       warningDialog("Not implemented yet", NavigationUtil.class, "This taxon is not connected to a classification. Currently editing of such taxa is not supported yet.");
+                       MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "This taxon is not connected to a classification. Currently editing of such taxa is not supported yet.");
                }
        }
 
@@ -276,11 +277,11 @@ public class NavigationUtil extends AbstractUtility{
                        openEditor(taxonNodes.iterator().next());
                }else if(taxonNodes.size() > 1){
                        // FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
-                       warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
+                       MessagingUtils.warningDialog("Not implemented yet", NavigationUtil.class, "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
                                        " This case is not handled yet by the software.");
                }else if(taxonNodes.size() == 0){
                        // this is an undesired state
-                       warningDialog("Incorrect state", NavigationUtil.class, "The accepted taxon is not in a taxonomic view. This should not have happened.");
+                       MessagingUtils.warningDialog("Incorrect state", NavigationUtil.class, "The accepted taxon is not in a taxonomic view. This should not have happened.");
                }
        }
 
index 36c455e9e853031021ef04e8981b444883196e66..6075a5062f122bba9aaa72f6a72341269d26685e 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.navigation.key.polytomous;
 
@@ -14,7 +14,6 @@ import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;
 import org.eclipse.swt.SWT;
@@ -43,7 +42,7 @@ import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IContextListener;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -63,28 +62,28 @@ public class PolytomousKeyViewPart extends ViewPart implements
                                @Override
                                public boolean select(Viewer viewer, Object parentElement,
                                                Object element) {
-                                       
+
                                        if(element instanceof PolytomousKey){
                                                PolytomousKey key = (PolytomousKey) element;
                                                if(key.getTitleCache().contains(text_filter.getText())){
                                                        return true;
                                                }
                                        }
-                                       
+
                                        return false;
                                }
-                               
+
                        };
-                       
+
                        viewer.setFilters(new ViewerFilter[]{filter});
                }
        }
-       
-       
+
+
        public static final String ID = "eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart";
 
        public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes";
-       
+
        private class ContextListener extends ContextListenerAdapter{
                /* (non-Javadoc)
                 * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
@@ -92,9 +91,11 @@ public class PolytomousKeyViewPart extends ViewPart implements
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Shutting down Polytomous Key Viewer");
-                       viewer.setInput(null);
+                       if(!viewer.getControl().isDisposed()){
+                           viewer.setInput(null);
+                       }
                }
-               
+
                /* (non-Javadoc)
                 * @see eu.etaxonomy.taxeditor.model.ContextListenerAdapter#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
                 */
@@ -104,7 +105,7 @@ public class PolytomousKeyViewPart extends ViewPart implements
                        setInput();
                }
        }
-       
+
        private ListViewer viewer;
        private ConversationHolder conversation;
        private IContextListener contextListener;
@@ -116,7 +117,7 @@ public class PolytomousKeyViewPart extends ViewPart implements
        public PolytomousKeyViewPart(){
                formFactory = new CdmFormFactory(Display.getDefault());
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
         */
@@ -125,77 +126,79 @@ public class PolytomousKeyViewPart extends ViewPart implements
 
                Composite container = new Composite(parent, SWT.NONE);
                container.setLayout(new GridLayout());
-               
+
                contextListener = new ContextListener();
                CdmStore.getContextManager().addContextListener(contextListener);
-               
+
                text_filter = formFactory.createText(container, "");
                text_filter.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
                text_filter.addModifyListener(new FilterModifyListener());
-               
+
                viewer = new ListViewer(container, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
                viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               
+
                viewer.setContentProvider(new PolytomousKeyContentProvider());
                viewer.setLabelProvider(new PolytomousKeyLabelProvider());
-               
+
                viewer.addDoubleClickListener(new IDoubleClickListener() {
-                       
+
                        @Override
-                       public void doubleClick(DoubleClickEvent event) {                               
+                       public void doubleClick(DoubleClickEvent event) {
                            openSelectedKeyNodes();
                        }
                });
-               
-               
+
+
                getSite().setSelectionProvider(viewer);
-                               
+
                createMenu();
-               
+
                if(CdmStore.isActive()){
                        setInput();
                }
        }
-       
+
        public void openSelectedKeyNodes() {
         ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class);
-        
-        Command command = commandService.getCommand(OPEN_COMMAND_ID); 
+
+        Command command = commandService.getCommand(OPEN_COMMAND_ID);
         if(command.isEnabled()) {
             IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
-            try {                
+            try {
                 handlerService.executeCommand(OPEN_COMMAND_ID, null);
             } catch (NotDefinedException e) {
                 throw new RuntimeException("Could not find open command: " + OPEN_COMMAND_ID);
             } catch (Exception e) {
-                NavigationUtil.error(getClass(), "An exception occured while trying to open a selection", e);
+                MessagingUtils.error(getClass(), "An exception occured while trying to open a selection", e);
             }
         }
        }
-       
-       public void setViewerSelection(ISelection selection, boolean reveal) {    
-           getSite().setSelectionProvider(viewer);         
-           viewer.setSelection(selection,reveal);          
-           viewer.getList().notifyListeners(SWT.Selection,new Event());            
+
+       public void setViewerSelection(ISelection selection, boolean reveal) {
+           getSite().setSelectionProvider(viewer);
+           viewer.setSelection(selection,reveal);
+           viewer.getList().notifyListeners(SWT.Selection,new Event());
        }
-       
+
        private void createMenu(){
                MenuManager menuManager = new MenuManager();
                menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-               
+
                getSite().registerContextMenu(menuManager, viewer);
-                               
+
                Control control = viewer.getControl();
                Menu menu = menuManager.createContextMenu(control);
-               
-               control.setMenu(menu);  
+
+               control.setMenu(menu);
        }
 
        private void setInput() {
                conversation = CdmStore.createConversation();
                conversation.registerForDataStoreChanges(this);
-               List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);                 
-               viewer.setInput(input);
+               List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
+               if(!viewer.getControl().isDisposed()){
+                   viewer.setInput(input);
+               }
        }
 
        /* (non-Javadoc)
@@ -205,7 +208,7 @@ public class PolytomousKeyViewPart extends ViewPart implements
        public void setFocus() {
                viewer.getControl().setFocus();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
         */
@@ -225,15 +228,17 @@ public class PolytomousKeyViewPart extends ViewPart implements
        public ConversationHolder getConversationHolder() {
                return conversation;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.WorkbenchPart#dispose()
         */
        @Override
        public void dispose() {
-               conversation.unregisterForDataStoreChanges(this);
-               conversation.close();
-               CdmStore.getContextManager().removeContextListener(contextListener);
+           if(conversation!=null){
+               conversation.unregisterForDataStoreChanges(this);
+               conversation.close();
+               CdmStore.getContextManager().removeContextListener(contextListener);
+           }
                super.dispose();
        }
 
@@ -255,16 +260,18 @@ public class PolytomousKeyViewPart extends ViewPart implements
        }
 
        /**
-        * 
+        *
         */
        public void refresh() {
                getConversationHolder().bind();
                //FIXME : Need to make sure this is a stable fix (ticket 3822)
                getConversationHolder().commit();
-               List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);                 
-               viewer.setInput(input);
+               List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
+               if(!viewer.getControl().isDisposed()){
+                   viewer.setInput(input);
+               }
        }
-       
+
        public List<PolytomousKey> getKeys() {
                return (List<PolytomousKey>)viewer.getInput();
        }
index ede0de647847c1f9670a21bb166d2ba9e1951577..faf141c73ba8ded1c2a973b3a72100bbf6fd2c64 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart;
 import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.DeleteOperation;
@@ -45,7 +46,7 @@ public class DeleteHandler extends AbstractHandler {
                        return null;
                }
                
-               boolean confirmation = NavigationUtil.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
+               boolean confirmation = MessagingUtils.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
                
                if(confirmation){
                
@@ -58,7 +59,7 @@ public class DeleteHandler extends AbstractHandler {
                                                        (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false));
                                        NavigationUtil.executeOperation(operation);
                                } catch (NotDefinedException e) {
-                                       NavigationUtil.error(getClass(), e);
+                                       MessagingUtils.error(getClass(), e);
                                }
                        }
                }
index a8b2d252326e8136bc24099fafb8127dbe717d3c..1d30e554f83d3011fc589edeaa8313451b48c384 100644 (file)
@@ -18,8 +18,8 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.navigator.ILinkHelper;
 
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * When a taxon is open in an editor and this editor has focus, its entry in the
@@ -56,7 +56,7 @@ public class TaxonLinkHelper implements ILinkHelper {
                                }
                        }
                } catch (Exception e) {
-                       EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+                       MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                }
        }
 
index 24157b3bc3b1542e34a4ed820a9bf57d56d8b2c2..2b910df22964e7d0cb72c498da42d2c875c092f4 100644 (file)
@@ -39,6 +39,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonComparatorSearch;
 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.store.CdmStore;
@@ -285,7 +286,7 @@ public class TaxonNavigator extends CommonNavigator implements
                                        path += ((CdmBase) segment).getUuid().toString() + " ";
                                        monitor.worked(1);
                                } else {
-                                       NavigationUtil.warn(getClass(),
+                                       MessagingUtils.warn(getClass(),
                                                        "Non-taxon tree path segment " + segment);
                                }
                        }
index eddf15d587a1a3dea682a023fa3b7796835a7856..c022ca4e2debf372e73797e8bb304967bc28da25 100644 (file)
@@ -25,7 +25,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.security.RequiredPermissions;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -59,17 +59,17 @@ public class TaxonNodeLabelProvider extends ColumnLabelProvider
                        try{
                                Taxon taxon = (Taxon) HibernateProxyHelper.deproxy(taxonNode.getTaxon());
                                if(taxon == null){
-                                       NavigationUtil.error(getClass(), "The taxon node does not have a taxon attached to it. Please check your import. TaxonNode: " + element, null);
+                                       MessagingUtils.error(getClass(), "The taxon node does not have a taxon attached to it. Please check your import. TaxonNode: " + element, null);
 //                                     throw new RuntimeException("The data your are trying to view is corrupt. Please check your import.");
                                }else{
                                        try{
                                                return taxon.getName() != null ? ((IIdentifiableEntity) HibernateProxyHelper.deproxy(taxon.getName())).getTitleCache() : new String();
                                        }catch(Exception e){
-                                               NavigationUtil.error(getClass(), e);
+                                               MessagingUtils.error(getClass(), e);
                                        }
                                }
                        }catch (LazyInitializationException e){
-                               NavigationUtil.error(getClass(), e);
+                               MessagingUtils.error(getClass(), e);
                        }
 
                }
index c376a5005ad5ba524526043e97b147b226a129ea..3763adc75f9daa0fa9295d72c26fe8ea89f4f38e 100644 (file)
@@ -34,6 +34,7 @@ import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.ChangeAcceptedTaxonToSynonymOperation;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation;
@@ -99,7 +100,7 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
                                
                                // check if taxon has no children
                                if(((TaxonNode)oldAcceptedTaxonNode).getCountChildren() > 0) {
-                                       EditorUtil.warningDialog("Prerequisite not met", this, 
+                                       MessagingUtils.warningDialog("Prerequisite not met", this, 
                                                        "The accepted taxon must not have any childen. You need to move all childen to " +
                                                        "another taxon node in the TaxonNavigator before attempting to turn the accepted " +
                                                        "taxon into a synonym.");
@@ -138,7 +139,7 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
                
        
                        } catch (NotDefinedException e) {
-                               NavigationUtil.warn(getClass(), "Command name not set");
+                               MessagingUtils.warn(getClass(), "Command name not set");
                        }
                } else{
                        if( MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Moving to synonymy", "The operation move accepted taxon to synonymy is available only for a single taxon.")){
@@ -168,10 +169,10 @@ public class ChangeAcceptedTaxonToSynonymHandler extends DeleteHandler
                                        }
                                        EditorUtil.openTaxonNode(newAcceptedTaxonNodeUuid);
                                } catch (PartInitException e) {
-                                       EditorUtil.error(this.getClass(), e);
+                                       MessagingUtils.error(this.getClass(), e);
                                        throw new RuntimeException(e);
                                } catch (Exception e) {
-                                       EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
+                                       MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
                                }
                        }
                        
index 7e0b59b635f615afae34a332deb3f4b465b5f330..5fe8df91e7172f12d9a911b2a49caa83c64d7d32 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;\r
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;\r
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.CopyOperation;\r
@@ -59,7 +60,7 @@ public class CopyHandler extends AbstractHandler implements IHandler {
                                        IStatus status = NavigationUtil.executeOperation(operation);\r
                                        \r
                                } catch (NotDefinedException e) {\r
-                                       NavigationUtil.warn(getClass(), "Command name not set");\r
+                                       MessagingUtils.warn(getClass(), "Command name not set");\r
                                }\r
                        }\r
                }\r
index ab4fc28ce2f08ef4ef55bd09bab5e59efd80b4ce..09c3f22daecbca943431234d7f3589eeca165cd8 100644 (file)
@@ -33,6 +33,7 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation;
@@ -116,7 +117,7 @@ public class DeleteHandler extends AbstractHandler implements IHandler{
                
        
                        } catch (NotDefinedException e) {
-                               NavigationUtil.warn(getClass(), "Command name not set");
+                               MessagingUtils.warn(getClass(), "Command name not set");
                        }
                } else{
                        try{
@@ -131,7 +132,7 @@ public class DeleteHandler extends AbstractHandler implements IHandler{
                                        NavigationUtil.executeOperation(operation);
                                }
                        }catch (NotDefinedException e) {
-                               NavigationUtil.warn(getClass(), "Command name not set");
+                               MessagingUtils.warn(getClass(), "Command name not set");
                        }
                }
                return null;
index 87df0560eeb31d7313dc83b478ea83196c7c670e..56ce064a52673e5c5558b88de653decdcac38c8b 100644 (file)
@@ -24,9 +24,9 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 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;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * Change the taxonomic parent of a given taxon.
@@ -91,7 +91,7 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
                                monitor.worked(2);
                        }
                } catch(IllegalAncestryException e) {
-                       StoreUtil.warningDialog("Illegal ancestry", this, e.getMessage());
+                       MessagingUtils.warningDialog("Illegal ancestry", this, e.getMessage());
                }
                monitor.worked(40);
 
@@ -115,7 +115,7 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               StoreUtil.warn(this.getClass(), "Not implemented yet.");
+               MessagingUtils.warn(this.getClass(), "Not implemented yet.");
 
                // iterate over oldParentTreeNodes, delete each TaxonNode from its actual parent and add to its former parent
 
index 98915188d46aafba3974f227add2b43d0c12f2c1..8b391876f1be3125b2d7227c94cef08589b70b5d 100644 (file)
@@ -23,11 +23,10 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 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.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>CreateTaxonNodeOperation class.</p>
@@ -100,7 +99,7 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
 
                        return postExecute(childTaxonNode);
                }catch(Exception e){
-                       NavigationUtil.errorDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
+                       MessagingUtils.messageDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
                        return Status.CANCEL_STATUS;
                }
        }
@@ -123,7 +122,7 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
 
-               StoreUtil.warn(this.getClass(), "Not yet implemented.");
+               MessagingUtils.warn(this.getClass(), "Not yet implemented.");
                return null;
        }
 }
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/Messages.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/Messages.java
new file mode 100644 (file)
index 0000000..5d3c21a
--- /dev/null
@@ -0,0 +1,38 @@
+// $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.navigation.search;\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 SearchBar_0;\r
+    public static String SearchBar_1;\r
+    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
+    public static String SearchBar_9;\r
+    static {\r
+        // initialize resource bundle\r
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);\r
+    }\r
+\r
+    private Messages() {\r
+    }\r
+}\r
index 347a5998770085ca81c1324af11cd7508e6e94a3..e27d247dd40c0cfef90dc3ce04919bea3fbcc0ff 100644 (file)
@@ -35,6 +35,7 @@ import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
 import org.eclipse.ui.swt.IFocusService;
 
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
@@ -53,7 +54,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
        private Text text_search;
        private String secondaryId;
 
-       private final String defaultText = "Use \"*\" for wildcard searching";
+       private final String defaultText = Messages.SearchBar_0;
 
        final private ConfigurationSelectionListener configurationListener = new ConfigurationSelectionListener();
 
@@ -89,7 +90,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                final ToolBar toolBar = new ToolBar(composite, SWT.NULL);
 
                ToolItem toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
-               toolItem.setText("Search");
+               toolItem.setText(Messages.SearchBar_1);
 
                DropdownSelectionListener dropdownListener = new DropdownSelectionListener(
                                toolItem);
@@ -177,7 +178,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                }
                
                if("*".equals(searchString.trim())){
-                       NavigationUtil.warningDialog("Could not execute search", this, "Please type at least one character when using the \"*\" wildcard.");
+                       MessagingUtils.warningDialog(Messages.SearchBar_2, this, Messages.SearchBar_3);
                        return;
                }
                
@@ -214,7 +215,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                                                        IWorkbenchPage.VIEW_ACTIVATE);
                        ((SearchResultView) resultsView).performSearch(configurator);
                } catch (PartInitException e) {
-                       NavigationUtil.error(this.getClass(), "Error opening search result.", e);
+                       MessagingUtils.error(this.getClass(), Messages.SearchBar_4, e);
                }
        }
 
@@ -275,7 +276,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                 */
                @Override
                public void widgetSelected(SelectionEvent e) {
-                       NavigationUtil.info("configuration menu clicked");
+                       MessagingUtils.info(Messages.SearchBar_5);
                        SearchOption option = (SearchOption) e.widget.getData();
 
                        switch (option){
@@ -314,10 +315,10 @@ public class SearchBar extends WorkbenchWindowControlContribution{
         * @version 1.0
         */
        enum SearchOption {
-               TAXON("Taxa"), 
-               SYNONYM("Synonyms"), 
-               NAME("Names (without taxa)"), 
-               COMMON_NAME("Common Names");
+               TAXON(Messages.SearchBar_6), 
+               SYNONYM(Messages.SearchBar_7), 
+               NAME(Messages.SearchBar_8), 
+               COMMON_NAME(Messages.SearchBar_9);
 
                private final String label;
 
index 830c7e50f02cd5087d9dab9fdc483302a8dfd653..33cf4192c4b5389a8fcf8aaf16153889325066d5 100644 (file)
@@ -9,6 +9,8 @@ import org.eclipse.ui.application.WorkbenchAdvisor;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 import org.osgi.framework.Bundle;
 
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
 @SuppressWarnings("restriction")
 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 
@@ -50,5 +52,11 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 //             IWorkspace workspace = ResourcesPlugin.getWorkspace();
 //             return workspace.getRoot();
 //     }
+       
+//     @Override
+//     public void eventLoopException(Throwable exception) {
+//             super.eventLoopException(exception);
+//             MessagingUtils.messageDialog("Unexpected Errorr", "Please contact EDIT Support and provide contents of  the trace log", null , exception);
+//     }
 
 }
diff --git a/eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle.properties b/eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..e0e4fc2
--- /dev/null
@@ -0,0 +1,4 @@
+#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
diff --git a/eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_de.properties b/eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_de.properties
new file mode 100644 (file)
index 0000000..88df08a
--- /dev/null
@@ -0,0 +1,4 @@
+#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
diff --git a/eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_en.properties b/eu.etaxonomy.taxeditor.printpublisher/OSGI-INF/l10n/bundle_en.properties
new file mode 100644 (file)
index 0000000..e0e4fc2
--- /dev/null
@@ -0,0 +1,4 @@
+#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
index 5589fdf944c710f9aece4c51cdced1f4baf7770c..4b96d06737c3b4f8ac67640fb99dce26b694d8bd 100644 (file)
@@ -2,4 +2,7 @@ source.. = src/main/java/
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               p2.inf
+               p2.inf,\
+               OSGI-INF/l10n/bundle.properties,\
+               OSGI-INF/l10n/bundle_de.properties,\
+               OSGI-INF/l10n/bundle_en.properties
index baacae2bd29c1ebcb93b2f628e94d17c1e7e8209..c8e8b958205547de33feed607690acaa7080b9e9 100644 (file)
@@ -5,7 +5,7 @@
          point="org.eclipse.ui.exportWizards">
          <category
             id="print-publisher.category"
-            name="Print Publishing">
+            name="%category.name">
       </category>
       <wizard
             category="print-publisher.category"
@@ -37,7 +37,7 @@
       <command
             defaultHandler="eu.etaxonomy.taxeditor.printpublisher.handler.GeneratePdfHandler"
             id="eu.etaxonomy.printpublisher.plugin.generatePdf"
-            name="Generate PDF">
+            name="%command.name">
       </command>
    </extension>
 -->
index 680e1ab39e9bd7eb6ac101022cc823c866d3e97a..9cf226ed10d53fef43535cefdf1ae119e7c3baa3 100644 (file)
@@ -27,10 +27,10 @@ import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.out.pdf.PdfOutputModule;
 import eu.etaxonomy.cdm.print.out.xml.XMLOutputModule;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
 import eu.etaxonomy.taxeditor.printpublisher.wizard.DirectPublishingWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>GeneratePdfHandler class.</p>
@@ -51,7 +51,7 @@ public class GeneratePdfHandler extends AbstractHandler {
                IEditorInput input = editor.getEditorInput();
                
                if(!(input instanceof TaxonEditorInput)){
-                       StoreUtil.warningDialog("PDF generation not supported for selected input", this, "Generating PDF output is not supported for the current active editor");
+                       MessagingUtils.warningDialog("PDF generation not supported for selected input", this, "Generating PDF output is not supported for the current active editor");
                        
                        return null;
                }
index fb9406e0389f3ed57b2765d582c512e7807f3c40..a4386b6e0e07e5ec6cd7f51e11d18812aae8f7a0 100644 (file)
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.Publisher;
 import eu.etaxonomy.cdm.print.out.IPublishOutputModule;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
-import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.printpublisher.internal.PrintpublisherPlugin;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -149,7 +149,7 @@ public abstract class AbstractPublishWizard extends Wizard implements IExportWiz
         */
        /** {@inheritDoc} */
        public void init(IWorkbench workbench, IStructuredSelection selection) {
-               PrintUtil.info("Instantiating wizard: " + this.getClass().getSimpleName());
+               MessagingUtils.info("Instantiating wizard: " + this.getClass().getSimpleName());
        }
        
 
index b6e69ec3b3a4d3f38fe2c79823f4c331c99d3457..176d6b203715245fa97154501b5d6ccbdade2f93 100644 (file)
@@ -45,9 +45,9 @@ import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.XMLHelper;
 import eu.etaxonomy.cdm.print.XMLHelper.EntityType;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>SelectServiceWizardPage class.</p>
@@ -225,9 +225,9 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                        try {
                                getContainer().run(true, false, runnable);
                        } catch (InvocationTargetException e) {
-                               StoreUtil.error(this.getClass(), e);
+                               MessagingUtils.error(this.getClass(), e);
                        } catch (InterruptedException e) {
-                               StoreUtil.error(this.getClass(), e);
+                               MessagingUtils.error(this.getClass(), e);
                        }
                }
        }
index 0f0113e6c4b10b1438fc311f23f905bb447a7a68..3267eb0228b9bf9275a45569fd5714f2aeba65d9 100644 (file)
@@ -20,7 +20,7 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * @author n.hoffmann
@@ -82,7 +82,7 @@ public class SelectStylesheetWizardPage extends AbstractPublishWizardPage
                        stylesheets = getOutputModule().getStylesheets();
                        viewer.setInput(stylesheets);
                } catch (IOException e) {
-                       PrintUtil.errorDialog("Problems reading stylesheet", getClass(), e.getMessage(), e);
+                       MessagingUtils.messageDialog("Problems reading stylesheet", getClass(), e.getMessage(), e);
                }               
        }
        
index 3f1ac596d1e476b1031eda2b5755b362c8c7a4d1..f75985dcaf24802a368c47c14d3353f042b060fa 100644 (file)
@@ -34,7 +34,7 @@ import org.jdom.Element;
 import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.XMLHelper;
 import eu.etaxonomy.cdm.print.XMLHelper.EntityType;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>SelectTaxaWizardPage class.</p>
@@ -111,9 +111,9 @@ public class SelectTaxaWizardPage extends AbstractPublishWizardPage {
                        try {
                                getContainer().run(true, false, runnable);
                        } catch (InvocationTargetException e) {
-                               StoreUtil.error(this.getClass(), e);
+                               MessagingUtils.error(this.getClass(), e);
                        } catch (InterruptedException e) {
-                               StoreUtil.error(this.getClass(), e);
+                               MessagingUtils.error(this.getClass(), e);
                        }
                }
        }
index f3a5d62f5f363ffda234e6ec746fe8e6ce0b550b..07a0fb8de23f3ad92b63f84242c1034fa6d81c12 100644 (file)
@@ -236,3 +236,4 @@ Bundle-ClassPath: .,
  xpp3_min-1.1.4c.jar,
  xstream-1.4.4.jar,
  yjp-controller-api-redist-9.0.8.jar
+Bundle-Localization: OSGI-INF/l10n/bundle
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..dc98244
--- /dev/null
@@ -0,0 +1,126 @@
+#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 = Language\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 = Messages\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
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
new file mode 100644 (file)
index 0000000..94c9770
--- /dev/null
@@ -0,0 +1,126 @@
+#Properties file for eu.etaxonomy.taxeditor.store, German
+page.name = Taxonomischer Editor
+page.name.0 = Beschreibung
+page.name.1 = Merkmal
+page.name.2 = Verbreitungsstatus
+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.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.21 = Merkmalsbaum
+page.name.22 = Standard Merkmalsbaum
+page.name.23 = Sprache
+page.name.24 = Mobot Open Url
+page.name.25 = Typ Bezeichnungen
+view.name = Datenquelle
+view.name.0 = Fortschritt
+view.name.1 = Nachrichten
+view.name.2 = Berichte
+view.name.3 = Zusatzdaten
+view.name.4 = Details
+view.name.5 = Benutze Datensatz
+view.name.6 = Suche Derivate
+editor.name = Editor f\u00fcr definierte Begriffe 
+menu.label = Zeige Ansicht
+command.label = Derivatsuche
+command.label.0 = Details
+command.label.1 = Zusatz
+command.label.2 = Datenquelle
+command.label.3 = Fehlermeldungen
+command.label.4 = Berichte
+command.label.5 = Benutzer wechseln
+command.label.6 = Verbinden
+command.label.7 = Neu
+command.label.8 = Bearbeiten
+command.label.9 = L\u00f6schen
+command.label.10 = Schlie\u00dfe aktive Verbindung
+command.label.11 = Aktualisiere Datenmodel
+menu.label.0 = Neu
+command.label.12 = Vokabular
+command.label.13 = Definierter Begriff
+command.label.14 = L\u00f6schen
+extension.name = Popup Men\u00fc Befehle
+command.name = Verbinde Datenquelle
+command.name.0 = Bearbeite Datenquelle
+command.name.1 = Erstelle Datenquelle
+command.name.2 = Schie\u00dfe aktive Verbindungen
+command.name.3 = Aktualisiere Datenquellen
+command.name.4 = Zeige Login Window
+command.name.5 = \u00d6ffne Editor f\u00fcr definierte Begriffe
+commandParameter.name = inputTyp
+commandParameter.name.0 = inputTyp
+command.name.6 = Neuer definierter Begriff
+command.name.7 = Neues Begriffsvokabular
+category.name = CDM
+wizard.name = TCS
+wizard.name.0 = Berlin Modell
+wizard.name.1 = Endnote
+wizard.name.2 = Excel Normal Explicit Taxa
+wizard.name.3 = ABCD
+wizard.name.4 = SDD
+wizard.name.5 = Beleg CDM Excel
+category.name.0 = CDM
+wizard.name.6 = JAXB
+wizard.name.7 = Berlin Model
+category.name.1 = Excel
+wizard.name.8 = SDD
+wizard.name.9 = DwC-A
+wizard.name.10 = Referenz
+wizard.name.11 = Name
+wizard.name.12 = Team
+wizard.name.13 = Person
+wizard.name.14 = Beleg
+wizard.name.15 = Polytomous Key
+category.name.2 = CDM
+wizard.name.16 = Taxon
+wizard.name.17 = Klassifikation
+themeElementCategory.label = Taxonomischer Editor
+themeElementCategory.description = Farb- und Schriftdefinitionen f\u00fcr den EDIT Taxonomischen Editor
+colorDefinition.label = Liste Hintergrund
+colorDefinition.label.0 = Globale Textfarbe
+colorDefinition.label.1 = Globale Farbe Composite Hintergrund
+colorDefinition.label.2 = Globale Composite Farbe irrelevant
+colorDefinition.label.3 = Globale Textfarbe gesperrt
+colorDefinition.label.4 = Globale Hintergrundfarbe gesperrt
+themeElementCategory.label.0 = Ansicht Details
+themeElementCategory.description.0 = Farben und Schriften f\u00fcr die Detailansicht
+colorDefinition.label.5 = Entity Element List Background Odd
+colorDefinition.label.6 = Entity Element List Background Even
+themeElementCategory.label.1 = Namenseditor
+themeElementCategory.description.1 = Farben und Schriften f\u00fcr den Namenseditor
+colorDefinition.label.7 = Container Hintergrund
+colorDefinition.label.8 = Container ausgew\u00e4hlter Fokus
+colorDefinition.label.9 = Container ausgew\u00e4hlt
+colorDefinition.label.10 = Container Drag Enter
+fontDefinition.label = Schrift akzeptiertes Taxon
+fontDefinition.label.0 = Schrift Synonyme
+fontDefinition.label.1 = Schrift Fehlanwendungen
+fontDefinition.label.2 = Schrift Konzepte
+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.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.
+colorDefinition.label.13 = Fehler beim Parsing
+colorDefinition.label.14 = Gesperrtes Namenseditierfeld
+colorDefinition.label.15 = Editor fehlerhaft
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_en.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_en.properties
new file mode 100644 (file)
index 0000000..dc98244
--- /dev/null
@@ -0,0 +1,126 @@
+#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 = Language\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 = Messages\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
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
new file mode 100644 (file)
index 0000000..887b082
--- /dev/null
@@ -0,0 +1,12 @@
+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
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
new file mode 100644 (file)
index 0000000..ca15205
--- /dev/null
@@ -0,0 +1,12 @@
+CdmDataSourceViewPart_1=Datenquelle wird geladen\r
+CdmDataSourceViewPart_10=Server\r
+CdmDataSourceViewPart_11=Name\r
+CdmDataSourceViewPart_12=Verbunden\r
+CdmDataSourceViewPart_2=Notizen\r
+CdmDataSourceViewPart_3=Kompatibel\r
+CdmDataSourceViewPart_4=CDM Version\r
+CdmDataSourceViewPart_5=Erstellt\r
+CdmDataSourceViewPart_6=Nomenklaturcode\r
+CdmDataSourceViewPart_7=Datenquelle\r
+CdmDataSourceViewPart_8=Typ\r
+CdmDataSourceViewPart_9=Verf\u00FCgbar\r
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_en.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_en.properties
new file mode 100644 (file)
index 0000000..887b082
--- /dev/null
@@ -0,0 +1,12 @@
+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
index 925934e50ff1d92c868e24dda037b16c48abeb72..ba626c82943edd651b6f24f357be63cd2c3b7829 100644 (file)
@@ -6,4 +6,6 @@ bin.includes = META-INF/,\
                .,\
                plugin.xml,\
                icons/,\
-               p2.inf
+               p2.inf,\
+               OSGI-INF/
+
index 8277d0a748a1687f61e98b262339412ef4c278f8..cb91bc2fc133a8387a3cf62817467559e06c22e8 100644 (file)
@@ -6,37 +6,37 @@
       <page
             class="eu.etaxonomy.taxeditor.preference.TaxonomicEditorGeneralPreferences"
             id="eu.etaxonomy.taxeditor.preferences.general"
-            name="Taxonomic Editor">
+            name="%page.name">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.DescriptionPreferences"
             id="eu.etaxonomy.taxeditor.preferences.description"
-            name="Description">
+            name="%page.name.0">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.description"
             class="eu.etaxonomy.taxeditor.preference.menu.FeatureMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.feature"
-            name="Features">
+            name="%page.name.1">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.description"
             class="eu.etaxonomy.taxeditor.preference.menu.PresenceAbsenceMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.distributionStatus"
-            name="Distribution Status">
+            name="%page.name.2">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.TaxonomicPreferences"
             id="eu.etaxonomy.taxeditor.preferences.taxonomic"
-            name="Taxonomic">
+            name="%page.name.3">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.taxonomic"
             class="eu.etaxonomy.taxeditor.preference.NomenclaturalCodePreferences"
             id="eu.etaxonomy.taxeditor.preferences.nomenclatural"
-            name="Nomenclatural Code">
+            name="%page.name.4">
       </page>
       <!--page
             class="eu.etaxonomy.taxeditor.store.preference.CdmPreferences"
             category="eu.etaxonomy.taxeditor.preferences.taxonomic"
             class="eu.etaxonomy.taxeditor.preference.menu.RankMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.ranks"
-            name="Ranks">
+            name="%page.name.5">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.taxonomic"
             class="eu.etaxonomy.taxeditor.preference.menu.NomenclaturalStatusTypeMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.nomenclaturalStatusType"
-            name="Nomenclatural Status Type">
+            name="%page.name.6">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.taxonomic"
             class="eu.etaxonomy.taxeditor.preference.menu.NameRelationshipTypeMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.nameRelationshipType"
-            name="Name Relationship Type">
+            name="%page.name.7">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.taxonomic"
             class="eu.etaxonomy.taxeditor.preference.menu.TaxonRelationshipTypeMenuPreferences"
             id="taxeditor-store.page1"
-            name="Taxon Relationship Type">
+            name="%page.name.8">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.taxonomic"
             class="eu.etaxonomy.taxeditor.preference.menu.SpecimenTypeDesignationStatusMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.specimenTypeDesignationStatus"
-            name="Specimen Type Designation Status">
+            name="%page.name.9">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.language"
             class="eu.etaxonomy.taxeditor.preference.menu.LanguageMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.languages"
-            name="Available Languages">
+            name="%page.name.10">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.menu.MarkerTypeMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.markerTypes"
-            name="Marker Types">
+            name="%page.name.11">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.menu.ExtensionTypeMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.extensionTypes"
-            name="Extension Types">
+            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="Name Type Designation Status">
+            name="%page.name.13">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.description"
             class="eu.etaxonomy.taxeditor.preference.menu.NamedAreaTypeMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.namedAreaType"
-            name="Named Area Type">
+            name="%page.name.14">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.MatchingPreferences"
             id="eu.etaxonomy.taxeditor.preferences.matching"
-            name="Matching (Experimental)">
+            name="%page.name.15">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.matching"
             class="eu.etaxonomy.taxeditor.preference.matching.NonViralNameMatchingPreference"
             id="eu.etaxonomy.taxeditor.preferences.matching.nonViralName"
-            name="NonViralName Matching Strategy">
+            name="%page.name.16">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.matching"
             class="eu.etaxonomy.taxeditor.preference.matching.ReferenceMatchingPreference"
             id="eu.etaxonomy.taxeditor.preferences.matching"
-            name="Reference Matching Strategy">
+            name="%page.name.17">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.matching"
             class="eu.etaxonomy.taxeditor.preference.matching.TeamOrPersonMatchingPreference"
             id="eu.etaxonomy.taxeditor.preferences.matching"
-            name="Team or Person Matching Strategy">
+            name="%page.name.18">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.description"
             class="eu.etaxonomy.taxeditor.preference.menu.StageMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.stage"
-            name="Stage">
+            name="%page.name.19">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.description"
             class="eu.etaxonomy.taxeditor.preference.menu.PreservationMethodMenuPreferences"
             id="eu.etaxonomy.taxeditor.preferences.preservationMethod"
-            name="Preservation Method">
+            name="%page.name.20">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.feature"
             class="eu.etaxonomy.taxeditor.preference.FeatureTreePreferences"
             id="eu.etaxonomy.taxeditor.preferences.featureTree"
-            name="Feature Tree">
+            name="%page.name.21">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.feature"
             class="eu.etaxonomy.taxeditor.preference.DefaultFeatureTreePreferenecs"
             id="eu.etaxonomy.taxeditor.preferences.defaultFeatureTreePreferenecs"
-            name="Default Feature Trees">
+            name="%page.name.22">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.LanguagePreferencePage"
             id="eu.etaxonomy.taxeditor.preferences.language"
-            name="Language">
+            name="%page.name.23">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.MobotOpenUrlPreferences"
             id="eu.etaxonomy.taxeditor.preferences.mobotOpenUrl"
-            name="Mobot Open Url">
+            name="%page.name.24">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.TypeDesignationPreferences"
             id="eu.etaxonomy.taxeditor.preferences.typeDesignation"
-            name="Type Designations">
+            name="%page.name.25">
       </page>
       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             id="eu.etaxonomy.taxeditor.preference.SpecimenOrObservationPreferences"
             name="Specimens and FieldUnits">
       </page>
+      <page
+            category="eu.etaxonomy.taxeditor.preferences.general"
+            class="eu.etaxonomy.taxeditor.preference.ChecklistEditorGeneralPreference"
+            id="eu.etaxonomy.taxeditor.preference.ChecklistEditorGeneralPreferencePage"
+            name="Checklist Editor">
+      </page>
+      <page
+            category="eu.etaxonomy.taxeditor.preferences.general"
+            class="eu.etaxonomy.taxeditor.preference.TemplatePreferencePage"
+            id="eu.etaxonomy.taxeditor.preference.TemplatePreferencePage"
+            name="Editor Profile">
+      </page>
    </extension>
    <extension
          point="org.eclipse.ui.views">
             class="eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart"
             icon="icons/system-file-manager.png"
             id="eu.etaxonomy.taxeditor.view.datasource"
-            name="Datasource"
+            name="%view.name"
             restorable="true">
       </view>
       <view  
-                       name="Progress View"  
+                       name="%view.name.0"  
                        category="org.eclipse.ui"  
                        class="org.eclipse.ui.ExtensionFactory:progressView"  
                        id="org.eclipse.ui.views.ProgressView">  
                </view>
                <view  
-                       name="Message View"  
+                       name="%view.name.1"  
                        icon="icons/console.gif"  
                        category="org.eclipse.ui"  
                        class="org.eclipse.ui.ExtensionFactory:logView"  
   <view
         class="eu.etaxonomy.taxeditor.view.reporting.ReportingViewPart"
         id="eu.etaxonomy.taxeditor.reporting.viewPart"
-        name="Reporting"
+        name="%view.name.2"
         restorable="true">
   </view>
   <view
         class="eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart"
         icon="icons/applications-office.png"
         id="eu.etaxonomy.taxeditor.view.supplementalData"
-        name="Supplemental Data"
+        name="%view.name.3"
         restorable="true">
   </view>
   <view
         class="eu.etaxonomy.taxeditor.view.detail.DetailsViewPart"
         icon="icons/accessories-text-editor.png"
         id="eu.etaxonomy.taxeditor.view.detail"
-        name="Details"
+        name="%view.name.4"
         restorable="true">
   </view>
   <view
         class="eu.etaxonomy.taxeditor.view.userecords.UseRecordsViewPart"
         icon="icons/leaf_detail.png"
         id="eu.etaxonomy.taxeditor.view.userecords"
-        name="Use Records"
+        name="%view.name.5"
         restorable="true">
   </view>
   <view
         class="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView"
         icon="icons/derivate_search_view-16x16-32.png"
         id="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView"
-        name="Derivate Search"
+        name="%view.name.6"
         restorable="true">
   </view>
    </extension>
             class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor"
             default="false"
             id="eu.etaxonomy.taxeditor.editor.definedTerm"
-            name="Defined Term Editor">
+            name="%editor.name">
       </editor>
    </extension>
    <extension
             locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
          <menu
                id="eu.etaxonomy.taxeditor.menu.showView"
-               label="Show View">
+               label="%menu.label">
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="Derivate Search View"
+                  label="%command.label"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
             </separator>
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="Details"
+                  label="%command.label.0"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
             </command>
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="Supplemental"
+                  label="%command.label.1"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
             </separator>
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="Datasource"
+                  label="%command.label.2"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
             </command>
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="Messages"
+                  label="%command.label.3"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
             </command>
             <command
                   commandId="org.eclipse.ui.views.showView"
-                  label="Reporting"
+                  label="%command.label.4"
                   style="push">
                <parameter
                      name="org.eclipse.ui.views.showView.viewId"
             locationURI="menu:org.eclipse.ui.main.menu.file?after=eu.etaxonomy.taxeditor.application.filemenu.io">
          <command
                commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
-               label="Switch User"
-               style="push">
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
-               label="Change Password"
+               label="%command.label.5"
                style="push">
          </command>
          <separator
             locationURI="popup:eu.etaxonomy.taxeditor.view.datasource">
          <command
                commandId="eu.etaxonomy.taxeditor.store.datasource.change"
-               label="Connect"
+               label="%command.label.6"
                style="push">
                <visibleWhen>
               <with
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.store.datasource.create"
-               label="New"
+               label="%command.label.7"
                style="push">
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.store.datasource.edit"
-               label="Edit"
+               label="%command.label.8"
                style="push">
                 <visibleWhen>
               <with
          </separator>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.9"
                style="push">
                <visibleWhen>
               <with
          </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.store.datasource.close"
-               label="Close Active Connection"
+               label="%command.label.10"
                style="push">
                <visibleWhen>
               <with
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.store.datasource.update"
-               label="Update Datamodel"
+               label="%command.label.11"
                style="push">
             <visibleWhen
                   checkEnabled="true">
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.definedTerm">
          <menu
-               label="New">
+               label="%menu.label.0">
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.definedTerms.newTermVocabulary"
-                  label="Vocabulary"
+                  label="%command.label.12"
                   style="push">
             </command>
             <command
                   commandId="eu.etaxonomy.taxeditor.editor.definedTerms.newDefinedTerm"
-                  label="Defined Term"
+                  label="%command.label.13"
                   style="push">
                <visibleWhen
                      checkEnabled="true">
          </menu>
          <command
                commandId="org.eclipse.ui.edit.delete"
-               label="Delete"
+               label="%command.label.14"
                style="push">
             <visibleWhen
                   checkEnabled="true">
                   definitionId="isUserLoggedIn">
             </reference></enabledWhen>
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.handler.OpenDistributionEditorWizardHandler"
+            commandId="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler">
+         <activeWhen>
+            <reference
+                  definitionId="hasROLE_PROJECT_MANAGER">
+            </reference>
+         </activeWhen>
+      </handler>
    </extension>
    <extension
          point="org.eclipse.ui.commands">
       <command
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.ChangeConnectionHandler"
             id="eu.etaxonomy.taxeditor.store.datasource.change"
-            name="Connect Datasource">
+            name="%command.name">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.EditDataSourceHandler"
             id="eu.etaxonomy.taxeditor.store.datasource.edit"
-            name="Edit Datasource">
+            name="%command.name.0">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CloneDataSourceHandler"
       <command
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CreateDataSourceHandler"
             id="eu.etaxonomy.taxeditor.store.datasource.create"
-            name="Create Datasource">
+            name="%command.name.1">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CloseConnectionHandler"
             id="eu.etaxonomy.taxeditor.store.datasource.close"
-            name="Close Active Connection">
+            name="%command.name.2">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.UpdateDataSourceHandler"
             id="eu.etaxonomy.taxeditor.store.datasource.update"
-            name="Update Datasource">
+            name="%command.name.3">
       </command>
       <command
             id="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
-            name="Show Login Window">
+            name="%command.name.4">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.OpenDefinedTermEditorHandler"
             id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-            name="Open Defined Term Editor">
+            name="%command.name.5">
          <commandParameter
                id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid"
-               name="inputType"
+               name="%commandParameter.name.0"
                optional="true">
          </commandParameter>
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.CreateDefinedTermHandler"
             id="eu.etaxonomy.taxeditor.editor.definedTerms.newDefinedTerm"
-            name="New Defined Term">
+            name="%command.name.6">
       </command>
       <command
             defaultHandler="eu.etaxonomy.taxeditor.editor.definedterm.handler.CreateTermVocabularyHandler"
             id="eu.etaxonomy.taxeditor.editor.definedTerms.newTermVocabulary"
-            name="New Term Vocabulary">
+            name="%command.name.7">
       </command>
       <command
          id="eu.etaxonomy.taxeditor.store.open.FeatureTreeEditorWizard"
             id="eu.etaxonomy.taxeditor.store.openPasswordWizzard"
             name="Open Password Wizzard">
       </command>
+      <command
+            id="eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler"
+            name="Open Distribution Editor Wizard">
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.importWizards">
       <category
             id="eu.etaxonomy.taxeditor.import.category.cdm"
-            name="CDM">
+            name="%category.name">
       </category>
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.TcsImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.tcs"
-            name="TCS">
+            name="%wizard.name">
       </wizard>
    <!--   <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.BerlinModelImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.berlinModel"
-            name="Berlin Model">
+            name="%wizard.name.0">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.EndnoteImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.endnote"
-            name="Endnote">
+            name="%wizard.name.1">
       </wizard>-->
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.ExcelNormalExplicitTaxaImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.excel.taxa"
-            name="Excel Normal Explicit Taxa">
+            name="%wizard.name.2">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.AbcdImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.abcd"
-            name="ABCD">
+            name="%wizard.name.3">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.SddImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.sdd"
-            name="SDD">
+            name="%wizard.name.4">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.import.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.SpecimenCdmExcelImportWizard"
             id="eu.etaxonomy.taxeditor.io.import.specimenCdmExcel"
-            name="Specimen CDM Excel">
+            name="%wizard.name.5">
       </wizard>
    </extension>
    <extension
          point="org.eclipse.ui.exportWizards">
       <category
             id="eu.etaxonomy.taxeditor.export.category.cdm"
-            name="CDM">
+            name="%category.name.0">
       </category>
       <wizard
             category="eu.etaxonomy.taxeditor.export.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.JaxbExportWizard"
             id="eu.etaxonomy.taxeditor.io.export.jaxb"
-            name="JAXB">
+            name="%wizard.name.6">
       </wizard>
       <!--<wizard
             category="eu.etaxonomy.taxeditor.export.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.BerlinModelExportWizard"
             id="eu.etaxonomy.taxeditor.io.export.berlinModel"
-            name="Berlin Model">
+            name="%wizard.name.7">
       </wizard>-->
       <category
             id="eu.etaxonomy.taxeditor.export.category.excel"
-            name="Excel">
+            name="%category.name.1">
       </category>
       <wizard
             category="eu.etaxonomy.taxeditor.export.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.SddExportWizard"
             id="eu.etaxonomy.taxeditor.io.export.sdd"
-            name="SDD">
+            name="%wizard.name.8">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.export.category.cdm"
             class="eu.etaxonomy.taxeditor.io.wizard.DarwinCoreArchiveExportWizard"
             id="eu.etaxonomy.taxeditor.io.export.dwca"
-            name="DwC-A">
+            name="%wizard.name.9">
       </wizard>
    </extension>
    <extension
             class="eu.etaxonomy.taxeditor.newWizard.NewReferenceWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.reference"
-            name="Reference">
+            name="%wizard.name.10">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             class="eu.etaxonomy.taxeditor.newWizard.NewNonViralNameWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.nonViralName"
-            name="Name">
+            name="%wizard.name.11">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             class="eu.etaxonomy.taxeditor.newWizard.NewTeamWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.team"
-            name="Team">
+            name="%wizard.name.12">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             class="eu.etaxonomy.taxeditor.newWizard.NewPersonWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.person"
-            name="Person">
+            name="%wizard.name.13">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             class="eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.specimen"
-            name="Specimen">
+            name="%wizard.name.14">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             class="eu.etaxonomy.taxeditor.newWizard.NewPolytomousKeyWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.key.polytomous"
-            name="Polytomous Key">
+            name="%wizard.name.15">
       </wizard>
       <category
             id="eu.etaxonomy.taxeditor.new.category.cdm"
-            name="CDM">
+            name="%category.name.2">
       </category>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             class="eu.etaxonomy.taxeditor.newWizard.NewTaxonNodeWizard"
             hasPages="true"
             id="eu.etaxonomy.taxeditor.new.taxonNode"
-            name="Taxon">
+            name="%wizard.name.16">
       </wizard>
       <wizard
             category="eu.etaxonomy.taxeditor.new.category.cdm"
             hasPages="true"
             icon="icons/tree_icon_small.jpg"
             id="eu.etaxonomy.taxeditor.new.classification"
-            name="Classification">
+            name="%wizard.name.17">
       </wizard>
    </extension>
 <extension
             point="org.eclipse.ui.themes">
          <themeElementCategory
                id="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
-               label="Taxonomic Editor">
+               label="%themeElementCategory.label">
             <description>
-               Color and font definitions for the EDIT Taxonomic Editor
+               %themeElementCategory.description
             </description>
          </themeElementCategory>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackground"
-               label="List Background"
+               label="%colorDefinition.label"
                value="150,150,150">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.textDefault"
-               label="Global Text Color"
+               label="%colorDefinition.label.0"
                value="0,0,0">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.colorCompositeBackground"
-               label="Global Color Composite Background"
+               label="%colorDefinition.label.1"
                value="255,255,255">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.colorCompositeIrrelevant"
-               label="Global Color Composite Irrelevant"
+               label="%colorDefinition.label.2"
                value="241,139,18">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.textDisabled"
-               label="Global Text Color Disabled"
+               label="%colorDefinition.label.3"
                value="150,150,150">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.textBackgroundDisabled"
-               label="Global Background Color Disabled"
+               label="%colorDefinition.label.4"
                value="230,230,230">
          </colorDefinition>
          <themeElementCategory
                id="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
-               label="Details View"
+               label="%themeElementCategory.label.0"
                parentId="eu.etaxonomy.taxeditor.preferences.themeElementCategory">
             <description>
-               Colors and fonts for the details view
+               %themeElementCategory.description.0
             </description>
          </themeElementCategory>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackgroundOdd"
-               label="Entity Element List Background Odd"
+               label="%colorDefinition.label.5"
                value="230,230,230">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.listBackgroundEven"
-               label="Entity Element List Background Even"
+               label="%colorDefinition.label.6"
                value="255,255,255">
          </colorDefinition>
          <themeElementCategory
                id="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
-               label="Name Editor"
+               label="%themeElementCategory.label.1"
                parentId="eu.etaxonomy.taxeditor.preferences.themeElementCategory">
             <description>
-               Colors and fonts for the name editor
+               %themeElementCategory.description.1
             </description>
          </themeElementCategory>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerBackground"
-               label="Container Background"
+               label="%colorDefinition.label.7"
                value="220, 220, 220">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerSelectedFocus"
-               label="Container Selected Focus"
+               label="%colorDefinition.label.8"
                value="232,242,254">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerSelected"
-               label="Container Selected"
+               label="%colorDefinition.label.9"
                value="210, 210, 210">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.nameEditor.colorContainerDragEnter"
-               label="Container Drag Enter"
+               label="%colorDefinition.label.10"
                value="185,255,133">
          </colorDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.accepted"
-               label="Accepted Taxon Font"
+               label="%fontDefinition.label"
                value="Georgia-regular-12">
          </fontDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.synonym"
-               label="Synonym Font"
+               label="%fontDefinition.label.0"
                value="Georgia-regular-10">
          </fontDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.misapplication"
-               label="Misapplication Font"
+               label="%fontDefinition.label.1"
                value="Georgia-regular-10">
          </fontDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.concept"
-               label="Concept Font"
+               label="%fontDefinition.label.2"
                value="Georgia-regular-10">
          </fontDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.nameEditor.default"
-               label="Default Font"
+               label="%fontDefinition.label.3"
                value="Georgia-regular-10">
          </fontDefinition>
          <themeElementCategory
                id="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
-               label="Search View"
+               label="%themeElementCategory.label.2"
                parentId="eu.etaxonomy.taxeditor.preferences.themeElementCategory">
             <description>
-               Colors and fonts for the search view
+               %themeElementCategory.description.2
             </description>
          </themeElementCategory>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.searchView.foreground"
-               label="Search View Foreground"
+               label="%colorDefinition.label.11"
                value="192, 192, 192">
          </colorDefinition>
          <colorDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
                id="eu.etaxonomy.taxeditor.preferences.colorDefinition.searchView.focus"
-               label="Search View Focus"
+               label="%colorDefinition.label.12"
                value="0, 0, 0">
          </colorDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.accepted"
                isEditable="true"
-               label="Accepted font"
+               label="%fontDefinition.label.4"
                value="Arial-regular-10">
             <description>
-               The font that is used for accepted taxa in the search result list.
+               %fontDefinition.description
             </description>
          </fontDefinition>
          <fontDefinition
                categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
                id="eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.synonym"
                isEditable="true"
-               label="Synonym font"
+               label="%fontDefinition.label.5"
                value="Arial-italic-10">
          <description>
-            The font that is used for synonyms in the search result list.
+            %fontDefinition.description.0
          </description>
       </fontDefinition>
       <fontDefinition
             categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.searchView"
             id="eu.etaxonomy.taxeditor.preferences.fontDefinition.searchView.other"
             isEditable="true"
-            label="Other font"
+            label="%fontDefinition.label.6"
             value="Lucida Grande-regular-11">
          <description>
-            The font used by default in the search result list.
+            %fontDefinition.description.1
          </description>
       </fontDefinition>
       <colorDefinition
             categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.detailsView"
             id="eu.etaxonomy.taxeditor.preferences.colorDefinition.parseError"
-            label="Parse Error"
+            label="%colorDefinition.label.13"
             value="255,0,0">
       </colorDefinition>
       <colorDefinition
             categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory.nameEditor"
             id="eu.etaxonomy.taxeditor.preferences.colorDefinition.disabledEditor"
-            label="Disabled Name Editor Field"
+            label="%colorDefinition.label.14"
             value="105,114,124">
       </colorDefinition>
       <colorDefinition
             categoryId="eu.etaxonomy.taxeditor.preferences.themeElementCategory"
             id="eu.etaxonomy.taxeditor.preferences.colorDefinition.editorError"
-            label="Editor On Error"
+            label="%colorDefinition.label.15"
             value="255,0,0">
       </colorDefinition>
       </extension>
index fbf4c53573c5ab3c4cecbfcf5db13f2a62037048..da13e5e869cc8c62ba2fa8091682835fcd7df862 100644 (file)
@@ -34,9 +34,9 @@ import eu.etaxonomy.cdm.remote.CdmPersistentRemoteSource;
 import eu.etaxonomy.cdm.remote.CdmRemoteSourceException;
 import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
 import eu.etaxonomy.taxeditor.model.MementoHelper;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 public class CdmDataSourceRepository{
 
@@ -96,7 +96,7 @@ public class CdmDataSourceRepository{
                        try {
                                remoteSources.add(CdmPersistentDataSource.NewInstance(dataSource.getName()));
                        } catch (DataSourceNotFoundException e) {
-                               StoreUtil.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
+                               MessagingUtils.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
                        }
                }
                
@@ -105,7 +105,7 @@ public class CdmDataSourceRepository{
                                remoteSources.add(remoteSource);
                        }
                } catch (CdmRemoteSourceException e) {
-                       StoreUtil.error(CdmDataSourceRepository.class, "Error retrieving remote sources", e);
+                       MessagingUtils.error(CdmDataSourceRepository.class, "Error retrieving remote sources", e);
                }
                
                // TODO sort by database name
@@ -127,7 +127,7 @@ public class CdmDataSourceRepository{
                                        return CdmPersistentDataSource.NewInstance(dataSource.getName());
                                }
                        } catch (DataSourceNotFoundException e) {
-                               StoreUtil.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
+                               MessagingUtils.error(CdmDataSourceRepository.class, "Could not find dataSource", e);
                        }
                }
                
@@ -182,7 +182,7 @@ public class CdmDataSourceRepository{
                
                if( dataSourceNomenclaturalCode != null && ! dataSourceNomenclaturalCode.equals(applicationNomenclaturalCode)){
                        PreferencesUtil.setPreferredNomenclaturalCode(dataSourceNomenclaturalCode);
-                       StoreUtil.informationDialog("Nomenclatural Code Change", "The Datasource that was just " +
+                       MessagingUtils.informationDialog("Nomenclatural Code Change", "The Datasource that was just " +
                                        "loaded has a different nomenclatural code than the one stored in Preferences. " +
                                        "The nomenclatural code was changed in the application.");
                }
@@ -237,7 +237,7 @@ public class CdmDataSourceRepository{
                try {
                        return CdmPersistentDataSource.update(strCdmSourceName, cdmSource);
                } catch (Exception e) {
-                       StoreUtil.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
+                       MessagingUtils.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
                }
                return null;
        }
@@ -246,7 +246,7 @@ public class CdmDataSourceRepository{
                try {
                        return CdmPersistentDataSource.replace(strCdmSourceName, cdmSource);
                } catch (Exception e) {
-                       StoreUtil.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
+                       MessagingUtils.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
                }
                return null;
        }
@@ -262,7 +262,7 @@ public class CdmDataSourceRepository{
                try {
                        return CdmPersistentRemoteSource.update(strCdmSourceName, cdmSource);   
                } catch (Exception e) {
-                       StoreUtil.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
+                       MessagingUtils.error(CdmDataSourceRepository.class, "Error updating CDM Source", e);
                        
                }
                return null;
index 2600f04779d0a1754b5f1e0f44740bd583023dea..5fc4322ef822ff4b992103ccad01b0b5f812b3f4 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
  * Copyright (C) 2009 EDIT\r
- * European Distributed Institute of Taxonomy \r
+ * European Distributed Institute of Taxonomy\r
  * http://www.e-taxonomy.eu\r
- * \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
@@ -52,7 +52,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        public static final String ID = "eu.etaxonomy.taxeditor.editor.definedTerm";\r
 \r
        public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor";\r
-       \r
+\r
        protected TreeViewer viewer;\r
        protected ConversationHolder conversation;\r
        private ISelectionService selectionService;\r
@@ -60,9 +60,9 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
 \r
 \r
 \r
-       private int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;\r
+       private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;\r
        /**\r
-        * \r
+        *\r
         */\r
        public DefinedTermEditor() {\r
                super();\r
@@ -71,42 +71,42 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
 \r
        @Override\r
        public void createPartControl(Composite parent) {\r
-                       \r
+\r
        //              parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));\r
-                       \r
+\r
                        FillLayout layout = new FillLayout();\r
                        layout.marginHeight = 0;\r
                        layout.marginWidth = 0;\r
                        layout.type = SWT.VERTICAL;\r
-                       \r
+\r
                        parent.setLayout(layout);\r
                        viewer = new TreeViewer(parent);\r
                        viewer.getControl().setLayoutData(LayoutConstants.FILL());\r
                        viewer.setContentProvider(new TermContentProvider());\r
                        viewer.setLabelProvider(new TermLabelProvider());\r
                        viewer.setSorter(new ViewerSorter());\r
-                       \r
+\r
                        Transfer[] transfers = new Transfer[] { TermTransfer.getInstance() };\r
                        viewer.addDragSupport(dndOperations, transfers, new DefinedTermDragListener(viewer));\r
                        viewer.addDropSupport(dndOperations, transfers, new DefinedTermDropAdapter(this));\r
-                                                                       \r
+\r
                        getDefinedTermEditorInput().initialiseVocabularies();\r
                        viewer.setInput(getDefinedTermEditorInput().getVocabularies());\r
-                                               \r
+\r
                        getSite().setSelectionProvider(viewer);\r
-                       \r
+\r
                        selectionService = getSite().getWorkbenchWindow().getSelectionService();\r
                        selectionService.addSelectionListener(this);\r
-       \r
+\r
                        setPartName(getEditorInput().getName());\r
                        createMenu();\r
                }\r
-       \r
-       \r
 \r
-       \r
+\r
+\r
+\r
        /**\r
-        * \r
+        *\r
         */\r
        public TermEditorInput getDefinedTermEditorInput() {\r
                return (TermEditorInput) getEditorInput();\r
@@ -117,17 +117,17 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
         */\r
        @Override\r
        public boolean postOperation(CdmBase objectAffectedByOperation) {\r
-                       \r
-               \r
-               viewer.refresh();               \r
-               \r
+\r
+\r
+               viewer.refresh();\r
+\r
                if(objectAffectedByOperation != null){\r
                        viewer.setSelection(new StructuredSelection(objectAffectedByOperation));\r
                }\r
                setDirty(true);\r
 \r
                return true;\r
-       } \r
+       }\r
 \r
        private void createMenu() {\r
                // register context menu\r
@@ -135,14 +135,14 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
                menuManager\r
                                .add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));\r
                getSite().registerContextMenu(ID, menuManager, viewer);\r
-       \r
+\r
                Control control = viewer.getControl();\r
                Menu menu = menuManager.createContextMenu(control);\r
                control.setMenu(menu);\r
        }\r
-       \r
 \r
-               \r
+\r
+\r
 \r
        @Override\r
        public void doSave(IProgressMonitor monitor) {\r
@@ -150,7 +150,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
                setDirty(false);\r
                getDefinedTermEditorInput().initialiseVocabularies();\r
        }\r
-       \r
+\r
 \r
        @Override\r
        public void doSaveAs() {}\r
@@ -159,7 +159,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        public void init(IEditorSite site, IEditorInput input) throws PartInitException {\r
                setSite(site);\r
                setInput(input);\r
-               \r
+\r
        }\r
 \r
        @Override\r
@@ -174,13 +174,14 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
 \r
        @Override\r
        public void setFocus() {\r
+           viewer.getControl().setFocus();\r
                getConversationHolder().bind();\r
        }\r
 \r
        @Override\r
        public void update(CdmDataChangeMap changeEvents) {\r
                // TODO Auto-generated method stub\r
-               \r
+\r
        }\r
 \r
        @Override\r
@@ -191,7 +192,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        @Override\r
        public void selectionChanged(IWorkbenchPart part, ISelection selection) {\r
                // TODO Auto-generated method stub\r
-               \r
+\r
        }\r
 \r
        @Override\r
@@ -216,7 +217,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        }\r
 \r
        /**\r
-        * \r
+        *\r
         */\r
        public TreeViewer getViewer() {\r
                return viewer;\r
index ea74041fde8b84da818019c1f84efc1da529a577..2d223b436df5c1edaa22481b680df118b8c8fa27 100644 (file)
@@ -1,12 +1,12 @@
 // $Id$\r
 /**\r
-* Copyright (C) 2009 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
+ * Copyright (C) 2009 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.definedterm;\r
 \r
 import org.apache.commons.lang.StringUtils;\r
@@ -31,76 +31,81 @@ import eu.etaxonomy.cdm.model.common.TermVocabulary;
  */\r
 public class TermLabelProvider extends StyledCellLabelProvider {\r
 \r
-       private static Color vocColor = Display.getCurrent().getSystemColor(\r
-                       SWT.COLOR_BLUE);\r
-       private Styler vocStyler;\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)\r
-        */\r
-\r
-       /*\r
-        * (non-Javadoc)\r
-        *\r
-        * @see\r
-        * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.\r
-        * jface.viewers.ViewerCell)\r
-        */\r
-       @Override\r
-       public void update(ViewerCell cell) {\r
-               Object element = cell.getElement();\r
-               int columnIndex = cell.getColumnIndex();\r
-\r
-               String text = getText(element);\r
-               cell.setText(text);\r
-\r
-               if (element instanceof TermVocabulary) {\r
-                       StyledString styledString = new StyledString(text, getVocabularyStyler());\r
-                       StyleRange[] styleRanges;\r
-                       styleRanges = styledString.getStyleRanges();\r
-                       cell.setStyleRanges(styleRanges);\r
-               }\r
-               super.update(cell);\r
-       }\r
-\r
-       public StyledString getStyledText(Object element) {\r
-\r
-               if(element instanceof TermVocabulary){\r
-                       new StyledString(getText(element), getVocabularyStyler());\r
-               }\r
-               return  new StyledString(getText(element), StyledString.QUALIFIER_STYLER);\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)\r
-        */\r
-\r
-       public String getText(Object element) {\r
-\r
-           if(element instanceof DefinedTermBase){\r
-               DefinedTermBase<?> dtb = (DefinedTermBase<?>)element;\r
-               if (StringUtils.isNotBlank(dtb.getIdInVocabulary())){\r
-                       return dtb.getIdInVocabulary() + " : " + dtb.getTitleCache();\r
-               } else{\r
-                       return dtb.getTitleCache();\r
-              }\r
-           } else if (element instanceof TermBase){\r
-            return ((TermBase)element).getTitleCache();\r
-           }\r
-\r
-               //FIXME : must throw an exception here\r
-               return element.toString();\r
-       }\r
-\r
-       private Styler getVocabularyStyler() {\r
-               if (vocStyler == null) {\r
-                       vocStyler = new Styler() {\r
-                               @Override\r
-                               public void applyStyles(TextStyle textStyle) {\r
-                                       textStyle.foreground = vocColor;\r
-                               }\r
-                       };\r
-               }\r
-               return vocStyler;\r
-       }\r
+    private static Color vocColor = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);\r
+    private Styler vocStyler;\r
+\r
+    public TermLabelProvider() {\r
+    }\r
+\r
+    public TermLabelProvider(Styler vocStyler){\r
+        this.vocStyler = vocStyler;\r
+    }\r
+\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see\r
+     * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.\r
+     * jface.viewers.ViewerCell)\r
+     */\r
+    @Override\r
+    public void update(ViewerCell cell) {\r
+        Object element = cell.getElement();\r
+        int columnIndex = cell.getColumnIndex();\r
+\r
+        String text = getText(element);\r
+        cell.setText(text);\r
+\r
+        if (element instanceof TermVocabulary) {\r
+            StyledString styledString = new StyledString(text, getVocabularyStyler());\r
+            StyleRange[] styleRanges;\r
+            styleRanges = styledString.getStyleRanges();\r
+            cell.setStyleRanges(styleRanges);\r
+        }\r
+        super.update(cell);\r
+    }\r
+\r
+    public StyledString getStyledText(Object element) {\r
+\r
+        if (element instanceof TermVocabulary) {\r
+            new StyledString(getText(element), getVocabularyStyler());\r
+        }\r
+        return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);\r
+    }\r
+\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)\r
+     */\r
+\r
+    public String getText(Object element) {\r
+\r
+        if (element instanceof DefinedTermBase) {\r
+            DefinedTermBase<?> dtb = (DefinedTermBase<?>) element;\r
+            if (StringUtils.isNotBlank(dtb.getIdInVocabulary())) {\r
+                return dtb.getIdInVocabulary() + " : " + dtb.getTitleCache();\r
+            } else {\r
+                return dtb.getTitleCache();\r
+            }\r
+        } else if (element instanceof TermBase) {\r
+            return ((TermBase) element).getTitleCache();\r
+        }\r
+\r
+        // FIXME : must throw an exception here\r
+        return element.toString();\r
+    }\r
+\r
+    private Styler getVocabularyStyler() {\r
+        if (vocStyler == null) {\r
+            vocStyler = new Styler() {\r
+                @Override\r
+                public void applyStyles(TextStyle textStyle) {\r
+                    textStyle.foreground = vocColor;\r
+                }\r
+            };\r
+        }\r
+        return vocStyler;\r
+    }\r
 \r
 }\r
index f3e09bac07b8070eff0d8c907f18701314b11e97..effe4520fa60cf0f472181d04355af3831904cfe 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateDefinedTermOperation;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -64,7 +65,7 @@ public class CreateDefinedTermHandler extends AbstractHandler implements IHandle
                                        StoreUtil.executeOperation(operation);\r
 \r
                                } catch (NotDefinedException e) {\r
-                                       StoreUtil.error(getClass(), e);\r
+                                       MessagingUtils.error(getClass(), e);\r
                                }\r
                        }\r
                }\r
index 12f349be1b30cd0e1a01c53f051c0901f05c2205..cb08ab728ca6ab49be4025be1016acd37dc6c765 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 \r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateTermVocabularyOperation;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -54,7 +55,7 @@ public class CreateTermVocabularyHandler extends AbstractHandler implements
                                StoreUtil.executeOperation(operation);\r
 \r
                        } catch (NotDefinedException e) {\r
-                               StoreUtil.error(getClass(), e);\r
+                               MessagingUtils.error(getClass(), e);\r
                        }                       \r
                }\r
                return null;\r
index de5d40a13ebb84b80d63c7398a8b4b9c19ca3c65..6a2038534709ea63958236e57366fcd948d9a4a6 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.DeleteTermBaseOperation;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
@@ -66,7 +67,7 @@ public class DeleteTermBaseHandler extends AbstractHandler {
 \r
                                }       \r
                        } catch (NotDefinedException e) {\r
-                               StoreUtil.error(getClass(), e);\r
+                               MessagingUtils.error(getClass(), e);\r
                        }\r
                }\r
                return null;\r
index 25dca2cc66a03d1f960e2137dbf1550981ecd14c..64f8597ebf65c678ab4973cb0cd45dd33c5abd27 100644 (file)
@@ -14,6 +14,7 @@ import org.eclipse.ui.PartInitException;
 import eu.etaxonomy.cdm.model.common.TermType;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
 // $Id$\r
@@ -48,8 +49,8 @@ public class OpenDefinedTermEditorHandler extends AbstractHandler implements IHa
                        String PID = "eu.etaxonomy.taxeditor.application";\r
                        MultiStatus info = new MultiStatus(PID, 1, "You might be missing sufficient permissions to open the Defined Term Editor", null);\r
                        info.add(new Status(IStatus.WARNING, PID, 1, e.getMessage(), null));\r
-                       StoreUtil.errorDialog("Cannot open Defined Term Editor", getClass(), info);\r
-                       StoreUtil.error(getClass(), e);\r
+                       MessagingUtils.errorDialog("Cannot open Defined Term Editor", getClass(), info);\r
+                       MessagingUtils.error(getClass(), e);\r
                }\r
 \r
                return null;\r
index c1e838a9ca056d89e81d845881838fa00e743fc4..b96cacdc0e3799702e0e3e5a416485751b8a5873 100644 (file)
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -64,7 +65,7 @@ public class CreateDefinedTermOperation extends AbstractPostTaxonOperation {
                                        new Status(IStatus.CANCEL, \r
                                                        StoreUtil.getPluginId(), \r
                                                        "Creation of term corresponding to type '" + definedTermInput.getTermType().getMessage() + "' is not yet supported");\r
-                       StoreUtil.warningDialog("Cannot create term", newTerm, status);\r
+                       MessagingUtils.warningDialog("Cannot create term", newTerm, status);\r
                        return status;\r
                }\r
                \r
index 24865969ae937a3694ebfa64c496682567b410a4..d9b72b1ac19f515c659cedf54983b4451334dfc9 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.model.common.TermBase;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
@@ -69,13 +70,13 @@ public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {
                if (termBase instanceof TermVocabulary) {\r
                        if (((TermVocabulary)termBase).getCreatedBy() == null) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system vocabulary");\r
-                               StoreUtil.warningDialog("Cannot delete vocabulary", termBase, status);\r
+                               MessagingUtils.warningDialog("Cannot delete vocabulary", termBase, status);\r
                                return status;\r
                        }\r
                        \r
                        if (!((TermVocabulary)termBase).getTerms().isEmpty()) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Delete all terms from this vocaulary before deleting the vocabulary.");\r
-                               StoreUtil.warningDialog("Vocabulary not empty", termBase, status);\r
+                               MessagingUtils.warningDialog("Vocabulary not empty", termBase, status);\r
                                return status;\r
                        }                       \r
 \r
@@ -93,12 +94,12 @@ public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {
                        \r
                        if (((DefinedTermBase)termBase).getCreatedBy() == null) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system defined term");\r
-                               StoreUtil.warningDialog("Cannot delete defined term", termBase, status);\r
+                               MessagingUtils.warningDialog("Cannot delete defined term", termBase, status);\r
                                return status;\r
                        }\r
                        if(!definedTermBase.getIncludes().isEmpty()){\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This term includes other terms. Please delete the included terms before deleting this term.");                            \r
-                               StoreUtil.warningDialog("Term has included terms", termBase, status);\r
+                               MessagingUtils.warningDialog("Term has included terms", termBase, status);\r
                                return status;\r
                        } \r
                                                \r
index e85d87700eb1ce16804d9b9af78caecfb552f285..5096f49ac31c8ad0113b0ec408e4985d31b4ed2d 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.core.runtime.Status;
 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.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
@@ -64,7 +65,7 @@ public class MoveDefinedTermOperation extends AbstractPostTaxonOperation {
                        // do nothing when moving it on itself\r
                        if(targetTermOrVocabulary.equals(term)){\r
                                Status status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Term can not be added to itself");\r
-                               StoreUtil.informationDialog("", status);\r
+                               MessagingUtils.informationDialog("", status);\r
                                return status;\r
                        }\r
                        \r
@@ -74,7 +75,7 @@ public class MoveDefinedTermOperation extends AbstractPostTaxonOperation {
                                // do nothing when term is top level and gets added to the same vocabulary\r
                                if(term.getPartOf() == null && termVocabulary.equals(term.getVocabulary())){\r
                                        Status status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Term is already in this vocabulary");\r
-                                       StoreUtil.informationDialog("", status);\r
+                                       MessagingUtils.informationDialog("", status);\r
                                        return status;\r
                                }\r
                                \r
index d0216c84a389b76b3725113bb6f725cb0d3ebf18..3c4466647a4ad9405d9fb6d47ed03f01f9f6fe19 100644 (file)
@@ -42,8 +42,8 @@ import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureNode;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>
@@ -309,7 +309,7 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                        // cannot drop a feature node onto itself
                        for (Object droppedObject : droppedObjects) {
                                if (droppedObject == null) {
-                                       StoreUtil.warningDialog(
+                                       MessagingUtils.warningDialog(
                                                                        "Operation not supported yet",
                                                                        this,
                                                                        "We are currently unable to change the order of freshly created "
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDistributionEditorWizardHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDistributionEditorWizardHandler.java
new file mode 100644 (file)
index 0000000..930eead
--- /dev/null
@@ -0,0 +1,39 @@
+// $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.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.wizard.WizardDialog;
+
+import eu.etaxonomy.taxeditor.preference.wizard.AvailableDistributionWizard;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+
+/**
+ * @author a.oppermann
+ * @date 21.07.2014
+ *
+ */
+public class OpenDistributionEditorWizardHandler  extends AbstractHandler{
+
+        String commandID = "eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler";
+
+        @Override
+        public Object execute(ExecutionEvent event) throws ExecutionException {
+            AvailableDistributionWizard availableDistributionWizard = new AvailableDistributionWizard();
+            WizardDialog dialog = new WizardDialog(StoreUtil.getShell(),
+                    availableDistributionWizard);
+
+            dialog.open();
+            return null;
+        }
+
+    }
index 05273d42d92cf3b0626b33993ca0ee522c0451d7..965b07dd72476de835b3a9f0c1d24bf8e599323a 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.jface.wizard.WizardDialog;
 
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.password.PasswordWizard;
 
@@ -48,7 +49,7 @@ public class OpenPasswordWizzardHandler extends AbstractHandler implements IHand
 
            } else {
                // should never happen, log an error
-               AbstractUtility.error(OpenPasswordWizzardHandler.class, "The principal currently authenticated is not a eu.etaxonomy.cdm.model.common.User", null);
+               MessagingUtils.error(OpenPasswordWizzardHandler.class, "The principal currently authenticated is not a eu.etaxonomy.cdm.model.common.User", null);
            }
 
                return null;
index 580fb725d08f4f9179c3333875c489872bac068a..c7b7acc9cf0dc737a853c706c0daa85d3af1e075 100644 (file)
@@ -27,6 +27,7 @@ import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
@@ -111,7 +112,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                                        exporter.invoke(configurator);
                                        monitor.worked(60);
                                } catch (RuntimeException e) {
-                                       StoreUtil.errorDialog("Error exporting data", this,
+                                       MessagingUtils.messageDialog("Error exporting data", this,
                                                        "An error occured while"
                                                                        + "exporting to destination '"
                                                                        + configurator.getDestinationNameString()
@@ -140,7 +141,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                                                                conversationEnabled.getConversationHolder()
                                                                        .commit();
                                                        }catch(RuntimeException e){
-                                                               StoreUtil.errorDialog("Error starting conversation handling", this, "" +
+                                                               MessagingUtils.messageDialog("Error starting conversation handling", this, "" +
                                                                                "Conversation Error: "+ e);
                                                        }
                                                }
@@ -168,7 +169,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                case Sdd:
                        return SDDExportConfigurator.NewInstance(null, null, null);
                default:
-                       StoreUtil.notImplementedMessage(this);
+                       MessagingUtils.notImplementedMessage(this);
                        throw new IllegalArgumentException("Export not supported yet");
                }
        }
index 1496227b9d70427b3aaf552910857671a2b516ac..a607e3f0f43c686cdb0e9e1e346144f1f8ba700d 100644 (file)
@@ -29,8 +29,8 @@ import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>
@@ -98,7 +98,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                                        importer.invoke(configurator);
                                        monitor.worked(80);
                                } catch (RuntimeException e) {
-                                       StoreUtil.errorDialog(
+                                       MessagingUtils.messageDialog(
                                                        "Error importing data",
                                                        this,
                                                        "An error occured while"
@@ -147,7 +147,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
                case SpecimenCdmExcel:
                        return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
                default:
-                       StoreUtil.notImplementedMessage(this);
+                       MessagingUtils.notImplementedMessage(this);
                        throw new IllegalArgumentException("Import not supported yet");
                }
        }
index 9505f4d005cc27d772a78465b29f0663a942ab0f..645ddbed9549232e8c55d0fa7c0444e506b8c205 100644 (file)
@@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Composite;
 
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>
@@ -212,7 +212,7 @@ public class GenericConfiguratorWizardPage extends WizardPage {
 
                 break;
             } catch (Exception e) {
-                StoreUtil.warn(this.getClass(), "Could not invoke method");
+                MessagingUtils.warn(this.getClass(), "Could not invoke method");
             }
         }
 
@@ -237,7 +237,7 @@ public class GenericConfiguratorWizardPage extends WizardPage {
 
                 break;
             } catch (Exception e) {
-                StoreUtil.warn(this.getClass(), "Could not invoke method");
+                MessagingUtils.warn(this.getClass(), "Could not invoke method");
             }
         }
     }
index 9a1e0e16a742a370bf8c13489915bba7f1418bac..2b8c4bbe8a527a62679f7837609eeab4f2479c07 100644 (file)
@@ -20,11 +20,9 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.TreeSet;
 
-import org.apache.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IOperationHistory;
 import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ILog;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.MultiStatus;
@@ -34,8 +32,6 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.ISchedulingRule;
 import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.jface.resource.FontRegistry;
@@ -174,7 +170,7 @@ public abstract class AbstractUtility {
                                        .getActivePage()
                                        .showView(id, null, IWorkbenchPage.VIEW_VISIBLE);
                } catch (PartInitException e) {
-                       errorDialog("Error opening view", AbstractUtility.class, "Could not open view: " + id, e);
+                       MessagingUtils.messageDialog("Error opening view", AbstractUtility.class, "Could not open view: " + id, e);
                        return null;
                }
        }
@@ -288,169 +284,6 @@ public abstract class AbstractUtility {
                return getColorRegistry().get(symbolicName);
        }
 
-       /**
-        * Open a message box that informs the user about unimplemented
-        * functionality. This method is for developer convenience.
-        *
-        * @param source
-        *            a {@link java.lang.Object} object.
-        */
-       public static void notImplementedMessage(Object source) {
-               warningDialog("Not yet implemented", source,
-                               "This functionality is not yet implemented.");
-       }
-
-       /**
-        * <p>
-        * informationDialog
-        * </p>
-        *
-        * @param title
-        *            a {@link java.lang.String} object.
-        * @param message
-        *            a {@link java.lang.String} object.
-        */
-       public static void informationDialog(final String title,
-                       final String message) {
-               Display.getDefault().asyncExec(new Runnable() {
-
-                       @Override
-            public void run() {
-                               MessageDialog.openInformation(getShell(), title, message);
-                       }
-               });
-       }
-
-       public static void informationDialog(final String title,
-                       final IStatus status) {
-               informationDialog(title, status.getMessage());
-       }
-
-       /**
-        * <p>
-        * warningDialog
-        * </p>
-        *
-        * @param title
-        *            The dialogs title
-        * @param source
-        *            The object where the warning was generated (used by log4j)
-        * @param message
-        *            An informative String to be presented to the user
-        */
-       public static void warningDialog(final String title, final Object source,
-                       final String message) {
-               Display.getDefault().asyncExec(new Runnable() {
-
-                       @Override
-            public void run() {
-                               MessageDialog.openWarning(getShell(), title, message);
-                               Class<? extends Object> clazz = source != null ? source
-                                               .getClass() : AbstractUtility.class;
-                               warn(clazz, message);
-                       }
-               });
-       }
-
-       /**
-        * @param title
-        * @param termBase
-        * @param status
-        */
-       public static void warningDialog(String title, Object source,
-                       IStatus status) {
-               warningDialog(title, source, status.getMessage());
-       }
-
-       /**
-        * <p>
-        * errorDialog
-        * </p>
-        *
-        * @param title
-        *            The dialogs title
-        * @param source
-        *            The object where the warning was generated (used by log4j)
-        * @param message
-        *            An informative String to be presented to the user
-        * @param title
-        *            The dialogs title
-        * @param t
-        *            a Throwable if one exists or null
-        */
-       public static void errorDialog(final String title, final Object source,
-                       final String message, final Throwable t) {
-               Display.getDefault().asyncExec(new Runnable() {
-
-                       @Override
-            public void run() {
-                               MessageDialog.openError(getShell(), title, message + getCauseRecursively(t));
-                               Class<? extends Object> clazz = source != null ? source
-                                               .getClass() : this.getClass();
-                               error(clazz, message, t);
-                       }
-
-                       private String getCauseRecursively(Throwable t) {
-                               if(t == null){
-                                       return "";
-                               }
-
-                               if(t.getCause() != null){
-                                       return getCauseRecursively(t.getCause());
-                               }else{
-                                       return String.format("\n\nException: %s\nMessage: %s", t.getClass().getSimpleName(), t.getMessage());
-                               }
-
-                       }
-               });
-       }
-
-       public static void errorDialog(final String title, final Object source,
-                       final String message){
-               errorDialog(title, source, message, null);
-       }
-
-       /**
-        * <p>
-        * errorDialog
-        * </p>
-        *
-        * @param title
-        *            a {@link java.lang.String} object.
-        * @param source
-        *            a {@link java.lang.Object} object.
-        * @param status
-        *            a {@link org.eclipse.core.runtime.IStatus} object.
-        */
-       public static void errorDialog(final String title, final Object source,
-                       final IStatus status) {
-               Display.getDefault().asyncExec(new Runnable() {
-
-                       @Override
-            public void run() {
-                               ErrorDialog.openError(getShell(), title, null, status);
-                               Class<? extends Object> clazz = source != null ? source
-                                               .getClass() : this.getClass();
-                               error(clazz, status);
-                       }
-               });
-       }
-
-       /**
-        * <p>
-        * confirmDialog
-        * </p>
-        *
-        * @param title
-        *            a {@link java.lang.String} object.
-        * @param message
-        *            a {@link java.lang.String} object.
-        * @return a boolean.
-        */
-       public static boolean confirmDialog(String title, String message) {
-               return MessageDialog.openQuestion(getShell(), title, message);
-       }
-
        /**
         * <p>
         * executeOperation
@@ -485,7 +318,7 @@ public abstract class AbstractUtility {
                                                        uiInfoAdapter);
                                } catch (ExecutionException e) {
 
-                                       dialogForAbortedOperation(e, this, operationlabel, null);
+                                       MessagingUtils.operationDialog(this, e, operationlabel, null);
 
                                } finally {
                                        monitor.done();
@@ -501,40 +334,9 @@ public abstract class AbstractUtility {
                try {
                        runInUI(runnable, null);
                } catch (Exception e) {
-                       errorDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
+                       MessagingUtils.messageDialog("Error executing operation", AbstractUtility.class, "An error occured while executing " + operation.getLabel(), e);
                }
 
-               // // Start the main progress monitor.
-               // IProgressMonitor newMonitor =
-               // startMainMonitor(getMonitor(),operation.getLabel(), 100);
-               //
-               // // Check whether operation was canceled and do some steps.
-               // workedChecked(newMonitor, 10);
-               //
-               // try {
-               // IStatus status = getOperationHistory().execute(operation, newMonitor,
-               // WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
-               //
-               // // Check whether operation was canceled and do some steps.
-               // workedChecked(newMonitor, 30);
-               //
-               // String statusString = status.equals(Status.OK_STATUS) ? "completed" :
-               // "cancelled";
-               // setStatusLine(operation.getLabel() + " " + statusString + ".");
-               //
-               // return status;
-               // } catch (ExecutionException e) {
-               // logger.error("Error executing operation: " + operation.getLabel(),
-               // e);
-               // errorDialog("Error executing operation: " + operation.getLabel(),
-               // "Please refer to the error log.");
-               // }
-               // finally {
-               //
-               // // Stop the progress monitor.
-               // newMonitor.done();
-               // }
-
                IPostOperationEnabled postOperationEnabled = operation
                                .getPostOperationEnabled();
                if (postOperationEnabled != null) {
@@ -740,127 +542,6 @@ public abstract class AbstractUtility {
                return (IWorkbenchSiteProgressService) getService(IWorkbenchSiteProgressService.class);
        }
 
-       /**
-        * <p>
-        * info
-        * </p>
-        *
-        * @param message
-        *            a {@link java.lang.String} object.
-        */
-       public static void info(String message) {
-               IStatus status = new Status(IStatus.INFO, getPluginId(), message);
-               info(status);
-       }
-
-       /**
-        * <p>
-        * info
-        * </p>
-        *
-        * @param status
-        *            a {@link org.eclipse.core.runtime.IStatus} object.
-        */
-       public static void info(IStatus status) {
-               log(status);
-       }
-
-       /**
-        * <p>
-        * warn
-        * </p>
-        *
-        * @param source
-        *            a {@link java.lang.Class} object.
-        * @param message
-        *            a {@link java.lang.String} object.
-        */
-       public static void warn(Class source, String message) {
-               IStatus status = new Status(IStatus.WARNING, getPluginId(), message);
-               getLog4JLogger(source).warn(message);
-               log(status);
-       }
-
-       public static void warn(Class source, IStatus status) {
-               getLog4JLogger(source).warn(status.getMessage(), status.getException());
-               log(status);
-       }
-
-       public static void warn(Class source, Throwable t) {
-               IStatus status = new Status(IStatus.WARNING, getPluginId(), t.getMessage(), t);
-               getLog4JLogger(source).warn(t);
-               log(status);
-       }
-
-       /**
-        * <p>
-        * error
-        * </p>
-        *
-        * @param source
-        *            a {@link java.lang.Class} object.
-        * @param t
-        *            a {@link java.lang.Throwable} object.
-        */
-       public static void error(Class source, Throwable t) {
-               error(source.getClass(), t.getMessage(), t);
-       }
-
-       /**
-        * <p>
-        * error
-        * </p>
-        *
-        * @param source
-        *            a {@link java.lang.Class} object.
-        * @param message
-        *            a {@link java.lang.String} object.
-        * @param t
-        *            a {@link java.lang.Throwable} object.
-        */
-       public static void error(Class source, String message, Throwable t) {
-               IStatus status = new Status(IStatus.ERROR, getPluginId(), message, t);
-               error(source, status);
-       }
-
-       /**
-        * <p>
-        * error
-        * </p>
-        *
-        * @param source
-        *            a {@link java.lang.Class} object.
-        * @param status
-        *            a {@link org.eclipse.core.runtime.IStatus} object.
-        */
-       public static void error(Class source, IStatus status) {
-               getLog4JLogger(source)
-                               .error(status.getMessage(), status.getException());
-               log(status);
-       }
-
-       /**
-        * <p>
-        * getLog4JLogger
-        * </p>
-        *
-        * @param clazz
-        *            a {@link java.lang.Class} object.
-        * @return a {@link org.apache.log4j.Logger} object.
-        */
-       public static Logger getLog4JLogger(Class clazz) {
-               return Logger.getLogger(clazz);
-       }
-
-       /**
-        * @see {@link ILog#log(IStatus)}
-        *
-        * @param status
-        */
-       private static void log(IStatus status) {
-               TaxeditorStorePlugin.getDefault().getLog().log(status);
-       }
-
        /**
         * <p>
         * getPluginId
@@ -1021,33 +702,6 @@ public abstract class AbstractUtility {
         }
     }
 
-    public static void dialogForAbortedOperation(Exception e, final Object source,  String operationlabel, String hint) {
-        MultiStatus info = null;
-        String title = null;
-
-        // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
-        // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
-        String PID = "eu.etaxonomy.taxeditor.application";
-
-        RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(e);
-
-        if(securityRuntimeException != null){
-               title = "Your changes could not be saved!";
-               info = new MultiStatus(PID, 1, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint), null);
-               info.add(new Status(IStatus.WARNING, PID, 1, securityRuntimeException.getMessage(), null));
-
-        } else {
-               title = "Error executing operation";
-               info = new MultiStatus(PID, 1, String.format("An error occured while executing %s. %s", operationlabel, hint), null);
-               Writer writer = new StringWriter();
-            PrintWriter printWriter = new PrintWriter(writer);
-            e.printStackTrace(printWriter);
-               info.add(new Status(IStatus.ERROR, PID, 1, writer.toString(), null));
-        }
-
-        errorDialog(title, source, info);
-    }
-
     private static class TermNode<T extends IEnumTerm<T>> implements Comparable<TermNode<T>>{
         private final T term;
         private final TreeSet<TermNode<T>> children;
@@ -1125,4 +779,5 @@ public abstract class AbstractUtility {
         }
     }
 
+
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java
new file mode 100644 (file)
index 0000000..eb5a828
--- /dev/null
@@ -0,0 +1,44 @@
+package eu.etaxonomy.taxeditor.model;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Error dialog class specifically implemented for the editor.
+ * The main difference with {@link org.eclipse.jface.dialogs.ErrorDialog} is that
+ * this dialog has a fixed max height.
+ * 
+ * @author cmathew
+ *
+ */
+public         class CdmErrorDialog extends ErrorDialog {
+
+       private static final int DIALOG_MAX_HEIGHT = 500;
+       
+       public CdmErrorDialog(Shell parentShell, String dialogTitle,
+                       String message, IStatus status) {
+               super(parentShell, 
+                               dialogTitle, 
+                               message, status, 
+                               IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);            
+       }               
+       
+       @Override
+       protected void buttonPressed(int id) {                  
+               super.buttonPressed(id);
+               if (id == IDialogConstants.DETAILS_ID) {
+                       Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
+                       // set height to max allowed
+                       if(getShell().getSize().y > DIALOG_MAX_HEIGHT) {
+                               getShell().setSize(getShell().getSize().x, 500);
+                       } else {
+                               getShell().setSize(getShell().getSize().x, oldSize.y);
+                       }
+               }
+               
+       }                                       
+}
index 87dec860ab71e9b2dd8b7b14ac8a456cb1a31b5e..f9e994006d61a6d298335a404928169a2eaa9d8a 100644 (file)
@@ -94,13 +94,13 @@ public class CdmProgressMonitorAdapter implements eu.etaxonomy.cdm.common.monito
        /** {@inheritDoc} */
        @Override
        public void warning(String message) {
-               StoreUtil.warn(this.getClass(), message);
+               MessagingUtils.warn(this.getClass(), message);
        }
 
        /** {@inheritDoc} */
        @Override
        public void warning(String message, Throwable throwable) {
-               StoreUtil.error(this.getClass(), message, throwable);
+               MessagingUtils.error(this.getClass(), message, throwable);
        }
 
        @Override
index 50c0047ce9d0fb59555ce42a2574e928a15d8b3e..af6a0674be5f4dca96509a0a23a387abec4381a8 100644 (file)
@@ -45,7 +45,6 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>DescriptionHelper class.</p>
@@ -134,10 +133,10 @@ public class DescriptionHelper {
                        
                }
                if(element instanceof Distribution){
-                       StoreUtil.warn(DescriptionHelper.class, "trying to set cache on distribution, don't know what to do at the moment.");
+                       MessagingUtils.warn(DescriptionHelper.class, "trying to set cache on distribution, don't know what to do at the moment.");
                        return;
                }
-               StoreUtil.warn(DescriptionHelper.class, "No matching subclass found for DescriptionElementBase object, 'cache' not set.");
+               MessagingUtils.warn(DescriptionHelper.class, "No matching subclass found for DescriptionElementBase object, 'cache' not set.");
        }
        
        /**
@@ -167,7 +166,7 @@ public class DescriptionHelper {
                                return ((IdentifiableEntity) element).getTitleCache();
                        }catch(LazyInitializationException e){
                                String result = "No Session to initialize title cache for IdentifiableEntity";
-                               StoreUtil.error(DescriptionHelper.class, result, e);
+                               MessagingUtils.error(DescriptionHelper.class, result, e);
                                return "TODO: " + result;
                        }
                }
@@ -187,7 +186,7 @@ public class DescriptionHelper {
                                return CdmUtils.concat("; ", new String[]{originalSource.getIdNamespace(), originalSource.getIdInSource(), sourceObjectTitle});
                        }catch(LazyInitializationException e){
                                String result = "Error initializing title cache for ISourceable of an OriginalSourceBase";
-                               StoreUtil.error(DescriptionHelper.class, result, e);
+                               MessagingUtils.error(DescriptionHelper.class, result, e);
                                return "TODO: " + result;
                        }
                }
index 1a40df53cf34b9973a81dfc06913763c65dfd3b7..81947acc6f825c1f27784eb3654ca83bdcb10c10 100644 (file)
@@ -198,7 +198,7 @@ public class ImageResources {
                        } catch (MalformedURLException e) {
                                // should never happen
                        } catch (Exception e) {
-                               AbstractUtility.error(ImageResources.class, e);
+                               MessagingUtils.error(ImageResources.class, e);
                        }
 
 //                     logger.warn(ImageDescriptor.getMissingImageDescriptor().getClass());
index 9a8c6ea870d42b98a94145ae5eed05c7e46a8e06..ea31c1ce9eed2871d49ff2aa5d3fca6f59111079 100644 (file)
@@ -24,7 +24,6 @@ import org.eclipse.ui.IMemento;
 import org.eclipse.ui.WorkbenchException;
 import org.eclipse.ui.XMLMemento;
 
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>MementoHelper class.</p>
@@ -50,9 +49,9 @@ public class MementoHelper {
                                        new InputStreamReader(input, "utf-8")); //$NON-NLS-1$
                        return XMLMemento.createReadRoot(reader);
                } catch (WorkbenchException e) {
-                       StoreUtil.error(MementoHelper.class, "Exception while reading the memento", e);
+                       MessagingUtils.error(MementoHelper.class, "Exception while reading the memento", e);
                } catch (UnsupportedEncodingException e) {
-                       StoreUtil.error(MementoHelper.class, "Exception while reading the memento", e);
+                       MessagingUtils.error(MementoHelper.class, "Exception while reading the memento", e);
                }
 
                return null;
@@ -81,7 +80,7 @@ public class MementoHelper {
                        writer.close();
                } catch (IOException e) {
                        stateFile.delete();
-                       StoreUtil.error(MementoHelper.class, "Could not save datasource state", e);
+                       MessagingUtils.error(MementoHelper.class, "Could not save datasource state", e);
                        return null;
                }
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
new file mode 100644 (file)
index 0000000..0e8e2c4
--- /dev/null
@@ -0,0 +1,446 @@
+package eu.etaxonomy.taxeditor.model;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.persistence.hibernate.permission.SecurityExceptionUtils;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+
+/**
+ * Utility class which handles all the messaging information generated by the
+ * Editor.
+ * 
+ * This includes logging as well as dialogs.
+ * 
+ * @author cmathew
+ *
+ */
+public class MessagingUtils {
+       public final static String UNEXPECTED_ERROR_MESSAGE = "This is an unexpected error.";
+       public final static String CONTACT_MESSAGE = System.getProperty("line.separator") +  "Please contact EDIT Support (EditSupport@bgbm.org) with the error trace below (click on the 'Details' button).";
+
+       /**
+        * Gets the Log4J logger for a given class
+        *
+        * @param clazz
+        *            a {@link java.lang.Class} object.
+        * @return a {@link org.apache.log4j.Logger} object.
+        */
+       public static Logger getLog4JLogger(Class clazz) {
+               return Logger.getLogger(clazz);
+       }
+       
+       /**
+        * Logs details from a given Status object
+        *
+        * @param status
+        *                              a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       private static void log(IStatus status) {
+               TaxeditorStorePlugin.getDefault().getLog().log(status);
+       }
+
+       /**
+        * Logs a status object as information.  
+        *
+        * @param status
+        *            a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       public static void info(IStatus status) {
+               log(status);
+       }
+
+       /**
+        * Logs a string as information.         
+        *
+        * @param message
+        *            a {@link java.lang.String} object.
+        */
+       public static void info(String message) {
+               IStatus status = new Status(IStatus.INFO, AbstractUtility.getPluginId(), message);
+               info(status);
+       }
+
+       /**
+        * Logs an exception from a given source as a warning.   
+        * 
+        * @param source
+        * @param t
+        */
+       public static void warn(Class source, Throwable t) {
+               IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), t.getMessage(), t);
+               MessagingUtils.getLog4JLogger(source).warn(t);
+               log(status);
+       }
+
+       /**
+        * Logs a status object from a given source as a warning.        
+        * 
+        * @param source
+        * @param status
+        */
+       public static void warn(Class source, IStatus status) {
+               MessagingUtils.getLog4JLogger(source).warn(status.getMessage(), status.getException());
+               log(status);
+       }
+
+       /**
+        * Logs a string from a given source as a warning.       
+        * 
+        *
+        * @param source
+        *            a {@link java.lang.Class} object.
+        * @param message
+        *            a {@link java.lang.String} object.
+        */
+       public static void warn(Class source, String message) {
+               IStatus status = new Status(IStatus.WARNING, AbstractUtility.getPluginId(), message);
+               MessagingUtils.getLog4JLogger(source).warn(message);
+               log(status);
+       }
+
+       /**
+        * Logs a status object from a given source as an error.         
+        * 
+        *
+        * @param source
+        *            a {@link java.lang.Class} object.
+        * @param status
+        *            a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       public static void error(Class source, IStatus status) {
+               getLog4JLogger(source)
+                               .error(status.getMessage(), status.getException());
+               log(status);
+       }
+
+       /**
+        * Logs a string and exception from a given source as an error.  
+        * 
+        *
+        * @param source
+        *            a {@link java.lang.Class} object.
+        * @param message
+        *            a {@link java.lang.String} object.
+        * @param t
+        *            a {@link java.lang.Throwable} object.
+        */
+       public static void error(Class source, String message, Throwable t) {
+               IStatus status = new Status(IStatus.ERROR, AbstractUtility.getPluginId(), message, t);
+               error(source, status);
+       }
+
+
+
+       /**
+        * Logs an exception from a given source as an error.    
+        * 
+        *
+        * @param source
+        *            a {@link java.lang.Class} object.
+        * @param t
+        *            a {@link java.lang.Throwable} object.
+        */
+       public static void error(Class source, Throwable t) {
+               error(source.getClass(), t.getMessage(), t);
+       }
+
+       /**
+        * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+        *
+        * @param title
+        *            a {@link java.lang.String} object.
+        * @param source
+        *            a {@link java.lang.Object} object.
+        * @param status
+        *            a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       public static void errorDialog(final String title, 
+                       final Object source, 
+                       final String message, 
+                       final IStatus status) {
+
+               Display.getDefault().asyncExec(new Runnable() {
+
+                       @Override
+                       public void run() {             
+                               CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
+                               ced.open();
+                               Class<? extends Object> clazz = source != null ? source
+                                               .getClass() : this.getClass();
+                                               error(clazz, status);
+                       }
+               });
+       }
+       
+       /**
+        * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+        * 
+        * @param title
+        * @param source
+        * @param message
+        * @param pluginId
+        * @param t
+        */
+       public static void errorDialog(final String title, 
+                       final Object source,
+                       final String message,
+                       final String pluginId,                  
+                       final Throwable t,
+                       boolean addContactMesg) {
+               // Usually the status contains only the first line of the stack trace.
+               // For the unexpected messages we need the entire stack trace so we 
+               // create a new status with the entire stacktrace       
+               StringWriter sw = new StringWriter();
+               t.printStackTrace(new PrintWriter(sw));
+               String finalMessage = t.getMessage();
+               if(addContactMesg) {
+                       finalMessage += MessagingUtils.CONTACT_MESSAGE;
+               }
+               IStatus status = new Status(IStatus.ERROR, 
+                               pluginId, 
+                               finalMessage, 
+                               new Exception(sw.toString()));   
+               errorDialog(title, source, message, status);
+       }
+       
+
+       
+       /**
+        * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+        *
+        * @param title
+        *            a {@link java.lang.String} object.
+        * @param source
+        *            a {@link java.lang.Object} object.
+        * @param status
+        *            a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       public static void errorDialog(final String title, 
+                       final Object source, 
+                       final String message, 
+                       final IStatus status,
+                       final boolean showStackTrace) {             
+               if(showStackTrace && status.getException() != null) {                                           
+                       errorDialog(title, source,  status.getPlugin(), message, status.getException(),true);
+               } else {
+                       errorDialog(title, source, message, status);
+               }                       
+       }
+       
+
+       /**
+        * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+        *
+        * @param title
+        *            a {@link java.lang.String} object.
+        * @param source
+        *            a {@link java.lang.Object} object.
+        * @param status
+        *            a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       public static void errorDialog(final String title, final Object source,
+                       final IStatus status) {
+               errorDialog(title, source, null, status);
+       }
+       
+       /**
+        * Displays a dialog for an exception occurring in an operation.
+        * 
+        * This will be either a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog} in case of a 
+        * security runtime exception or a warning {@link org.eclipse.jface.dialogs.MessageDialog} in
+        * case of any other exception.
+        *
+        * @param title
+        *            a {@link java.lang.String} object.
+        * @param source
+        *            a {@link java.lang.Object} object.
+        * @param status
+        *            a {@link org.eclipse.core.runtime.IStatus} object.
+        */
+       public static void operationDialog(final Object source,                         
+                       final Exception ex,
+                       final String operationlabel, 
+                       final String hint) {
+
+               Display.getDefault().asyncExec(new Runnable() {
+
+                       @Override
+                       public void run() {             
+                               MultiStatus info = null;
+                       String title = null;
+                       
+                       // FIXME cannot access TaxonomicEditorPlugin.PLUGIN_ID from here
+                       // String PID = TaxonomicEditorPlugin.PLUGIN_ID;
+                       String PID = "eu.etaxonomy.taxeditor.application";
+
+                       // checking security exceptions for every operation
+                       RuntimeException securityRuntimeException = SecurityExceptionUtils.findSecurityRuntimeException(ex);
+
+                       // in case of a security exception it is a warning, else it is an error
+                       if(securityRuntimeException != null){
+                               title = "Your changes could not be saved!";
+                               warningDialog(title, source, String.format("You are missing sufficient permissions for the operation \"%s\". %s", operationlabel, hint));
+                       } else {
+                               title = "Error executing operation";                            
+                               errorDialog(title, source, String.format("An error occured while executing %s. %s", operationlabel, hint), PID, ex, true);
+                               
+                       }
+                       
+                       
+                       }
+               });
+       }
+       
+       
+
+
+       /**
+        * Displays a question {@link org.eclipse.jface.dialogs.MessageDialog}.
+        *
+        * @param title
+        *            a {@link java.lang.String} object.
+        * @param message
+        *            a {@link java.lang.String} object.
+        * @return a boolean.
+        */
+       public static boolean confirmDialog(String title, String message) {
+               return MessageDialog.openQuestion(AbstractUtility.getShell(), title, message);
+       }
+
+       /**
+        * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
+        * 
+        * @param title
+        * @param source
+        * @param message
+        */
+       public static void messageDialog(final String title, final Object source, final String message) {
+               MessagingUtils.messageDialog(title, source, message, null);
+       }
+
+       /**
+        * Displays an error {@link org.eclipse.jface.dialogs.MessageDialog}.
+        *
+        * @param title
+        *            The dialogs title
+        * @param source
+        *            The object where the warning was generated (used by log4j)
+        * @param message
+        *            An informative String to be presented to the user
+        * @param title
+        *            The dialogs title
+        * @param t
+        *            a Throwable if one exists or null
+        */
+       public static void messageDialog(final String title, final Object source,
+                       final String message, final Throwable t) {
+               Display.getDefault().asyncExec(new Runnable() {
+       
+                       @Override
+               public void run() {
+                               MessageDialog.openError(AbstractUtility.getShell(), title, message + getCauseRecursively(t));
+                               Class<? extends Object> clazz = source != null ? source
+                                               .getClass() : this.getClass();
+                               error(clazz, message, t);
+                       }
+       
+                       private String getCauseRecursively(Throwable t) {
+                               if(t == null){
+                                       return "";
+                               }
+       
+                               if(t.getCause() != null){
+                                       return getCauseRecursively(t.getCause());
+                               }else{
+                                       return String.format("\n\nException: %s\nMessage: %s", t.getClass().getSimpleName(), t.getMessage());
+                               }
+       
+                       }
+               });
+       }
+
+       /**
+        * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
+        * 
+        * @param title
+        * @param termBase
+        * @param status
+        */
+       public static void warningDialog(String title, Object source,
+                       IStatus status) {
+               MessagingUtils.warningDialog(title, source, status.getMessage());
+       }
+
+       /**
+        * Displays a warning {@link org.eclipse.jface.dialogs.MessageDialog}.
+        *
+        * @param title
+        *            The dialogs title
+        * @param source
+        *            The object where the warning was generated (used by log4j)
+        * @param message
+        *            An informative String to be presented to the user
+        */
+       public static void warningDialog(final String title, final Object source, final String message) {
+               Display.getDefault().asyncExec(new Runnable() {
+       
+                       @Override
+               public void run() {
+                               MessageDialog.openWarning(AbstractUtility.getShell(), title, message);
+                               Class<? extends Object> clazz = source != null ? source
+                                               .getClass() : AbstractUtility.class;
+                               warn(clazz, message);
+                       }
+               });
+       }
+
+       /**
+        * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
+        * 
+        * @param title
+        * @param status
+        */
+       public static void informationDialog(final String title, final IStatus status) {
+               MessagingUtils.informationDialog(title, status.getMessage());
+       }
+
+       /**
+        * Displays an information {@link org.eclipse.jface.dialogs.MessageDialog}.
+        *
+        * @param title
+        *            a {@link java.lang.String} object.
+        * @param message
+        *            a {@link java.lang.String} object.
+        */
+       public static void informationDialog(final String title,
+                       final String message) {
+               Display.getDefault().asyncExec(new Runnable() {
+       
+                       @Override
+               public void run() {
+                               MessageDialog.openInformation(AbstractUtility.getShell(), title, message);
+                       }
+               });
+       }
+
+       /**
+        * Open a message box that informs the user about unimplemented
+        * functionality. This method is for developer convenience.
+        *
+        * @param source
+        *            a {@link java.lang.Object} object.
+        */
+       public static void notImplementedMessage(Object source) {
+               warningDialog("Not yet implemented", source,
+                               "This functionality is not yet implemented.");
+       }
+
+}
index 194bc3c7a66cc560dd971e896e9b39c094a462e4..07f4c2126855ac80134eb20f2f8ad43ee6caed47 100644 (file)
@@ -13,8 +13,8 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 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.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeWizardPage;
 
 /**
@@ -48,7 +48,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITaxonTreeNode>{
                                TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference());
                                generatedTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).saveOrUpdate(taxonNode);
                        }catch(IllegalArgumentException e){
-                               StoreUtil.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
+                               MessagingUtils.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
                        }
                }
        }
index 0ca07983aaf269d2acd64d8edb7b03239c6943d6..9fc72e2b883a582e44396a7c9be12fc2aa3bfa12 100644 (file)
@@ -16,9 +16,9 @@ import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>ParseHandler class.</p>
@@ -222,9 +222,9 @@ public class ParseHandler{
                if(matchMatrix.duplicateInReferences.size() > 0){
                        Reference inReference = (Reference) matchMatrix.duplicateInReferences.iterator().next();
                        reference.setInReference(inReference);
-                       StoreUtil.warn(this.getClass(), reference.generateTitle());
+                       MessagingUtils.warn(this.getClass(), reference.generateTitle());
                        // FIXME TODO resolve multiple duplications. We use first match for a start
-                       StoreUtil.warn(this.getClass(), reference.getTitleCache());
+                       MessagingUtils.warn(this.getClass(), reference.getTitleCache());
                }
        }
        
@@ -301,7 +301,7 @@ public class ParseHandler{
                try{
                        return CdmStore.getService(ICommonService.class).findMatching(nomenclaturalReference, MatchStrategyConfigurator.ReferenceMatchStrategy());
                }catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), "Error finding matching references", e);
+                       MessagingUtils.error(this.getClass(), "Error finding matching references", e);
                }
                return null;
        }
@@ -319,7 +319,7 @@ public class ParseHandler{
                try{
                        return CdmStore.getService(ICommonService.class).findMatching(authorTeam, MatchStrategyConfigurator.TeamOrPersonMatchStrategy());
                }catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), "Error finding matching authors", e);
+                       MessagingUtils.error(this.getClass(), "Error finding matching authors", e);
                }
                return null;
        }
@@ -334,7 +334,7 @@ public class ParseHandler{
                        return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
                        
                } catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), "Error finding matching names", e);
+                       MessagingUtils.error(this.getClass(), "Error finding matching names", e);
                }
                return null;
        }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
new file mode 100644 (file)
index 0000000..ca82b0e
--- /dev/null
@@ -0,0 +1,95 @@
+// $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.preference;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+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.ui.element.CommandHandlerButton;
+
+/**
+ * @author a.oppermann
+ * @date 21.07.2014
+ *
+ */
+public class ChecklistEditorGeneralPreference extends PreferencePage implements IWorkbenchPreferencePage {
+
+    boolean isEditorActivated;
+    Composite child ;
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors
+     * ()
+     */
+    @Override
+    protected Control createContents(Composite parent) {
+
+        Composite composite = new Composite(parent, SWT.NULL);
+        composite.setLayout(new GridLayout());
+        isEditorActivated = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
+        final Button activateCheckButton = new Button(composite, SWT.CHECK);
+        activateCheckButton.setText("Enable Checklist Editor");
+        activateCheckButton.setSelection(isEditorActivated);
+        activateCheckButton.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                isEditorActivated = activateCheckButton.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE, isEditorActivated);
+                if(isEditorActivated){
+                    child.setVisible(true);
+                    child.setEnabled(true);
+                }else{
+                    child.setVisible(false);
+                    child.setEnabled(false);
+                }
+
+            }
+        });
+
+        child  = new Composite(composite, SWT.NULL);
+        child.setLayout(new GridLayout());
+        child.setVisible(isEditorActivated);
+        final CLabel label = new CLabel(child, SWT.NULL);
+        label.setText("Please open the wizard below, in order to \n" + "choose the areas for the Checklist Editor");
+        final CommandHandlerButton button_openFeatureTree = new CommandHandlerButton(child, SWT.PUSH,
+                "eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler");
+
+        button_openFeatureTree.setText("Open Distribution Selection Wizard");
+        if(isEditorActivated){
+            child.setEnabled(true);
+        }else{
+            child.setEnabled(false);
+        }
+
+        return composite;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+     */
+    @Override
+    public void init(IWorkbench workbench) {
+    }
+
+}
index 27db8420b3f049bd60f6e65ee54440d1778b6df6..1f7a15b6bc49a30ae824c2c8a20073551ba56409 100644 (file)
@@ -118,4 +118,15 @@ public interface IPreferenceKeys {
        public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
 
     public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
+
+
+    public static final String DISTRIBUTION_AREA_PREFRENCES_ACTIVE = "eu.etaxonomy.taxeditor.checklist.distributionAreaPreferencesActive";
+
+    public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatus";
+
+    public static final String DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED = "eu.etaxonomy.taxeditor.checklist.distributionAreaStatusGrayed";
+
+    // TODO RL
+    public static final String IS_RL = "eu.etaxonomy.taxeditor.isRL";
+
 }
index aee9397c910af0f5c1c76775635539f054f42f8d..8a00f1ff73be6da4e71414d9ede15a3b238b7dab 100644 (file)
@@ -1,9 +1,9 @@
 // $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.
 */
@@ -21,18 +21,23 @@ public class PreferencePropertyTester extends PropertyTester {
 
 
        private static final String SHOW_EXPERIMENTAL_FEATURES = "isShowExperimentalFeatures";
-       
+
+       private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled";
+
        /* (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();
+           }
+
                return false;
        }
 
@@ -42,5 +47,8 @@ public class PreferencePropertyTester extends PropertyTester {
        private boolean isShowExperimentalFeatures() {
                return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES);
        }
-       
+
+       private boolean isChecklistEditorEnabled() {
+        return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
+    }
 }
index 6ac38fab5c6ef33835d156109bb16aaf935cbdf2..9a0e836a4eeab5a8ed75aa80d9ec52f2e78ee210 100644 (file)
@@ -40,9 +40,9 @@ import eu.etaxonomy.cdm.strategy.match.DefaultMatchStrategy;
 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.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
@@ -127,7 +127,7 @@ public class PreferencesUtil implements IPreferenceKeys {
                                try {
                                        matchStrategy.setMatchMode(fieldName, matchMode);
                                } catch (MatchException e) {
-                                       StoreUtil.error(PreferencesUtil.class, e);
+                                       MessagingUtils.error(PreferencesUtil.class, e);
                                        throw new RuntimeException(e);
                                }
                        }
@@ -226,7 +226,7 @@ public class PreferencesUtil implements IPreferenceKeys {
                String key = cdmBase.getClass().getName().concat(".")
                                .concat(cdmBase.getUuid().toString());
                if (key.contains("javassist")) {
-                       StoreUtil.info("proxy");
+                       MessagingUtils.info("proxy");
                }
                return key;
        }
@@ -242,7 +242,7 @@ public class PreferencesUtil implements IPreferenceKeys {
                String key = simpleTerm.getClass().getName().concat(".")
                                .concat(simpleTerm.getUuid().toString());
                if (key.contains("javassist")) {
-                       StoreUtil.warn(PreferencesUtil.class,
+                       MessagingUtils.warn(PreferencesUtil.class,
                                        "Trying to persist a preference based on a proxy class.");
                }
                return key;
@@ -261,7 +261,7 @@ public class PreferencesUtil implements IPreferenceKeys {
                String key = definedTerm.getClass().getName().concat(".")
                                .concat(definedTerm.getUuid().toString());
                if (key.contains("javassist")) {
-                       StoreUtil.warn(PreferencesUtil.class,
+                       MessagingUtils.warn(PreferencesUtil.class,
                                        "Trying to persist a preference based on a proxy class.");
                }
                return key;
index ef581b5b099416ce15c9d40d76577ad6a239966b..f217610d4d4999a3fd3fad28eb900a33d3178564 100644 (file)
@@ -34,7 +34,6 @@ public class SpecimenOrObservationPreferences extends FieldEditorPreferencePage
      */
     @Override
     protected void createFieldEditors() {
-
         addField(new BooleanFieldEditor(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS,
                 "Taxon determination only on FieldUnit level",
                 getFieldEditorParent()));
index d2a229be456cbdcb02b73e7b8c0556012f07fab5..3ac5d747075613aea512642724a5ceb31b65eea1 100644 (file)
@@ -57,6 +57,7 @@ public class TaxonomicEditorGeneralPreferences extends
                addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
                                "Open search results in separate windows",
                                getFieldEditorParent()));
+
        }
 
        /*
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TemplatePreferencePage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TemplatePreferencePage.java
new file mode 100644 (file)
index 0000000..f8255b8
--- /dev/null
@@ -0,0 +1,37 @@
+// $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.preference;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author a.oppermann
+ * @date 13.08.2014
+ *
+ */
+public class TemplatePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+    @Override
+    public void init(IWorkbench workbench) {
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+     */
+    @Override
+    protected void createFieldEditors() {
+        addField(new BooleanFieldEditor(IPreferenceKeys.IS_RL, "Rote Liste 2020",  getFieldEditorParent()));
+    }
+
+}
index 0a5e1589c310da3df7209b6c34d30380d01b0067..79ac53cd873793fc34eafad7b99b25f225d79dd7 100644 (file)
@@ -32,8 +32,8 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 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.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>Abstract AbstractMatchingPreferences class.</p>
@@ -143,7 +143,7 @@ public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity>
                        try {
                                matchStrategy.setMatchMode(fieldName, matchMode);
                        } catch (MatchException e) {
-                               StoreUtil.error(this.getClass(), e);
+                               MessagingUtils.error(this.getClass(), e);
                                throw new RuntimeException(e);
                        }
                }
@@ -227,7 +227,7 @@ public abstract class AbstractMatchingPreferences<T extends IdentifiableEntity>
                        }
                        
                } catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), e);
+                       MessagingUtils.error(this.getClass(), e);
                        throw new RuntimeException(e);
                }
                super.performDefaults();
index 0874465d68fba3c22c8a64f7606af61c4d5aa0ca..72acd566669b98c4b4ce9b457b67dfe03ed6c871 100644 (file)
@@ -15,8 +15,8 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>NonViralNameMatchingPreference class.</p>
@@ -37,7 +37,7 @@ public class NonViralNameMatchingPreference extends AbstractMatchingPreferences<
                try {
                        matchStrategy = MatchStrategyConfigurator.NonViralNameMatchStrategy();
                } catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), e);
+                       MessagingUtils.error(this.getClass(), e);
                        throw new RuntimeException(e);
                }
        }
index b6b5af25a72669b4cb76a3eaf9fcc73a56378f82..fd3fbdd32b24422a08f29d27e8996f0d9b10e46f 100644 (file)
@@ -15,8 +15,8 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>ReferenceMatchingPreference class.</p>
@@ -37,7 +37,7 @@ public class ReferenceMatchingPreference extends AbstractMatchingPreferences<Ref
                try {
                        matchStrategy = MatchStrategyConfigurator.ReferenceMatchStrategy();
                } catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), e);
+                       MessagingUtils.error(this.getClass(), e);
                        throw new RuntimeException(e);
                }
        }
index ae3c3f06f2f51feab7ae3a21b21626e9d075d906..4cce0cf6d817a637996a5c037c71046b476d07be 100644 (file)
@@ -15,8 +15,8 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>TeamOrPersonMatchingPreference class.</p>
@@ -39,7 +39,7 @@ public class TeamOrPersonMatchingPreference extends
                try {
                        matchStrategy = MatchStrategyConfigurator.TeamOrPersonMatchStrategy();
                } catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), e);
+                       MessagingUtils.error(this.getClass(), e);
                        throw new RuntimeException(e);
                }
        }       
index 112a66cbe71041249b55fc045fba06c894c58c74..acf22fdb817f525016477f62757f37e0720a723f 100644 (file)
@@ -44,6 +44,7 @@ import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.wizard.VocabularyTermWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -251,14 +252,14 @@ public abstract class AbstractMenuPreferences<T extends DefinedTermBase> extends
                                                        throw new RuntimeException("Could not find open command: "
                                                                        + DefinedTermEditor.OPEN_COMMAND_ID);
                                                } catch (Exception e) {
-                                                       StoreUtil
+                                                       MessagingUtils
                                                                        .error(getClass(),
                                                                                        "An exception occured while trying to open a selection",
                                                                                        e);
                                                }
                                        }
                                } catch (NotDefinedException e) {
-                                       StoreUtil
+                                       MessagingUtils
                                        .error(getClass(),
                                                        "An exception occured while trying to open the Term Editor",
                                                        e);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
new file mode 100644 (file)
index 0000000..cc3ec2f
--- /dev/null
@@ -0,0 +1,248 @@
+// $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.preference.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.api.service.ITermService;
+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.editor.definedterm.TermContentProvider;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermLabelProvider;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author a.oppermann
+ * @date 21.07.2014
+ *
+ */
+public class AvailableDistributionPage extends WizardPage {
+
+    private CheckboxTreeViewer viewer;
+
+    private Set<TermVocabulary<DefinedTermBase>> vocabularies;
+
+    /**
+     * @param pageName
+     */
+    protected AvailableDistributionPage(String pageName) {
+        super(pageName);
+        // TODO check if configuration exists
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+     * .Composite)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void createControl(Composite parent) {
+        IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+        String checkedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
+        String grayedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED);
+        setTitle("Select areas for ChecklistEditor");
+        setDescription("In order to be able to modify and see the distribution status of taxa,\n"
+                + "you have to select the areas which you like to see.");
+        Composite composite = new Composite(parent, SWT.NULL);
+        composite.setLayout(new GridLayout());
+        viewer = new CheckboxTreeViewer(composite, SWT.NULL);
+        viewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+        viewer.setContentProvider(new TermContentProvider());
+        Styler styler = new Styler() {
+            @Override
+            public void applyStyles(TextStyle textStyle) {
+                textStyle.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
+            }
+        };
+        viewer.setLabelProvider(new TermLabelProvider(styler));
+        viewer.addCheckStateListener(new ICheckStateListener() {
+
+            private boolean ignoreCheckEvent = false;
+
+            @Override
+            public void checkStateChanged(CheckStateChangedEvent event) {
+
+
+                if (ignoreCheckEvent ) {
+                    return;
+                }
+
+                ignoreCheckEvent = true;
+
+                try {
+                    TreePath path  = ((ITreeSelection) viewer.getSelection()).getPaths()[0];
+                    checkChildren(path, event.getChecked());
+                    checkParents(path.getParentPath());
+                }
+                finally {
+                    ignoreCheckEvent = false;
+                }
+                checkNoneChecked();
+            }
+        });
+        // TODO: write listener or toggle button to select all named areas
+
+        rememberCheckedValues(checkedValues, grayedValues);
+        setControl(composite);
+    }
+
+
+    protected List<TermVocabulary<DefinedTermBase>> initialiseVocabularies() {
+        if (vocabularies != null) {
+            vocabularies.clear();
+        }
+        List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(
+                TermType.NamedArea);
+        return vocs;
+    }
+
+    private void rememberCheckedValues(String checkedValues, String grayedValues) {
+        viewer.setInput(initialiseVocabularies());
+
+        if (grayedValues != null && grayedValues != "") {
+            String[] listGrayed = grayedValues.split(",");
+            ArrayList listGrayedTerms = new ArrayList();
+            getTermsFromStringValues(listGrayed, listGrayedTerms);
+            for(Object element : listGrayedTerms){
+                if(element != null){
+                    viewer.setGrayChecked(element, true);
+                }
+            }
+        }
+        if (checkedValues != null && checkedValues != "") {
+            String[] listChecked = checkedValues.split(",");
+            ArrayList<DefinedTermBase<?>> listCheckedTerms = new ArrayList<DefinedTermBase<?>>();
+            getTermsFromStringValues(listChecked, listCheckedTerms);
+            for(Object element : listCheckedTerms){
+                if(element != null){
+                    viewer.setChecked(element, true);
+                }
+            }
+        }
+    }
+
+    /**
+     * @param split
+     * @param termlist
+     */
+    private void getTermsFromStringValues(String[] split, ArrayList termlist) {
+        List<String> listValue = Arrays.asList(split);
+        for (String s : listValue) {
+            UUID uuid = UUID.fromString(s);
+            ITermService termService = CdmStore.getService(ITermService.class);
+            DefinedTermBase definedTermBase = termService.load(uuid);
+            if(definedTermBase != null){
+                termlist.add(definedTermBase);
+            }else{
+                IVocabularyService vocabularyService = CdmStore.getService(IVocabularyService.class);
+                TermVocabulary termVocabulary = vocabularyService.load(uuid);
+                termlist.add(termVocabulary);
+            }
+        }
+    }
+
+    private boolean checkNoneChecked() {
+
+        if (viewer.getCheckedElements().length == 0) {
+            setMessage("Please check at least one item", WARNING);
+            return true;
+        } else {
+            setMessage(null);
+            return false;
+        }
+    }
+
+    /**
+     * @return the viewer
+     */
+    public CheckboxTreeViewer getViewer() {
+        return viewer;
+    }
+
+    /**
+     *
+     * @param path
+     */
+    private void checkParents(final TreePath path) {
+        if (path == null) {
+            return;
+        }
+        TermContentProvider tcp = new TermContentProvider();
+        Object treeElement = path.getLastSegment();
+
+        if (treeElement != null) {
+            boolean allChecked = true;
+            boolean allUnchecked = true;
+            for (final Object fieldElement : tcp.getChildren(treeElement)) {
+                allChecked = allChecked && this.viewer.getChecked(fieldElement);
+                allUnchecked = allUnchecked && !this.viewer.getChecked(fieldElement);
+            }
+            if (allUnchecked) {
+                this.viewer.setChecked(treeElement, false);
+                this.viewer.setGrayed(treeElement, false);
+            } else if (allChecked) {
+                this.viewer.setChecked(treeElement, true);
+                this.viewer.setGrayed(treeElement, false);
+            } else if (!allUnchecked && !allChecked) {
+                this.viewer.setChecked(treeElement, true);
+                this.viewer.setGrayed(treeElement, true);
+            }
+        }
+        checkParents(path.getParentPath());
+    }
+
+    /**
+     *
+     * @param path
+     * @param checked
+     */
+    private void checkChildren(final TreePath path, final boolean checked) {
+        TermContentProvider tcp = new TermContentProvider();
+
+        if (path == null) {
+            return;
+        }
+        final Object element = path.getLastSegment();
+        if (element != null) {
+            this.viewer.setChecked(element, checked);
+            this.viewer.setGrayed(element, false);
+            int length = tcp.getChildren(element).length;
+            if(length>1){
+                this.viewer.setSubtreeChecked(element, checked);
+            }
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java
new file mode 100644 (file)
index 0000000..19408b3
--- /dev/null
@@ -0,0 +1,130 @@
+// $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.preference.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.UUID;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.wizard.Wizard;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author alex
+ * @date 21.07.2014
+ *
+ */
+public class AvailableDistributionWizard extends Wizard implements IConversationEnabled {
+
+    private ConversationHolder conversation;
+    private final AvailableDistributionPage aPage;
+
+    public AvailableDistributionWizard() {
+        setWindowTitle("Distribution Selection Wizard");
+        // TODO if preferenceStore has elements checked load elements in wizard
+        aPage = new AvailableDistributionPage("AvailableDistributionPage");
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.jface.wizard.Wizard#performFinish()
+     */
+    @Override
+    public boolean performFinish() {
+        // TODO: get Selection and save in EditorPreferences
+        if (!checkNoneChecked()) {
+            Object[] checkedElements = aPage.getViewer().getCheckedElements();
+            Object[] grayedElements = aPage.getViewer().getGrayedElements();
+            ArrayList checkedList = new ArrayList(Arrays.asList(checkedElements));
+            ArrayList grayedList = new ArrayList(Arrays.asList(grayedElements));
+            checkedList = (ArrayList) CollectionUtils.subtract(checkedList, grayedList);
+            ArrayList<UUID> listUIIDChecked = new ArrayList<UUID>();
+            ArrayList<UUID> listUIIDGrayed = new ArrayList<UUID>();
+            for (Object o : checkedList) {
+                if (o instanceof NamedArea) {
+                    NamedArea na = (NamedArea) o;
+                    listUIIDChecked.add(na.getUuid());
+
+                }else if(o instanceof OrderedTermVocabulary){
+                    OrderedTermVocabulary otb = (OrderedTermVocabulary) o;
+                    listUIIDGrayed.add(otb.getUuid());
+                }
+            }
+            for (Object o : grayedList) {
+                if(o instanceof DefinedTermBase){
+                    DefinedTermBase dt = (DefinedTermBase) o;
+                    listUIIDGrayed.add(dt.getUuid());
+                }else if(o instanceof OrderedTermVocabulary){
+                    OrderedTermVocabulary otb = (OrderedTermVocabulary) o;
+                    listUIIDGrayed.add(otb.getUuid());
+                }
+
+            }
+
+            String saveCheckedElements = StringUtils.join(listUIIDChecked, ",");
+            String saveGrayedElements = StringUtils.join(listUIIDGrayed, ",");
+            IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+            preferenceStore.setValue(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS, saveCheckedElements);
+            preferenceStore.setValue(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED, saveGrayedElements);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public void addPages() {
+        addPage(aPage);
+    }
+
+    private boolean checkNoneChecked() {
+
+        if (aPage.getViewer().getCheckedElements().length == 0) {
+            aPage.setMessage("Please check at least one item", aPage.WARNING);
+            return true;
+        } else {
+            aPage.setMessage(null);
+            return false;
+        }
+    }
+
+    @Override
+    public ConversationHolder getConversationHolder() {
+        if (conversation == null) {
+            conversation = CdmStore.createConversation();
+        }
+        return conversation;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
+     * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+     */
+    @Override
+    public void update(CdmDataChangeMap changeEvents) {
+        // TODO Auto-generated method stub
+
+    }
+}
index aef968d20521226352de5578e279d222f6891f46..403f3b4b9eef57dacaba33924053a30e8e03d649 100644 (file)
@@ -18,8 +18,8 @@ import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.Representation;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.TermStore;
 
 /**
@@ -125,9 +125,9 @@ public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard impl
                                
                                term.addRepresentation(Representation.NewInstance("", "", "", CdmStore.getDefaultLanguage()));
                        } catch (InstantiationException e) {
-                               StoreUtil.error(this.getClass(), "InstantiationException when setting term", e);
+                               MessagingUtils.error(this.getClass(), "InstantiationException when setting term", e);
                        } catch (IllegalAccessException e) {
-                               StoreUtil.error(this.getClass(), "IllegalAccessException when setting term", e);
+                               MessagingUtils.error(this.getClass(), "IllegalAccessException when setting term", e);
                        }
                }
                return term;
index 7d18e0d3aba1178eb47165eeb0fbc4639d7f09cb..00a999bd835a197d2a17f7243d8f25cea94fedcd 100644 (file)
@@ -44,6 +44,7 @@ import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.io.ExportManager;
 import eu.etaxonomy.taxeditor.io.ImportManager;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
@@ -101,7 +102,7 @@ public class CdmStore {
                        return instance;
                } else if (instance == null || !instance.isConnected) {
 
-                       AbstractUtility
+                       MessagingUtils
                                        .warningDialog(
                                                        "Application is not connected to a datastore",
                                                        instance,
@@ -125,7 +126,7 @@ public class CdmStore {
                        cdmSource = CdmDataSourceRepository.getCurrentCdmSource();
                        connect(cdmSource);
                } catch (CdmRemoteSourceException e) {
-                       StoreUtil.errorDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
+                       MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
                }
 
                
@@ -152,7 +153,7 @@ public class CdmStore {
        private static void connect(final ICdmSource cdmSource,
                        final DbSchemaValidation dbSchemaValidation,
                        final Resource applicationContextBean) {
-               StoreUtil.info("Connecting to datasource: " + cdmSource);
+               MessagingUtils.info("Connecting to datasource: " + cdmSource);
 
                job = new CdmStoreConnector(Display.getDefault(), cdmSource,
                                dbSchemaValidation, applicationContextBean);
@@ -216,7 +217,7 @@ public class CdmStore {
                try {
                        return applicationConfiguration;
                } catch (Exception e) {
-                       StoreUtil.error(CdmStore.class, e);
+                       MessagingUtils.error(CdmStore.class, e);
                }
                return null;
        }
@@ -254,7 +255,7 @@ public class CdmStore {
                try{
                        conversation.startTransaction();
                }catch(Exception e){
-                       StoreUtil.errorDialog("No database connection", CdmStore.class, "No database connection available", e);
+                       MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
                }
                return conversation;
        }
@@ -283,11 +284,11 @@ public class CdmStore {
                                        service = (T) method.invoke(configuration, null);
                                        break;
                                } catch (IllegalArgumentException e) {
-                                       StoreUtil.error(CdmStore.class, e);
+                                       MessagingUtils.error(CdmStore.class, e);
                                } catch (IllegalAccessException e) {
-                                       StoreUtil.error(CdmStore.class, e);
+                                       MessagingUtils.error(CdmStore.class, e);
                                } catch (InvocationTargetException e) {
-                                       StoreUtil.error(CdmStore.class, e);
+                                       MessagingUtils.error(CdmStore.class, e);
                                }
                        }
                }
index 52ce1b559fc3e856c83ce17f5d9f7cb61c4b61c8..5387e723c860576136694cb0102361381a4a9044 100644 (file)
@@ -34,6 +34,7 @@ import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.dialog.LoginDialog;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
 
@@ -128,7 +129,7 @@ class CdmStoreConnector extends Job {
                                }
                        });
 
-                       StoreUtil.info("Application context initialized.");
+                       MessagingUtils.info("Application context initialized.");
                        return Status.OK_STATUS;
                } else {
                        // Show datasource view if not shown yet
@@ -201,8 +202,8 @@ class CdmStoreConnector extends Job {
 
                if (!result) {
                        // Show an error message
-                       StoreUtil
-                                       .errorDialog(
+                       MessagingUtils
+                                       .messageDialog(
                                                        "DatabaseCompatibilityCheck failed",
                                                        this,
                                                        "The database schema for the chosen "
@@ -246,7 +247,7 @@ class CdmStoreConnector extends Job {
                        cdmSource.checkConnection();
                        monitor.worked(1);
                } catch (CdmSourceException e) {
-                       StoreUtil.errorDialog("Could not connect to chosen datasource",
+                       MessagingUtils.messageDialog("Could not connect to chosen datasource",
                                        this, "Reason: " + e.getMessage(), e);
                        monitor.setCanceled(true);
                } 
index 57cab784d77392bfb4a9e8700a791d309595179c..d7ca5a0d06d1916e81d7a0eaa801f7ea9874e362 100644 (file)
@@ -27,6 +27,7 @@ import org.eclipse.ui.XMLMemento;
 
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MementoHelper;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
@@ -71,7 +72,7 @@ public class ContextManager implements IWorkbenchListener{
         * <p>notifyContextStart</p>
         */
        public void notifyContextStart() {
-               StoreUtil.info("Notifying context listeners, that the context has started.");
+               MessagingUtils.info("Notifying context listeners, that the context has started.");
                ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
                
                try {
@@ -95,9 +96,9 @@ public class ContextManager implements IWorkbenchListener{
                                }
                        });
                } catch (InvocationTargetException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (InterruptedException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
        }
        
@@ -106,7 +107,7 @@ public class ContextManager implements IWorkbenchListener{
         * 
         */
        public void notifyContextRefresh() {
-               StoreUtil.info("Notifying context listeners, that the context needs to be refreshed.");
+               MessagingUtils.info("Notifying context listeners, that the context needs to be refreshed.");
                ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
                
                try {
@@ -127,9 +128,9 @@ public class ContextManager implements IWorkbenchListener{
                                }
                        });
                } catch (InvocationTargetException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (InterruptedException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
        }
        
@@ -164,7 +165,7 @@ public class ContextManager implements IWorkbenchListener{
                IProgressMonitor subMonitor = StoreUtil.getSubProgressMonitor(monitor, 1);
 
                subMonitor.beginTask("Stoping context", contextListeners.size());
-               StoreUtil.info("Notifying context listeners, that the context has stopped.");
+               MessagingUtils.info("Notifying context listeners, that the context has stopped.");
                                
                for(Object listener : contextListeners.getListeners()){
                        ((IContextListener) listener).contextStop(memento, subMonitor);
@@ -212,7 +213,7 @@ public class ContextManager implements IWorkbenchListener{
                        memento = MementoHelper.readMementoFromFile(getStateFileForCurrentDatabase());
                } catch (FileNotFoundException e) {
                        // no memento -> no previous state
-                       StoreUtil.info("No state file for datasource");
+                       MessagingUtils.info("No state file for datasource");
                }
        }
        
@@ -226,13 +227,13 @@ public class ContextManager implements IWorkbenchListener{
                                name = name.replace(" ", "_");
                                memento = XMLMemento.createWriteRoot(name);
                        
-                               StoreUtil.info("DataSource found. Memento created.");
+                               MessagingUtils.info("DataSource found. Memento created.");
                        } catch (Exception e) {
                                // The memento could not be created, but a not closable editor is avoided for this case.
-                               StoreUtil.error(this.getClass(), "The memento could not be created", e);
+                               MessagingUtils.error(this.getClass(), "The memento could not be created", e);
                        }
                } else {
-                       StoreUtil.info("Not storing state data, because no DataSource present.");
+                       MessagingUtils.info("Not storing state data, because no DataSource present.");
                }
                
        }
index bd2b3a57272f6251f8b39ebad7e4dfa431598294..9a1c11905aaa6d72549e058a9100d8aafbb23a30 100644 (file)
@@ -10,6 +10,7 @@ import java.util.UUID;
 import org.eclipse.ui.IEditorInput;
 
 import eu.etaxonomy.taxeditor.model.ICdmEditorHandle;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * 
@@ -25,7 +26,7 @@ public class EditorManager {
                ICdmEditorHandle editor = editors.get(inputType);
                
                if(editor == null){
-                       StoreUtil.warningDialog("No editor", getClass(), "No editor was registered for the given type.");
+                       MessagingUtils.warningDialog("No editor", getClass(), "No editor was registered for the given type.");
                }else{
                        editor.open(uuid);
                }
index 7a5ada8dd0d748efaa6589d35b099f022e0ed544..b01cd9a978f456ed467e020e79a3a4f890d9391e 100644 (file)
@@ -30,6 +30,7 @@ import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>LoginManager class.</p>
@@ -96,13 +97,13 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
                        return true;
                }
                catch(BadCredentialsException e){
-                       AbstractUtility.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Bad Credentials.");
+                       MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Bad Credentials.");
                }
                catch(LockedException e){
-                       AbstractUtility.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Account is locked.");
+                       MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Account is locked.");
                }
                catch(IllegalArgumentException e){
-                       AbstractUtility.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Username and/or Password empty.");
+                       MessagingUtils.warningDialog("Could not authenticate", this, "Could not authenticate. Reason: Username and/or Password empty.");
                }
                return false;
        }
index f60a736912f6955130677b0aa64aa19ccfdff8ad..363629cc281822a8bd272174320d508b49d3b8ac 100644 (file)
@@ -53,6 +53,12 @@ public class EnumComboElement<T extends IEnumTerm<T>> extends
                AbstractCdmFormElement implements SelectionListener,
                IEnableableFormElement, ISelectable {
 
+       //TODO RL
+       public void setVisible(boolean b){
+               combo.setVisible(b);
+       }
+
+       
        private static CdmEnumDataHolder[] cdmEnumDataHolders = {
                new CdmEnumDataHolder<NomenclaturalCode>(){
 
index 42ead4bfcd703b90b12f6cc80127fa0319c48657..38f1fea81b332f054d072085ff5ca243c296bffd 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.model.common.DefinedTerm;
 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;
@@ -203,12 +204,12 @@ public class TermComboElement<T extends DefinedTermBase>
                        if (label == null) {
                                if (term.getTitleCache() != null) {
                                        label = term.getTitleCache();
-                                       StoreUtil.warn(getClass(),
+                                       MessagingUtils.warn(getClass(),
                                                        "Term does not have a default language representation: " + label
                                                                        + ", " + term.getUuid());
                                } else {
                                        label = "Unknown";
-                                       StoreUtil.warn(getClass(),
+                                       MessagingUtils.warn(getClass(),
                                                        "Representation Label and TitleCache empty for term: "
                                                                        + term + ", " + term.getUuid());
                                }
index 1151df8f22bd9e7b6c5ee7f85cca145f79ad8ccd..d1e432f79c014bbf44ad2fba17b4d97a6e599d91 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>UriDialog class.</p>
@@ -66,7 +66,7 @@ public class UriDialog extends InputDialog {
                try {
                        uri = new URI(getValue());
                } catch (URISyntaxException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                return uri;
        }
index 641193b67e6d753a4349d521988800af403b38a8..e02afa3c96e4811d1bae827d06df3239b7f4da3b 100644 (file)
@@ -33,8 +33,8 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.IEnumTerm;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
@@ -215,13 +215,13 @@ public abstract class AbstractFilteredCdmEnumSelectionDialog<T extends IEnumTerm
                        lastCompletedFilter.setAccessible(true);
                        lastCompletedFilter.set(this, null);
                } catch (SecurityException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (NoSuchFieldException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (IllegalArgumentException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (IllegalAccessException e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                
                // this also is not the nicest way to do it. 
@@ -250,7 +250,7 @@ public abstract class AbstractFilteredCdmEnumSelectionDialog<T extends IEnumTerm
                                        progressMonitor.worked(1);
                                }
                        }else{
-                               StoreUtil.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
+                               MessagingUtils.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
                        }
                }
                finally {
index 5e3e5c1ee568b3aeaefd8a49d7297ba95a520e62..dcb689d0ef5de5a1a93250d8aaeea96d768468f9 100644 (file)
@@ -47,7 +47,7 @@ import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
@@ -281,13 +281,13 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                        lastCompletedFilter.setAccessible(true);
                        lastCompletedFilter.set(this, null);
                } catch (SecurityException e) {
-                       AbstractUtility.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (NoSuchFieldException e) {
-                       AbstractUtility.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (IllegalArgumentException e) {
-                       AbstractUtility.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                } catch (IllegalAccessException e) {
-                       AbstractUtility.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
                
                // this also is not the nicest way to do it. 
@@ -316,7 +316,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                                        progressMonitor.worked(1);
                                }
                        }else{
-                               AbstractUtility.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
+                               MessagingUtils.warn(getClass(), "Model for Filtered Selection is null:" + this.getClass().getSimpleName());
                        }
                }
                finally {
index a1b4c475f9bd26b51daa547bd4c88f82e46ede88..4cb133747fb395debbe515fab9e08c29fb062ff8 100644 (file)
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewAmplificationWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -54,7 +54,7 @@ AbstractFilteredCdmResourceSelectionDialog<Amplification> {
         if(amplification != null){
             return amplification;
         }
-        AbstractUtility.error(this.getClass(), "Selected unit is not an amplification", null);
+        MessagingUtils.error(this.getClass(), "Selected unit is not an amplification", null);
         return null;
     }
 
index 5c564893923e352b0c5122b7be534af6eddd26d5..2fb6c0bedf71c7de50130ca86ca6ff018fe85b81 100644 (file)
@@ -19,10 +19,10 @@ import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>FilteredDerivedUnitSelectionDialog class.</p>
@@ -73,7 +73,7 @@ public class DerivedUnitSelectionDialog extends
                if(specimenObservationBase instanceof DerivedUnit){
                        return (DerivedUnit) specimenObservationBase;
                }
-               StoreUtil.error(this.getClass(), "Selected unit is not a derived unit", null);
+               MessagingUtils.error(this.getClass(), "Selected unit is not a derived unit", null);
                return null;
        }
 
index 49acf9441303461c827d54d6d515569ac599bd77..22e528cb3a162e7989665cf85247b937fb205729 100644 (file)
@@ -19,10 +19,10 @@ import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewFieldUnitWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>FilteredFieldUnitSelectionDialog class.</p>
@@ -77,7 +77,7 @@ public class FieldUnitSelectionDialog extends
                if(specimenObservationBase instanceof FieldUnit){
                        return (FieldUnit) specimenObservationBase;
                }
-               StoreUtil.error(this.getClass(), "Selected object is not a field unit", null);
+               MessagingUtils.error(this.getClass(), "Selected object is not a field unit", null);
                return null;
        }
 
index 21474e44b6af74664476d7c480df3671f35bf52d..4ad99c9ff72fa6ab94b53cfe3a53fbb22a0e3a6f 100644 (file)
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.molecular.Primer;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewPrimerWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -54,7 +54,7 @@ AbstractFilteredCdmResourceSelectionDialog<Primer> {
         if(primer != null){
             return primer;
         }
-        AbstractUtility.error(this.getClass(), "Selected unit is not a primer", null);
+        MessagingUtils.error(this.getClass(), "Selected unit is not a primer", null);
         return null;
     }
 
index 5f09c9b96fe2b78c1c5e1f49d3b4302016b87fbb..d33745d887e2b769d06aac3e4fa961a785008fac 100644 (file)
@@ -37,7 +37,7 @@ 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.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * @author n.hoffmann
@@ -85,7 +85,7 @@ public class SelectionDialogFactory {
                        return (T) PolytomousKeySelectionDialog.select(shell, conversation, (PolytomousKey) curentSelection);
                }
                if(clazz.equals(PolytomousKeyNode.class)){
-                       StoreUtil.warningDialog("Not implemented yet", SelectionDialogFactory.class,
+                       MessagingUtils.warningDialog("Not implemented yet", SelectionDialogFactory.class,
                                        "This functionality is not implemented yet.");
                        return null;
                }
index 35bc76c7cc6407287414bbe985f140a1f16731f4..586950edf7006bb14fbff1a9b11f8c043587997b 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.widgets.Section;
 
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>Abstract AbstractCdmFormElement class.</p>
@@ -245,7 +246,7 @@ public abstract class AbstractCdmFormElement implements ICdmFormElement {
                        // Described here: http://dev.e-taxonomy.eu/trac/ticket/2363#comment:2
                        // and here: http://dev.e-taxonomy.eu/trac/ticket/2438
                        // Ignoring the CME because nothing bad is happening
-                       AbstractUtility.warn(getClass(), "ConcurrentModificationException. Can be ignored.");
+                       MessagingUtils.warn(getClass(), "ConcurrentModificationException. Can be ignored.");
                }
        }
 
index fd2b43189425a7116f5244e556056795bf02f4eb..6afa2b7bff3931051f4dad493bc4a9231b920c7a 100644 (file)
@@ -34,6 +34,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>
@@ -216,7 +217,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements ISe
                 ((IPropertyChangeListener) listener).propertyChange(event);
             }
         } catch (ConcurrentModificationException e) {
-            AbstractUtility.warn(getClass(), "ConcurrentModificationException while handling PropertyChangeEvents."
+            MessagingUtils.warn(getClass(), "ConcurrentModificationException while handling PropertyChangeEvents."
                     + " It seems like this is not critical");
         }
        }
@@ -573,7 +574,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements ISe
                }else if(getParentElement() instanceof IConversationEnabled){
                        return ((IConversationEnabled) getParentElement()).getConversationHolder();
                }
-               AbstractUtility.errorDialog("Could not get conversation for AbstractFormSection",
+               MessagingUtils.messageDialog("Could not get conversation for AbstractFormSection",
                                getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't",
                                new IllegalArgumentException());
                return null;
index 7c69824f8dd49102e463b1fefbb0169d2ef9b533..123f5f564a0822e5305b57a4c0fbc2e31b1fecd2 100644 (file)
@@ -96,7 +96,7 @@ import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+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.element.MinMaxTextSection.UnitType;
@@ -442,7 +442,7 @@ public class CdmFormFactory extends FormToolkit {
         if (selectionProvider != null) {
             selectionProvider.removeSelectionChangedListener(selectionArbitrator);
         } else {
-            AbstractUtility.error(this.getClass(),
+            MessagingUtils.error(this.getClass(),
                     "Tried to destroy a selection listener from this factories listeners but was null", null);
         }
     }
@@ -1337,7 +1337,7 @@ public class CdmFormFactory extends FormToolkit {
      */
     public void removeSelectionListener(SelectionListener listener) {
         if (listener == null) {
-            AbstractUtility.error(this.getClass(),
+            MessagingUtils.error(this.getClass(),
                     "Tried to remove a selection listener from this factories listeners but was null", null);
         } else {
             selectionListenerList.remove(listener);
@@ -2585,13 +2585,15 @@ public class CdmFormFactory extends FormToolkit {
         }
 
         if (element == null) {
-            AbstractUtility.errorDialog("No element for entity", this,
+            MessagingUtils.messageDialog("No element for entity", this,
                     "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
                             + entity, null);
         }
 
-        else if (backgroundColor != null && !backgroundColor.isDisposed()) {
-            element.setPersistentBackground(backgroundColor);
+        else{
+            if (backgroundColor != null && !backgroundColor.isDisposed()) {
+                element.setPersistentBackground(backgroundColor);
+            }
             adapt(element);
             parentElement.addElement(element);
         }
index 92944ecead1facc71c809249b2e2664c1783b9af..090413bb9fe20aea585212bfe59d5cfc7b5bce54 100644 (file)
@@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
 import eu.etaxonomy.cdm.common.UriUtils;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>ImageElement class.</p>
@@ -104,7 +104,7 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                        try {
                                                runnable.run(monitor);
                                        } catch (Exception e) {
-                                               StoreUtil.errorDialog("Could not load image", getClass(), e.getMessage()  + ": " +  getImageUri(), e);
+                                               MessagingUtils.messageDialog("Could not load image", getClass(), e.getMessage()  + ": " +  getImageUri(), e);
                                        }
                                        
                                        return Status.OK_STATUS;
@@ -125,7 +125,7 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                try {
                                        runnable.run(monitor);
                                } catch (Exception e) {
-                                       StoreUtil.errorDialog("Could not unload image", getClass(), e.getMessage()  + ": " +  getImageUri(), e);
+                                       MessagingUtils.messageDialog("Could not unload image", getClass(), e.getMessage()  + ": " +  getImageUri(), e);
                                }
                                
                                return Status.OK_STATUS;
index d315fccf9419887f452f2f0451b03afb7ebdb1c8..ad379c37098de347e440b7f640c389d7b8621129 100644 (file)
@@ -30,9 +30,9 @@ import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.common.MultilanguageTextHelper;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.translation.TranslationWizard;
 
@@ -66,7 +66,7 @@ public class MultilanguageTextElement extends AbstractCdmFormElement implements
                        Map<Language, LanguageString> multilanguageText = getMultilanguageText();
 
                        if (multilanguageText == null){
-                               StoreUtil.warningDialog("No text to transalte", getClass(), "The text is empty and therefore can not be translated");
+                               MessagingUtils.warningDialog("No text to transalte", getClass(), "The text is empty and therefore can not be translated");
                        }
 
                        TranslationWizard wizard = new TranslationWizard(multilanguageText);
index 3c2c784ee1d19becd11dd9717bc0b453766d26ba..a91de774cff454e4ffd5473088624bfb113eb12c 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Widget;
 
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 
 /**
@@ -142,7 +142,7 @@ public class SelectionArbitrator implements SelectionListener, ISelectionChanged
                try{
                entityElement.setSelected(false);
                }catch(SWTException e){
-                       StoreUtil.error(getClass(), "Widgets of element are disposed", e);
+                       MessagingUtils.error(getClass(), "Widgets of element are disposed", e);
                }
                ISelection selection = event.getSelection();            
                if(selection != null && selection instanceof StructuredSelection){
index 0d1c7be8c4ebed2a77a28a05777485ab7e9a7924..3581a3d1c080d099c8aaecf5a96cc2b12611829e 100644 (file)
@@ -41,12 +41,20 @@ public class ToggleableTextElement extends AbstractCdmFormElement implements Sel
 
        private final Text text_cache;
        private final Button button_toggle;
-
        private boolean state;
        private final Set<SelectionListener> selectionListener = new HashSet<SelectionListener>();
        private final Label label;
        private final Composite container;
 
+       //TODO for RL
+       public void setVisible(boolean b) {
+               text_cache.setVisible(b);
+               button_toggle.setVisible(b);
+               label.setVisible(b);
+               container.setVisible(b);
+       }       
+       
+       
        /**
         * <p>Constructor for ToggleableTextElement.</p>
         *
index 331b13f348022eeac727bdca9deeec0d7f39f7ea..ff2eda0bdb670382201ce8c84763203f116f38c8 100644 (file)
@@ -30,7 +30,7 @@ import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 
 
@@ -146,13 +146,13 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
                        // create a granted authrity from a cdm authority 
                        gai = cdma.asNewGrantedAuthority();
                } catch (Exception e) {                 
-                       StoreUtil.warningDialog("Parsing Error", this, "Could not parse authority string");
+                       MessagingUtils.warningDialog("Parsing Error", this, "Could not parse authority string");
                        return;
                }
                //FIXME : this contains call will allow users to add authorities which differ only in CRUD operation choice.
                //        need to have a comparator which only checks permission class and uuid
                if(cdmAuthorities.contains(gai) || newCdmAuthorities.contains(gai)) {
-                       StoreUtil.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
+                       MessagingUtils.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
                } else {                                                                
                        group.addGrantedAuthority(gai);
                        newCdmAuthorities.add(gai);
index 9553a371987a93b830a462569334993ae54067a7..dfdecf40e829bf57a05cfb7bdd52a419e25aee60 100644 (file)
@@ -26,7 +26,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 import eu.etaxonomy.cdm.ext.openurl.OpenUrlReference;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.ImageElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
@@ -124,7 +124,7 @@ public class OpenUrlReferencePage extends WizardPage implements SelectionListene
                
                        getWizard().getContainer().run(true, false, runnable);
                } catch (Exception e) {
-                       StoreUtil.errorDialog("Could not load image", getClass(), e.getMessage()  + ": " + imageUri , e);
+                       MessagingUtils.messageDialog("Could not load image", getClass(), e.getMessage()  + ": " + imageUri , e);
                }
        }
 
@@ -161,7 +161,7 @@ public class OpenUrlReferencePage extends WizardPage implements SelectionListene
                } catch (IllegalArgumentException e) {
                        setErrorMessage(String.format("Could not page: %s", e.getLocalizedMessage()));
                } catch (Exception e) {
-                       StoreUtil.error(getClass(), e);
+                       MessagingUtils.error(getClass(), e);
                }
        }
        
index c508919a6e1c2b12486f70706dca101a986644db..62746ec3a4b8665a6d9af827c7e77bd339c04633 100644 (file)
@@ -19,7 +19,7 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Label;
 
 import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -68,7 +68,7 @@ public class OpenUrlSelectorElement extends AbstractCdmFormElement implements Se
        @Override
        public void widgetSelected(SelectionEvent e) {
                if(openUrlEnabled.getReference() == null){
-                       StoreUtil.warningDialog("No reference", getClass(), "The given reference is empty");
+                       MessagingUtils.warningDialog("No reference", getClass(), "The given reference is empty");
                        return;
                }
                
index 63145b223c6b6c754c58ca9561c9e8d7847750b3..85df5d02ef7c05b7b6888661e6e1a4229683dbae 100644 (file)
@@ -19,8 +19,11 @@ import org.eclipse.swt.widgets.Label;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -66,10 +69,13 @@ public class EditPasswordElement extends AbstractCdmFormElement implements Selec
         */
        @Override
        public void widgetSelected(SelectionEvent e) {
-               PasswordWizard wizard = new PasswordWizard(user, conversation);
-               WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
-               
-               dialog.open();
+               if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
+                       MessagingUtils.warningDialog("Username does not exist", this, "Please create or save user '" + user.getUsername() + "' before changing password");
+               } else {
+                       PasswordWizard wizard = new PasswordWizard(user, conversation);
+                       WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);                
+                       dialog.open();
+               }
        }
 
        /* (non-Javadoc)
index 8240bfe5279b9e27e47bb0e4033e0c1a2a95937f..0ab1de2142a43c7884e9058a9116b6b3a3fc10dd 100644 (file)
@@ -18,8 +18,8 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 
 /**
@@ -76,7 +76,7 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                    internalConversation.close();
                        return true;
                }catch(Exception e){
-                       StoreUtil.errorDialog("Error while changing password", getClass(), "There was a problem changing the password.", e);
+                       MessagingUtils.messageDialog("Error while changing password", getClass(), "There was a problem changing the password.", e);
                        return false;
                }finally{
                    if(conversation != null){
index 32f05c608a9814f2a36d8d3e4183d694510647ee..7d861c220ab4a531f3777a48184ccffc4005ce5d 100644 (file)
@@ -28,7 +28,7 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.LoginManager;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -306,7 +306,7 @@ public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement
         */
        public void handleException(CdmPropertyChangeEvent event) {
                // override this in subclasses if you want to deal with the error
-               AbstractUtility.error(event.getSource().getClass(), event.getException());
+               MessagingUtils.error(event.getSource().getClass(), event.getException());
        }
 
        /**
index 578d220b26eb28124b25f57d5de3464f09d6daec..47d373fe754bbcf71ec46dba13ab6c82ae6a7fbc 100644 (file)
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+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.section.AbstractCdmDetailElement;
@@ -63,7 +63,7 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
         */
        @Override
        protected AbstractCdmDetailElement<TeamOrPersonBase> createCdmDetailElement(AbstractCdmDetailSection<TeamOrPersonBase> parentElement, int style) {
-           AbstractUtility.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
+           MessagingUtils.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
            //TODO DetailElement missing??
            return null;
        }
index 2fe95883904f4c6b43a56b3bf15e2627354f3666..c1fa5a60bfc87b23a067be7876b583f893d75d76 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.Control;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -70,7 +71,7 @@ public class DescriptionElementDetailSection extends
                         */
                        @Override
                        public void run() {
-                               boolean confirmed = StoreUtil.confirmDialog("Confirmation", "Do you really want to change to "
+                               boolean confirmed = MessagingUtils.confirmDialog("Confirmation", "Do you really want to change to "
                                                + destinationString + "? Current data will be lost.");
                                if (confirmed) {
                                        // FIXME
index 04a0171b1b7d09d74d1626003dbcb9aff67498a5..d149d0488011f4083b5f38e5f01b1cbf4d8db85b 100644 (file)
@@ -11,7 +11,7 @@
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -71,8 +71,7 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
                if(element_media != null){
                        this.removeElements();
                }
-               element_media = (MediaElement) formFactory.createEntityCollectionElement(this, entity, null, null, Section.EXPANDED);
-               formFactory.addPropertyChangeListener(element_media);
+               element_media = (MediaElement) formFactory.createEntityCollectionElement(this, entity, null, null, ExpandableComposite.EXPANDED);
                super.setEntity(entity);
                setSectionTitle();
                layout();
index 299bd27b45e895d7b76e029325358d71d8b6c07b..767afd8c71329d5104b8e267746e5c689913ab01 100644 (file)
@@ -3,6 +3,11 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.media;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Set;
+
 import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
@@ -10,12 +15,15 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 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.LanguageStringWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
@@ -31,93 +39,134 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  */
 public class MediaElement extends AbstractEntityCollectionElement<Media> {
 
-       private MediaRepresentationSection section_mediaRepresentation;
-       private EntitySelectionElement<AgentBase> selection_artist;
-       private LanguageStringWithLabelElement text_description;
-       private LanguageStringWithLabelElement text_title;
+//    private MediaRepresentationSection section_mediaRepresentation;
+    private EntitySelectionElement<AgentBase> selection_artist;
+    private LanguageStringWithLabelElement text_description;
+    private LanguageStringWithLabelElement text_title;
+    private UriWithLabelElement textUri;
 
-       /**
-        * <p>
-        * Constructor for MediaElement.
-        * </p>
-        *
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param element
-        *            a {@link eu.etaxonomy.cdm.model.media.Media} object.
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        * @param cdmFormFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        */
-       public MediaElement(CdmFormFactory cdmFormFactory,
-                       AbstractFormSection formElement, Media element,
-                       SelectionListener removeListener, int style) {
-               super(cdmFormFactory, formElement, element, removeListener, null, style);
-       }
+    /**
+     * <p>
+     * Constructor for MediaElement.
+     * </p>
+     *
+     * @param formElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+     *            object.
+     * @param element
+     *            a {@link eu.etaxonomy.cdm.model.media.Media} object.
+     * @param removeListener
+     *            a {@link org.eclipse.swt.events.SelectionListener} object.
+     * @param style
+     *            a int.
+     * @param cdmFormFactory
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+     *            object.
+     */
+    public MediaElement(CdmFormFactory cdmFormFactory,
+            AbstractFormSection formElement, Media element,
+            SelectionListener removeListener, int style) {
+        super(cdmFormFactory, formElement, element, removeListener, null, style);
+    }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite
-        * #createControls(org.eclipse.swt.widgets.Composite, int)
-        */
-       /** {@inheritDoc} */
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite
+     * #createControls(org.eclipse.swt.widgets.Composite, int)
+     */
+    /** {@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, style);
-        section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), element, style);
-        section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-       }
+        textUri = formFactory.createUriWithLabelElement(element, "Media URI", null, style);
+        //        section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), element, style);
+        //        section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+    }
+
+    private MediaRepresentationPart getFirstMediaRepresentationPart() {
+        Set<MediaRepresentation> representations = entity.getRepresentations();
+        if(representations.size()==1){
+            List<MediaRepresentationPart> parts = representations.iterator().next().getParts();
+            if(parts.size()==1){
+                return parts.iterator().next();
+            }
+        }
+        return null;
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public void setEntity(Media element) {
-               this.entity = element;
-               section_mediaRepresentation.setEntity(element);
-               selection_artist.setEntity((TeamOrPersonBase) HibernateProxyHelper
-                               .deproxy(element.getArtist()));
+    /** {@inheritDoc} */
+    @Override
+    public void setEntity(Media element) {
+        this.entity = element;
+//        section_mediaRepresentation.setEntity(element);
+        selection_artist.setEntity((TeamOrPersonBase) HibernateProxyHelper
+                .deproxy(element.getArtist()));
 
-               text_description.setLanguageString(element.getDescription(CdmStore
-                               .getDefaultLanguage()));
+        text_description.setLanguageString(element.getDescription(CdmStore
+                .getDefaultLanguage()));
 
-               LanguageString title = element.getTitle(CdmStore.getDefaultLanguage());
+        LanguageString title = element.getTitle(CdmStore.getDefaultLanguage());
 
-               if (title == null) {
-                       title = LanguageString.NewInstance("",
-                                       CdmStore.getDefaultLanguage());
-               }
+        if (title == null) {
+            title = LanguageString.NewInstance("",
+                    CdmStore.getDefaultLanguage());
+        }
 
-               text_title.setLanguageString(title);
-       }
+        text_title.setLanguageString(title);
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
-        * (java.lang.Object)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void handleEvent(Object eventSource) {
-               if (eventSource == selection_artist) {
-                       getEntity().setArtist(selection_artist.getSelection());
-               } else if (eventSource == text_description) {
-                       getEntity().addDescription(text_description.getLanguageString());
-               } else if (eventSource == text_title) {
-                       getEntity().putTitle(text_title.getLanguageString());
-                       if (getParentElement() instanceof AbstractCdmDetailSection) {
-                               ((AbstractCdmDetailSection) getParentElement()).updateTitle();
-                       }
-               }
-               firePropertyChangeEvent(this);
-       }
+        MediaRepresentationPart firstMediaRepresentationPart = getFirstMediaRepresentationPart();
+        if(firstMediaRepresentationPart!=null){
+            textUri.setUri(firstMediaRepresentationPart.getUri());
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
+     * (java.lang.Object)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void handleEvent(Object eventSource) {
+        if (eventSource == selection_artist) {
+            getEntity().setArtist(selection_artist.getSelection());
+        } else if (eventSource == text_description) {
+            getEntity().addDescription(text_description.getLanguageString());
+        } else if (eventSource == text_title) {
+            getEntity().putTitle(text_title.getLanguageString());
+            if (getParentElement() instanceof AbstractCdmDetailSection) {
+                ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+            }
+        }
+        else if (eventSource == textUri){
+            textUri.setBackground(getPersistentBackground());
+            MediaRepresentationPart firstMediaRepresentationPart = getFirstMediaRepresentationPart();
+            URI uri;
+            try {
+                uri = textUri.getUri();
+                if(firstMediaRepresentationPart!=null){
+                    firstMediaRepresentationPart.setUri(uri);
+                }
+                else{
+                    Set<MediaRepresentation> representations = getEntity().getRepresentations();
+                    if(representations.size()>=1){
+                        representations.iterator().next().addRepresentationPart(MediaRepresentationPart.NewInstance(uri, null));
+                    }
+                    else{
+                        MediaRepresentation mediaRepresentation = MediaRepresentation.NewInstance();
+                        mediaRepresentation.addRepresentationPart(MediaRepresentationPart.NewInstance(uri, null));
+                        getEntity().addRepresentation(mediaRepresentation);
+                    }
+                }
+            } catch (URISyntaxException e) {
+                textUri.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+            }
+        }
+    }
 }
index ae2bbb7ba0a70c702692fe1d528b43f653788c66..0f19002fe4a251f20587af23880f9f45deaff0cd 100644 (file)
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.common.media.ImageInfo;
 import eu.etaxonomy.cdm.model.media.ImageFile;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -120,9 +120,9 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                                text_suffix.setText(imageInfo.getSuffix());
                                getEntity().setSuffix(imageInfo.getSuffix());
                        } catch (IOException e) {
-                               StoreUtil.error(getClass(), e);
+                               MessagingUtils.error(getClass(), e);
                        } catch (HttpException e) {
-                               StoreUtil.error(getClass(), e);
+                               MessagingUtils.error(getClass(), e);
                        }
                }
        }
index 6fc520ea963882ae3f10b200e5e4e4a14a77b411..17d1f305b37dbebd38d43aa7131d7d02844a3e98 100644 (file)
@@ -21,6 +21,8 @@ import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.NomenclaturalAuthorTeamSelectionElement;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * <p>
@@ -66,6 +68,11 @@ public class AuthorshipDetailElement extends
                toggleable_cache = formFactory.createToggleableTextField(this,
                                "Authorship Cache", entity.getAuthorshipCache(),
                                entity.isProtectedAuthorshipCache(), style);
+               
+               //TODO RL
+               if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                       toggleable_cache.setVisible(false);
+               }
                selection_combinationAuthorTeam = formFactory.createNomenclaturalAuthorTeamSelectionElement(
                                getConversationHolder(),
                                formElement, "Author",
index 48c9cdee75aeac79765da4ad2508856446e6a41f..e5e0857823c916ad7703f69d202921fab74e5a06 100644 (file)
@@ -22,6 +22,8 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.ZoologicalName;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
@@ -128,7 +130,11 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                if (code != null){
                        switch(nonViralName.getNomenclaturalCode()){
                        case ICNAFP :
-                               createBotanicalNameParts(formElement, nonViralName, style);
+                               // TODO RL
+                               if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL))
+                               {
+                                       createBotanicalNameParts(formElement, nonViralName, style);
+                               }
                                break;
                        case ICZN:
                                createZoologicalNameParts(formElement, nonViralName, style);
index c0e1988f12835da72320f10db48eeb7127f2869e..67dd4b17d06229ea709bf51397f98e3ef3e2ca54 100644 (file)
@@ -16,7 +16,7 @@ import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -86,7 +86,7 @@ public class NameRelationshipDetailElement extends AbstractReferencedEntityEleme
                        getEntity().setType(combo_relationshipType.getSelection());
                }
                else if(eventSource == selection_toName){
-                       StoreUtil.error(getClass(), "No API call available.", null);
+                       MessagingUtils.error(getClass(), "No API call available.", null);
                }
                else if(eventSource == text_ruleConsidered){
                        getEntity().setRuleConsidered(text_ruleConsidered.getText());
index d4e17a472caef42b9a0a579f8b68cf870202d2fc..d75b3698af4acd72f44598fd999bfee39b63471b 100644 (file)
@@ -16,6 +16,8 @@ import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.cdm.model.name.NonViralName;
+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.ICdmFormElement;
@@ -71,9 +73,15 @@ public class NonViralNameDetailElement extends
 
         toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
 
-        combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
-        combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
+               combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+               combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+               
+        //TODO RL
+               if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               toggleable_cache.setVisible(false);
+               combo_nomenclaturalCode.setVisible(false);
+        }
+        
         section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         addControl(section_name);
@@ -83,10 +91,13 @@ public class NonViralNameDetailElement extends
         addControl(section_author);
         addElement(section_author);
 
-        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
-        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-        addControl(section_hybrid);
-        addElement(section_hybrid);
+        //TODO RL
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+               section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+               addControl(section_hybrid);
+               addElement(section_hybrid);
+        }       
     }
 
        /** {@inheritDoc} */
@@ -106,9 +117,9 @@ public class NonViralNameDetailElement extends
        @Override
        public void setEntity(NonViralName entity) {
                super.setEntity(entity);
-               section_name.setEntity(entity);
-               section_author.setEntity(entity);
-               section_hybrid.setEntity(entity);
+               if (section_name!=null) section_name.setEntity(entity);
+               if (section_author!=null) section_author.setEntity(entity);
+               if (section_hybrid!=null) section_hybrid.setEntity(entity);
        }
 
        /** {@inheritDoc} */
index edc738db706149840c18700531b18c6274270ec7..fbaac5d51eeebc31dc8b8ccd3f26871a93ea1fd5 100644 (file)
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -67,7 +67,7 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                        Action cloneAction = new Action("Clone", IAction.AS_PUSH_BUTTON){
                                @Override
                 public void run() {
-                                       boolean confirm = AbstractUtility.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
+                                       boolean confirm = MessagingUtils.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
 
                                        if(confirm){
                                                NonViralName clonedName;
index ed29e2f45be45f923899faf0cf622916dcf1b44d..a11e8e43bb55e870e4f6de962e502564edeabd07 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@@ -127,7 +127,7 @@ public class ProtologueElement extends AbstractEntityCollectionElement<Descripti
                        try {
                                mediaRepresentationPart.setUri(new URI(protologueUriText.getText()));
                        } catch (URISyntaxException e) {
-                               StoreUtil.warningDialog("Could not parse URI", getClass(), e.getMessage());
+                               MessagingUtils.warningDialog("Could not parse URI", getClass(), e.getMessage());
                        }
                }       
        }
index 59ee52984e066e9b8af48460f83651a7b7878a24..81fcb04fe5ab2084badf7d95c95f6bd26b9460d2 100644 (file)
@@ -14,7 +14,7 @@ import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -86,7 +86,7 @@ public class SynonymRelationshipDetailElement extends AbstractReferencedEntityEl
             getEntity().setType(combo_relationshipType.getSelection());
         }
         else if(eventSource == selection_toName){
-            AbstractUtility.error(getClass(), "No API call available.", null);
+            MessagingUtils.error(getClass(), "No API call available.", null);
         }
         else if(eventSource == checkPartial){
             getEntity().setPartial(checkPartial.getSelection());
index a6720252913c8ccae6e8fcb846ac00290629ecb4..97207a2babd51d458d8e3e61580928f74bcdea31 100644 (file)
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.model.common.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -96,7 +96,7 @@ public class DerivedUnitBaseDetailElement extends
             combo_preservationMethod = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation Method", preservationMethod==null?null:preservationMethod.getDefinedMaterialOrMethod(), style);
                } catch (MethodNotSupportedByDerivedUnitTypeException e) {
                        // we ignore this
-            AbstractUtility.info(e.getMessage());
+            MessagingUtils.info(e.getMessage());
                }
         selection_storedUnder = formFactory.createSelectionElement(TaxonNameBase.class, getConversationHolder(), formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
 
@@ -104,7 +104,7 @@ public class DerivedUnitBaseDetailElement extends
             text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", entity.getExsiccatum(), style);
                } catch (MethodNotSupportedByDerivedUnitTypeException e) {
                        // we ignore this
-            AbstractUtility.info(e.getMessage());
+            MessagingUtils.info(e.getMessage());
                }
 
 //             section_duplicates = (SpecimenCollectionDetailSection) formFactory
@@ -136,8 +136,8 @@ public class DerivedUnitBaseDetailElement extends
                     preservationMethod.setDefinedMaterialOrMethod(combo_preservationMethod.getSelection());
                 }
             } catch (MethodNotSupportedByDerivedUnitTypeException e) {
-                AbstractUtility
-                        .errorDialog(
+                MessagingUtils
+                        .messageDialog(
                                 "MethodNotSupportedByDerivedUnitTypeException",
                                 this,
                                 "MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit",
@@ -149,7 +149,7 @@ public class DerivedUnitBaseDetailElement extends
             try {
                 getEntity().setExsiccatum(text_exsicatum.getText());
             } catch (Exception e) {
-                AbstractUtility.error(this.getClass(), e);
+                MessagingUtils.error(this.getClass(), e);
             }
         }
     }
index 39fb47ea3f37acc65941849b0dec919031b0ac3b..a736d50f871d0b76867fef394d081e3a41cd95ef 100644 (file)
@@ -16,7 +16,7 @@ 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.AbstractUtility;
+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;
@@ -68,7 +68,7 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
                        section_fieldUnit.setEntity(facade);
 
                } catch (DerivedUnitFacadeNotSupportedException e) {
-                       AbstractUtility.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
+                       MessagingUtils.messageDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
                }
        }
 
index 1e18f35405c565111f389f080e7c9c8f2f20aa48..468434a5a3150ebc094973c44224228270a40536 100644 (file)
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -117,7 +117,7 @@ public class PreservedSpecimenDetailElement extends
             try {
                 getEntity().setExsiccatum(text_exsicatum.getText());
             } catch (Exception e) {
-                AbstractUtility.error(this.getClass(), e);
+                MessagingUtils.error(this.getClass(), e);
             }
         }
     }
index a4a5c5521899bd30d25bf4a284e15c428daa319c..b4545e78fa2c73e7cf07acb00a7e40626d9ec2a1 100644 (file)
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TimePeriod;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -78,7 +78,7 @@ public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<D
             }
         } catch (MethodNotSupportedByDerivedUnitTypeException e) {
             // we ignore this
-            AbstractUtility.info(e.getMessage());
+            MessagingUtils.info(e.getMessage());
         }
         comboPreservationMedium = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation medium", preservationMedium, style);
         datePreservation = formFactory.createTimePeriodElement(formElement, "Preservation date", preservationDate, style);
index 0af1cb17f268f035b26ad2917a0adf83ddb7bed8..f272dfe505ce2f5b231a6240685d844455c84e9d 100644 (file)
@@ -9,8 +9,11 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence.media;
 
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Set;
+
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.joda.time.DateTime;
 
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
@@ -22,19 +25,21 @@ import eu.etaxonomy.cdm.model.common.OriginalSourceType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.cdm.model.common.VocabularyEnum;
 import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
 import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.preference.Resources;
 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.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.media.MediaRepresentationSection;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -54,8 +59,10 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
     private EntitySelectionElement<Collection> selection_collection;
     private TextWithLabelElement text_accessionNumber;
     private EntitySelectionElement<Reference> selection_publishedIn;
+    private UriWithLabelElement textMediaUri;
+    private MediaRepresentationPart mediaRepresentationPart;
 
-    private MediaRepresentationSection mediaRepresentationSection;
+//    private MediaRepresentationSection mediaRepresentationSection;
     /**
      * @param formFactory
      * @param formElement
@@ -102,10 +109,12 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
                 }
             }
             selection_publishedIn = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Published in", publishedIn, EntitySelectionElement.ALL, style);
+            mediaRepresentationPart = getMediaRepresentationPart(media);
+            textMediaUri = formFactory.createUriWithLabelElement(formElement, "Media URI", mediaRepresentationPart.getUri(), style);
 
-            mediaRepresentationSection = formFactory.createMediaRepresentationSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
-            mediaRepresentationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-            mediaRepresentationSection.setEntity(media);
+//            mediaRepresentationSection = formFactory.createMediaRepresentationSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+//            mediaRepresentationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+//            mediaRepresentationSection.setEntity(media);
         }
     }
 
@@ -160,5 +169,39 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
                 primaryMediaSource.setCitation(selection_publishedIn.getSelection());
             }
         }
+        else if(eventSource==textMediaUri){
+            textMediaUri.setBackground(getPersistentBackground());
+            try {
+                mediaRepresentationPart.setUri(textMediaUri.getUri());
+            } catch (URISyntaxException e) {
+                textMediaUri.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
+            }
+        }
     }
+
+    private MediaRepresentationPart getMediaRepresentationPart(Media media) {
+        if(mediaRepresentationPart==null){
+            Set<MediaRepresentation> representations = media.getRepresentations();
+            if(representations!=null && representations.size()>0){
+                MediaRepresentation mediaRepresentation = representations.iterator().next();
+                List<MediaRepresentationPart> parts = mediaRepresentation.getParts();
+                if(parts!=null && parts.size()>0){
+                    mediaRepresentationPart = parts.iterator().next();
+                }
+                else{
+                    mediaRepresentationPart = MediaRepresentationPart.NewInstance(null, null);
+                    mediaRepresentation.addRepresentationPart(mediaRepresentationPart);
+                }
+            }
+            else{
+                mediaRepresentationPart = MediaRepresentationPart.NewInstance(null, null);
+
+                MediaRepresentation mediaRepresentation = MediaRepresentation.NewInstance();
+                mediaRepresentation.addRepresentationPart(mediaRepresentationPart);
+                media.addRepresentation(mediaRepresentation);
+            }
+        }
+        return mediaRepresentationPart;
+    }
+
 }
index 5706de506a24193742ce81c2f697ff017bc3de8b..0f3895a60d1e886b9f414796a6766600be210a76 100644 (file)
@@ -23,8 +23,8 @@ import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.reference.ReferenceType;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.AuthorHelper;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@@ -248,7 +248,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
 
                // series
                text_series = formFactory.createTextWithLabelElement(element, "Series",
-                               reference.getSeries(), style);
+                               reference.getSeriesPart(), style);
 
                // volume
                text_volume = formFactory.createTextWithLabelElement(element, "Volume",
@@ -337,7 +337,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                                reference.getVolume(), style);
 
                text_series = formFactory.createTextWithLabelElement(element, "Series",
-                               reference.getSeries(), style);
+                               reference.getSeriesPart(), style);
        }
 
        /**
@@ -362,7 +362,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
 
                // series part
                text_seriesPart = formFactory.createTextWithLabelElement(element,
-                               "Series Part", reference.getSeriesPart(), style);
+                               "Series", reference.getSeriesPart(), style);
 
                if (referenceType.equals(ReferenceType.Book)) {
                        // edition
@@ -432,8 +432,6 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        getEntity().setPublisher(text_publisher.getText());
                } else if (eventSource == text_referenceAbstract) {
                        getEntity().setReferenceAbstract(text_referenceAbstract.getText());
-               } else if (eventSource == text_series) {
-                       getEntity().setSeries(text_series.getText());
                } else if (eventSource == text_seriesPart) {
                        getEntity().setSeriesPart(text_seriesPart.getText());
                } else if (eventSource == text_title) {
@@ -446,7 +444,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        try {
                                getEntity().setUri(text_uri.getUri());
                        } catch (URISyntaxException e) {
-                               AbstractUtility.warningDialog("Invalid URI", getClass(),
+                               MessagingUtils.warningDialog("Invalid URI", getClass(),
                                                e.getLocalizedMessage());
                        }
                } else if (eventSource == text_volume) {
index 8fb18e9b620bd591d21f3508668421e857640a7b..8139ecd577b6f229a6252d482e2ea8b18bd50e3b 100644 (file)
@@ -21,6 +21,8 @@ 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.hibernate.permission.Role;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
@@ -77,39 +79,49 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
 
        /** {@inheritDoc} */
        @Override
-       protected void createControls(ICdmFormElement formElement,
-                       TaxonBase entity, int style) {
-               toggleable_cache = formFactory.createToggleableTextField(formElement,
-                               "Title Cache", entity.getTitleCache(),
-                               entity.isProtectedTitleCache(), style);
-
-               selection_secundum = formFactory
-                       .createSelectionElement(Reference.class,
+       protected void createControls(ICdmFormElement formElement, TaxonBase entity, int style) {
+                       toggleable_cache = formFactory.createToggleableTextField(formElement,
+                                       "Title Cache", entity.getTitleCache(),
+                                       entity.isProtectedTitleCache(), style);
+
+               //TODO RL
+               boolean rl=true;
+               if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                       toggleable_cache.setVisible(false);
+               }
+               if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                       text_appendedPhrase = formFactory.createTextWithLabelElement(
+                                       formElement, "Appended Phrase", entity.getAppendedPhrase(),
+                                       SWT.NULL);                      
+               }
+
+               selection_secundum = formFactory.createSelectionElement(Reference.class,
                                getConversationHolder(), formElement, "Secundum",
                                entity.getSec(), EntitySelectionElement.ALL,
                                style);
-
-               text_appendedPhrase = formFactory.createTextWithLabelElement(
-                               formElement, "Appended Phrase", entity.getAppendedPhrase(),
-                               SWT.NULL);
-               checkbox_useNameCache = formFactory.createCheckbox(formElement,
-                               "Exclude Authorship", entity.isUseNameCache(), style);
-
-               if (entity instanceof Taxon) {
-                       checkbox_excluded = formFactory.createCheckbox(formElement,
-                                       "Taxon is excluded", ((Taxon) entity).isExcluded(), style);
-                       checkbox_unplaced = formFactory.createCheckbox(formElement,
-                                       "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
+               
+               // TODO RL
+               if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)) {
+                       checkbox_useNameCache = formFactory.createCheckbox(formElement,
+                                       "Exclude Authorship", entity.isUseNameCache(), style);
+       
+                       if (entity instanceof Taxon) {
+                               checkbox_excluded = formFactory.createCheckbox(formElement,
+                                               "Taxon is excluded", ((Taxon) entity).isExcluded(), style);
+                               checkbox_unplaced = formFactory.createCheckbox(formElement,
+                                               "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
+                       }
+       
+                       checkbox_doubtful = formFactory.createCheckbox(formElement,
+                                       entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
                }
-
-               checkbox_doubtful = formFactory.createCheckbox(formElement,
-                               entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
-
+               
                if (entity instanceof Taxon) {
                        checkbox_published = formFactory.createCheckbox(formElement,
                                        "Taxon is published", ((Taxon) entity).isPublish(), style);
                }
 
+
                if(entity instanceof Synonym){
                    sectionSynonymRelationship = formFactory.createSynonymRelationshipDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
                    sectionSynonymRelationship.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
index ad14db124aaa8cbd95178152583c78e3c9411297..673befb06c6497402ec0828738f1e111aec875e8 100644 (file)
@@ -44,6 +44,8 @@ public class UserDetailElement extends AbstractCdmDetailElement<User> {
                        int style) {
                text_username = formFactory.createTextWithLabelElement(formElement,
                                "Username", entity.getUsername(), style);
+               // Disabling the text field since the user entity is immutable
+               text_username.setEnabled(false);
 
                if (userIsAuthenticated() || CdmStore.getLoginManager().isAdmin()) {
                        formFactory.createEditPasswordElement(
index de79af502a287e9e5679af6010d2104a0e4c2515..e1aea5b8fb3294b709076f7d5fc86141caafd0b3 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import java.net.URISyntaxException;\r
 \r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
@@ -57,13 +58,13 @@ public class TermVocabularyDetailElement extends AbstractTermBaseDetailElement<T
                        try {\r
                                getEntity().setUri(uri_uri.getUri());\r
                        } catch (URISyntaxException e) {\r
-                               StoreUtil.errorDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
+                               MessagingUtils.messageDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
                        }\r
                } else if (eventSource == uri_uriTermSource) {\r
                        try {\r
                                getEntity().setTermSourceUri(uri_uriTermSource.getUri());\r
                        } catch (URISyntaxException e) {\r
-                               StoreUtil.errorDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
+                               MessagingUtils.messageDialog("Not a URI", getClass(), "You have to provide a valid URI");\r
                        }\r
                }\r
        }\r
index b1acaa4030caef1c4b187832b615bf2d38d2922b..513d8dbc384fe5bf9233c262df01e28a2243ad72 100644 (file)
@@ -30,7 +30,7 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.reference.Reference;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.TextHelper;
 import eu.etaxonomy.taxeditor.newWizard.AmplificationCloningWizardPage;
 import eu.etaxonomy.taxeditor.newWizard.AmplificationGelPhotoWizardPage;
@@ -152,7 +152,7 @@ public class EditFromSelectionWizard extends Wizard implements
                     selectionElement.getConversationHolder(),
                     (Amplification) entity));
         } else {
-                       AbstractUtility.warningDialog("Missing interface", this,
+                       MessagingUtils.warningDialog("Missing interface", this,
                                        "No detail element for current selection");
                }
 
index 46ca1194360209baa6e42148fccf9923a2de7198..49a46a7dc39034f251cf9b6799d91f6fa29ed627 100644 (file)
@@ -28,8 +28,8 @@ import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.common.MultilanguageTextHelper;
 import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -237,7 +237,7 @@ public class TranslationWizardPage extends WizardPage{
                        if (language != null){
                                languageList.add(language);
                        }else{
-                               StoreUtil.warningDialog("Empty languages", getClass(), "The multilanguage string contains invalid data. Please contact the administrator of you datasource.");
+                               MessagingUtils.warningDialog("Empty languages", getClass(), "The multilanguage string contains invalid data. Please contact the administrator of you datasource.");
                        }
                }
 
index 8d1f9ad9d6bd7cb678f7b18bfbb77491f5f1d8ad..67a0bae278427199ca11a16728dd6b9f0a7db64d 100644 (file)
@@ -3,8 +3,11 @@
  */
 package eu.etaxonomy.taxeditor.view;
 
+import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -21,39 +24,103 @@ import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
  */
 public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
-        * .eclipse.swt.widgets.Composite)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void createPartControl(Composite parent) {
-               super.createPartControl(parent);
-       }
-
-       /**
-        * <p>
-        * getEditor
-        * </p>
-        *
-        * @return the currently active editor
-        */
-       public IEditorPart getEditor() {
-               return AbstractUtility.getActiveEditor();
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void setFocus() {
-               super.setFocus();
-
-               if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
-                       boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
-                       setEnabled(doEnable);
-               }
+    private DelaySelection delaySelection = null;
+    /**
+     * This is the monitor for the DelaySelection runnable.
+     * If it is <code>true</code> then it is currently delaying a selection.
+     */
+    private boolean isInDelay = false;
+
+
+    /**
+     * This class invokes internal_selectionChanged() in a separate thread.
+     * This allows an asynchronous and/or delayed handling of selection changes
+     */
+    private class DelaySelection implements Runnable{
+        private IWorkbenchPart part;
+        private ISelection selection;
+
+        public DelaySelection(IWorkbenchPart part, ISelection selection) {
+            super();
+            this.part = part;
+            this.selection = selection;
+        }
+
+        /* (non-Javadoc)
+         * @see java.lang.Runnable#run()
+         */
+        @Override
+        public void run() {
+            internal_selectionChanged(part, selection);
+            isInDelay = false;
+        }
+
+        public synchronized void setSelection(ISelection selection) {
+            this.selection = selection;
+        }
+
+        public synchronized void setPart(IWorkbenchPart part) {
+            this.part = part;
+        }
+
+    }
+
+    /**
+     * Handle selection change events here and <b>not</b> in
+     * {@link AbstractCdmEditorViewPart#selectionChanged(IWorkbenchPart, ISelection)}
+     * if you want asynchronous selection handling.
+     * @param part The workbench part that has issued the selection change
+     * @param selection the new selection
+     */
+    protected abstract void internal_selectionChanged(IWorkbenchPart part, ISelection selection);
+
+    /** {@inheritDoc} */
+    @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+        if(delaySelection==null){
+            delaySelection = new DelaySelection(part, selection);
+        }
+        delaySelection.setPart(part);
+        delaySelection.setSelection(selection);
+        if(!isInDelay){
+            isInDelay = true;
+            Display.getCurrent().asyncExec(delaySelection);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
+     * .eclipse.swt.widgets.Composite)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void createPartControl(Composite parent) {
+        super.createPartControl(parent);
+    }
+
+    /**
+     * <p>
+     * getEditor
+     * </p>
+     *
+     * @return the currently active editor
+     */
+    public IEditorPart getEditor() {
+        return AbstractUtility.getActiveEditor();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setFocus() {
+        super.setFocus();
+
+        if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
+            boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
+            setEnabled(doEnable);
+        }
     }
 
     /** {@inheritDoc} */
index 3cbafb3844980b5d28ff30c1c4e23ffcb66d0208..86f4a61a8ee302b8ec877ab4d597de9481bebbe9 100644 (file)
@@ -54,6 +54,7 @@ import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
@@ -74,7 +75,7 @@ public class CdmDataSourceViewPart extends ViewPart{
                 */
                @Override
                public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
-                       monitor.subTask("Refreshing Datasource View");
+                       monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
                        viewer.refresh();       
                }
 
@@ -83,7 +84,7 @@ public class CdmDataSourceViewPart extends ViewPart{
                 */
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
-                       monitor.subTask("Refreshing Datasource View");
+                       monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
                        viewer.refresh();       
                }
 
@@ -92,7 +93,7 @@ public class CdmDataSourceViewPart extends ViewPart{
                 */
                @Override
                public void contextStart(IMemento memento, IProgressMonitor monitor) {
-                       monitor.subTask("Refreshing Datasource View");
+                       monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
                        viewer.refresh();
                }
        }
@@ -115,8 +116,8 @@ public class CdmDataSourceViewPart extends ViewPart{
                @Override
                public IStatus run(final IProgressMonitor monitor) {
                        try{
-                               logger.debug("Begin of eclipse core runtime Job to Retrieve datasources");
-                               monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);                     
+                               logger.debug("Begin of eclipse core runtime Job to Retrieve datasources"); //$NON-NLS-1$
+                               monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);                      //$NON-NLS-1$
                                
                                final List<CdmMetaDataAwareDataSourceContainer> containers = new ArrayList<CdmMetaDataAwareDataSourceContainer>();
                                
@@ -136,19 +137,19 @@ public class CdmDataSourceViewPart extends ViewPart{
                                for(final CdmMetaDataAwareDataSourceContainer container : containers){
                                        
                                        
-                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : next DataSourceContainer");                                         
+                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : next DataSourceContainer");                                          //$NON-NLS-1$ //$NON-NLS-2$
                                        container.getMetaDataFromDataSource();
-                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");    
+                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");     //$NON-NLS-1$ //$NON-NLS-2$
                                        Display.getDefault().asyncExec(new Runnable() {
                                                
                                                @Override
                                                public void run() {
-                                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " starting sub thread to update ...");  
+                                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " starting sub thread to update ...");   //$NON-NLS-1$ //$NON-NLS-2$
                                                        viewer.update(container, null);
-                                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " end of sub thread to update ...");    
+                                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " end of sub thread to update ...");     //$NON-NLS-1$ //$NON-NLS-2$
                                                }
                                        });
-                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " done");       
+                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " done");        //$NON-NLS-1$ //$NON-NLS-2$
                                        monitor.worked(1);
                                }
                                
@@ -160,7 +161,7 @@ public class CdmDataSourceViewPart extends ViewPart{
        }
        
        /** Constant <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code> */
-       public static String ID = "eu.etaxonomy.taxeditor.view.datasource";
+       public static String ID = "eu.etaxonomy.taxeditor.view.datasource"; //$NON-NLS-1$
        
        private TableViewer viewer;
 
@@ -222,7 +223,7 @@ public class CdmDataSourceViewPart extends ViewPart{
                                        Object element = ((StructuredSelection) event
                                                        .getSelection()).getFirstElement();
                                        if (element instanceof CdmMetaDataAwareDataSourceContainer) {
-                                               String commandId = "eu.etaxonomy.taxeditor.store.datasource.change";
+                                               String commandId = "eu.etaxonomy.taxeditor.store.datasource.change"; //$NON-NLS-1$
                                                
                                                ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class);
                                                
@@ -234,13 +235,13 @@ public class CdmDataSourceViewPart extends ViewPart{
                                                        try {
                                                                handlerService.executeCommand(commandId, null);
                                                        } catch (ExecutionException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               MessagingUtils.error(this.getClass(), e);
                                                        } catch (NotDefinedException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               MessagingUtils.error(this.getClass(), e);
                                                        } catch (NotEnabledException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               MessagingUtils.error(this.getClass(), e);
                                                        } catch (NotHandledException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               MessagingUtils.error(this.getClass(), e);
                                                        }
                                                }
                                        }
@@ -255,7 +256,7 @@ public class CdmDataSourceViewPart extends ViewPart{
        // This will create the columns for the table
        private void createColumns(TableViewer viewer) {
                Table table = viewer.getTable();
-               String[] titles = {"Connected", "Name", "Server", "Up", "Type", "Database", "Nomenclatural Code", "Created", "CDM Version", "Compatible", "Notes"};
+               String[] titles = {Messages.CdmDataSourceViewPart_12, Messages.CdmDataSourceViewPart_11, Messages.CdmDataSourceViewPart_10, Messages.CdmDataSourceViewPart_9, Messages.CdmDataSourceViewPart_8, Messages.CdmDataSourceViewPart_7, Messages.CdmDataSourceViewPart_6, Messages.CdmDataSourceViewPart_5, Messages.CdmDataSourceViewPart_4, Messages.CdmDataSourceViewPart_3, Messages.CdmDataSourceViewPart_2};
                int[] bounds = { 24, 200, 100, 50 , 80, 120, 50, 100, 100, 50, 300};
 
                for (int i = 0; i < titles.length; i++) {
@@ -279,7 +280,7 @@ public class CdmDataSourceViewPart extends ViewPart{
         * <p>refresh</p>
         */
        public void refresh(){          
-               getService().schedule(new DataSourceJob("Loading datasources", CdmDataSourceRepository.getAll()), Job.LONG);
+               getService().schedule(new DataSourceJob(Messages.CdmDataSourceViewPart_1, CdmDataSourceRepository.getAll()), Job.LONG);
        }
 
        /** {@inheritDoc} */
@@ -306,7 +307,7 @@ public class CdmDataSourceViewPart extends ViewPart{
 //             viewer.getTable().setEnabled(!busy);
                if(busy){
                        partNameCache = getPartName();
-                       setPartName("Loading datasources");
+                       setPartName(Messages.CdmDataSourceViewPart_1);
                }else{
                        if(partNameCache != null){
                                setPartName(partNameCache);
index 9f828ac05d01fc3199af4056e0ee3a573855d028..1a21700c0b633005f6f621c752c015cb5e04010a 100644 (file)
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * <p>CdmMetaDataAwareDataSourceContainer class.</p>
@@ -88,7 +88,7 @@ public class CdmMetaDataAwareDataSourceContainer {
                                //                              } 
                        }
                } catch (Exception e) {
-                       StoreUtil.error(this.getClass(), e);
+                       MessagingUtils.error(this.getClass(), e);
                }
        }
        
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/Messages.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/Messages.java
new file mode 100644 (file)
index 0000000..ac1f5ae
--- /dev/null
@@ -0,0 +1,40 @@
+// $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
index a14a60f65ecee7fd87e2d6ebf94b42039b15dbaa..6edcd8fd80db4a7f56c096362b038fd530070596 100644 (file)
@@ -17,8 +17,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
 
 /**
@@ -41,23 +41,23 @@ public class ChangeConnectionHandler extends AbstractHandler {
                        CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement();
                        
                        if(CdmStore.isConnecting()){
-                               StoreUtil.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
+                               MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
                                return null;
                        }
                        
                        try {
                                container.getCdmSource().checkConnection();
-                               boolean confirmed = StoreUtil.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
+                               boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
                                                + container.getCdmSource().getName());
                                
                                if(confirmed){
                                        CdmDataSourceRepository.changeDataSource(container.getCdmSource());
                                }
                        } catch (Exception e) {
-                               StoreUtil.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " +
+                               MessagingUtils.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " +
                                                "not running or the machine is not reachable.\n\n" +
                                                "Please also make sure that you are connected to the network when trying to connect to a remote datasource.");
-                               StoreUtil.warn(getClass(), e);
+                               MessagingUtils.warn(getClass(), e);
                                return null;
                        } 
                }
index 1d1bb51ea5d9861b45280fc4cd4c5c3e7fe53dda..cf694e94fe7b1af71a6a191bc58a317dec50d90c 100644 (file)
@@ -25,6 +25,7 @@ import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.database.update.CdmUpdater;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
@@ -80,7 +81,7 @@ public class UpdateDataSourceHandler extends AbstractDataSourceHandler {
                                        }
                                }catch(Exception e){
                                        status = new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, e.getMessage(), e);
-                                       StoreUtil.errorDialog("Could not run updater", getClass(), status.getMessage());
+                                       MessagingUtils.messageDialog("Could not run updater", getClass(), status.getMessage());
                                }
                                }
 
index 76a6b5aee81207d22de8161df328b24ecd01f04c..ff7cb73f53ffdf67d466b997700437b9475bc2c2 100644 (file)
@@ -36,6 +36,7 @@ import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorImpl;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.mvc.combo.EnumTermComboController;
 
@@ -86,13 +87,13 @@ public class DerivateSearchCompositeController implements Listener{
                 try {
                     handlerService.executeCommand(commandId, null);
                 } catch (ExecutionException e) {
-                    AbstractUtility.error(DerivateSearchCompositeController.class, e);
+                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
                 } catch (NotDefinedException e) {
-                    AbstractUtility.error(DerivateSearchCompositeController.class, e);
+                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
                 } catch (NotEnabledException e) {
-                    AbstractUtility.error(DerivateSearchCompositeController.class, e);
+                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
                 } catch (NotHandledException e) {
-                    AbstractUtility.error(DerivateSearchCompositeController.class, e);
+                    MessagingUtils.error(DerivateSearchCompositeController.class, e);
                 }
 
             }
index 285fd520e215a93de38eb167bf549f091793380a..207e1e5edb7636da4a668fd9d9e6f4dcf049f5ab 100644 (file)
@@ -20,9 +20,9 @@ import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
@@ -86,7 +86,7 @@ public class CdmSectionPart<T> extends SectionPart implements
                                input = DerivedUnitFacade.NewInstance((DerivedUnit) input,
                                                PreferencesUtil.getDerivedUnitConfigurator());
                        } catch (DerivedUnitFacadeNotSupportedException e) {
-                               StoreUtil.error(getClass(), e);
+                               MessagingUtils.error(getClass(), e);
                        }
                }
                else if (input instanceof PolytomousKeyRelationship) {
index 3ef1c37e74a072ade9db70f3bf3b9c85b23ef333..64c5cd084977ef46d549534e38bfe62e05582353 100644 (file)
@@ -48,44 +48,52 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
                getSite().setSelectionProvider(viewer);
        }
 
-       /** {@inheritDoc} */
        @Override
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-               if(AbstractUtility.getActiveEditor() == null){
-                       showEmptyPage();
-                       return;
-               }
-
-               if(part == this){
-                       return;
-               }
-
-               if(!(selection instanceof IStructuredSelection)){
-                       return;
-               }
-
-               IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-
-               if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
-                       if(structuredSelection.size() != 1){
-                               showEmptyPage();
-                               return;
-                       }
-
-                       // do not show details for feature nodes TODO really?
-                       if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
-                               // do show the map for distributions
-                               Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();
-                               if(!feature.equals(Feature.DISTRIBUTION())){
-                                       showEmptyPage();
-                                       return;
-                               }
-                       }
-
-                       showViewer(part, structuredSelection);
-               }else{
-                       showEmptyPage();
-               }
+    protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection){
+           if(AbstractUtility.getActiveEditor() == null){
+            showEmptyPage();
+            return;
+        }
+
+        if(part == this){
+            return;
+        }
+
+        if(!(selection instanceof IStructuredSelection)){
+            return;
+        }
+
+        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+
+        if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
+            if(structuredSelection.size() != 1){
+                showEmptyPage();
+                return;
+            }
+
+            // do not show details for feature nodes TODO really?
+            if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
+                // do show the map for distributions
+                Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();
+                if(!feature.equals(Feature.DISTRIBUTION())){
+                    showEmptyPage();
+                    return;
+                }
+            }
+
+            showViewer(part, structuredSelection);
+        }else{
+            showEmptyPage();
+        }
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.view.AbstractCdmViewPart#showEmptyPage()
+        */
+       @Override
+       public void showEmptyPage() {
+           viewer.setSelection(null);
+           super.showEmptyPage();
        }
 
        /** {@inheritDoc} */
index 3d746ac2c58f8f42dcf13e076e287e1144064f3f..d68af6c2e4b24804d1e1c3fd99403cfaf75329f2 100644 (file)
@@ -52,8 +52,8 @@ 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.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -179,7 +179,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                 input = DerivedUnitFacade.NewInstance(derivedUnit,
                         PreferencesUtil.getDerivedUnitConfigurator());
             } catch (DerivedUnitFacadeNotSupportedException e) {
-                AbstractUtility.error(getClass(), e);
+                MessagingUtils.error(getClass(), e);
             }
         }
         else if(input instanceof FieldUnit){
@@ -391,8 +391,10 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     @Override
     public void setSelection(ISelection selection, boolean reveal) {
         this.selection = selection;
-        SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
-        fireSelectionChanged(selectionChangedEvent);
+        if(this.selection!=null){
+            SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
+            fireSelectionChanged(selectionChangedEvent);
+        }
     }
 
     /**
@@ -403,45 +405,46 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createTaxonSections(RootElement parent) {
         destroySections();
 
-        TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+        TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE     | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
-                | ExpandableComposite.EXPANDED);
-
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE);
-
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+        //TODO RL
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+                       addPart(protologSection);
+                       addPart(typeDesignationSection);
+                       addPart(nameRelationshipSection);
+        }
 
-        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
+        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
 
         addPart(taxonBaseDetailSection);
         addPart(nonViralNameSection);
         addPart(nomenclaturalStatusSection);
-        addPart(protologSection);
-        addPart(referenceDetailSection);
-        addPart(typeDesignationSection);
-        addPart(nameRelationshipSection);
         addPart(parsingMessagesSection);
+        addPart(referenceDetailSection);
     }
 
     /**
@@ -451,36 +454,35 @@ public class DetailsViewer extends AbstractCdmDataViewer {
      */
     private void createNameSections(RootElement parent) {
         destroySections();
-        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         addPart(nonViralNameSection);
         addPart(nomenclaturalStatusSection);
-        addPart(protologSection);
         addPart(referenceDetailSection);
-        addPart(typeDesignationSection);
-        addPart(nameRelationshipSection);
+//TODO RL
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                       ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               addPart(protologSection);
+               addPart(typeDesignationSection);
+               addPart(nameRelationshipSection);
+        }
     }
 
     /**
@@ -491,7 +493,8 @@ public class DetailsViewer extends AbstractCdmDataViewer {
     private void createReferenceSections(RootElement parent) {
         destroySections();
 
-        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
         addPart(referenceDetailSection);
     }
index ecb9c065466e2befa5d5eed67fe4ff7929af13b6..0ebdf49762320d0e4d44dc022f97467dc8572b9b 100644 (file)
@@ -54,7 +54,7 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
 
        /** {@inheritDoc} */
        @Override
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+       protected void internal_selectionChanged(IWorkbenchPart part, ISelection selection) {
                if(AbstractUtility.getActiveEditor() == null){
                        showEmptyPage();
                        return;