Moved all logging and dialog functionality to the new class MessagingUtils.
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 14 Aug 2014 10:32:48 +0000 (10:32 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 14 Aug 2014 10:32:48 +0000 (10:32 +0000)
Refactoring code to adapt to above change.
Added new custom error dialog - CdmErrorDialog
Added runtime exception handling to the ApplicationWorkbenchAdvisor by adding a custom status handler

158 files changed:
.gitattributes
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/LineAnnotationModel.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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorStateManager.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/handler/EditCdmAuthoritiesHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/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/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/SwapSynonymAndAcceptedOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionElementHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.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/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/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/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/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/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/SearchBar.java
eu.etaxonomy.taxeditor.navigation/src/test/java/eu/etaxonomy/taxeditor/navigation/ApplicationWorkbenchAdvisor.java
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/src/main/java/eu/etaxonomy/taxeditor/datasource/CdmDataSourceRepository.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/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/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/PreferencesUtil.java
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/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/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/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/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/media/MediaRepresentationElement.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/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/reference/ReferenceDetailElement.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/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/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/DetailsViewer.java

index 713a46ecc4e11f078b06a88f5cea29567c59803e..001ebc172222dbd215acbfc0135ac036eba38b39 100644 (file)
@@ -1241,6 +1241,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
index cac70d6a0db1f5d49e07a50fae9e73c783499688..cb759ae747aee5b97b7471cbc05cc2a9a151d05d 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,61 @@ 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)
+        * 
+        * @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 + MessagingUtils.CONTACT_MESSAGE, 
+                                               statusAdapter.getStatus().getPlugin(), 
+                                               t);                                             
+                       }                           
+                   }
+               }
+       }
        
 
+       
 }
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 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 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..8936ca8560c3e9d81c6170248160973188304e95 100644 (file)
@@ -34,7 +34,7 @@ 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.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -226,7 +226,7 @@ public abstract class AbstractBulkEditorInput<T extends ICdmBase> implements IEd
                        try {
                                CdmStore.getService(ICommonService.class).merge((IMergable)mergeTarget, (IMergable)entity, null);
                        } catch (MergeException e) {
-                               AbstractUtility.error(getClass(), e);
+                               MessagingUtils.error(getClass(), e);
                        }
                }
                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 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 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 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());
                                                                        }
                                                                }
                                                                
index 5ffa7eec0f51e80391eb9fc406847928ddc85729..cc2bbf04772df20c8212f1eb3fe2287dca68d3ad 100644 (file)
@@ -14,6 +14,7 @@ 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;
 
@@ -41,9 +42,9 @@ public class OpenChecklistEditorHandler extends AbstractHandler {
                     try {
                         EditorUtil.open(input);
                     } catch (PartInitException e) {
-                        AbstractUtility.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+                       MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
                     } catch (NullPointerException npe) {
-                        AbstractUtility.errorDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
+                       MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
                                 "Could not open ChecklistView. The hierarchy is corrupted!", npe);
                     }
                 } else if (selectedElement instanceof TaxonNode) {
@@ -51,9 +52,9 @@ public class OpenChecklistEditorHandler extends AbstractHandler {
                     try {
                         EditorUtil.open(input);
                     } catch (PartInitException e) {
-                        AbstractUtility.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+                       MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
                     } catch (NullPointerException npe) {
-                        AbstractUtility.errorDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
+                       MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
                                 "Could not open ChecklistView. The hierarchy is corrupted!", npe);
                     }
                 }
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 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 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;
        }
 }
index b358658e2764f92e0a9c67d767c5149c1c1d21b3..318a4468c438e5a8ed3c67ae1bf87e83413a22bb 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 2ad00da8bb2a1aa5acf6a6f8b4397e6e03a1b601..a95e327d117e6853b63300a260a5580da2b1ce74 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 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..976aaa42b77cb9f3bda4ccc3775a01aaa4373937 100644 (file)
@@ -27,6 +27,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.CreateConceptRelationOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -74,7 +75,7 @@ public class CreateConceptRelationHandler extends AbstractHandler {
                                        editor.getUndoContext(), editor.getTaxon(), relatedConcept, typeInverseContainer, postOperationEnabled);
                        EditorUtil.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 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 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 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 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);
                        }
                }       
        }
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..085783c8d807567b1e26d0611896cbbbf11c8ae9 100644 (file)
@@ -43,7 +43,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;
@@ -164,11 +164,11 @@ public class PolytomousKeyViewPart extends ViewPart implements
         if(command.isEnabled()) {
             IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
             try {                
-                handlerService.executeCommand(OPEN_COMMAND_ID, null);
+                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);
             }
         }
        }
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;
        }
 }
index dccf5decd285aa4531b398c4ac0bcba618c9be0f..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;
@@ -177,7 +178,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
                }
                
                if("*".equals(searchString.trim())){
-                       NavigationUtil.warningDialog(Messages.SearchBar_2, this, Messages.SearchBar_3);
+                       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(), Messages.SearchBar_4, 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(Messages.SearchBar_5);
+                       MessagingUtils.info(Messages.SearchBar_5);
                        SearchOption option = (SearchOption) e.widget.getData();
 
                        switch (option){
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);
+//     }
 
 }
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 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 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 "
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;
                }
 
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;
        }
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 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);
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&nb