From: Katja Luther Date: Wed, 7 Oct 2015 10:34:54 +0000 (+0200) Subject: minor X-Git-Tag: 3.12.0^2~115 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/1a363aeb4c500891eccd99b4a0562ece63532834?hp=bb08b867eeb20e69b3bb58ec262de35c1c9becb5 minor --- diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties index 6b0f9e751..40a9a442b 100644 --- a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties +++ b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages.properties @@ -35,3 +35,7 @@ OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR=Could not open Derivativ OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Failed to open Editor OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=The derivative hierarchy is corrupted\! OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=No Derivatives found + +DeleteTaxonBaseHandler_CONFIRM_DELETION=Confirm Deletion +DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element has to be Synonym, Misapplication or Concept +DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Are you sure you want to delete the selected taxon? diff --git a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties index e18d56730..cf767cd8c 100644 --- a/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties +++ b/eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/messages_de.properties @@ -35,3 +35,7 @@ OpenDerivateEditorForTaxonHandler_COULD_NOT_OPEN_EDITOR=Konnte Derivat-Editor ni OpenDerivateEditorForTaxonHandler_FAILED_TO_OPEN=Öffnen des Editors fehlgeschlagen OpenDerivateEditorForTaxonHandler_HIERARCHY_CORRUPTED=Die Derivathierarchie ist korrumpiert\! OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=Keine Derivate gefunden + +DeleteTaxonBaseHandler_CONFIRM_DELETION=Löschen bestätigen +DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element muss Synonym, Misapplication oder Konzept sein +DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Wollen Sie wirklich das ausgewählte Taxon löschen? diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java index 34684d15d..5a3fd53cc 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/Messages.java @@ -32,6 +32,9 @@ public class Messages extends NLS { public static String DeleteDerivateOperation_CONFIRM; public static String DeleteDerivateOperation_DELETE_FAILED; public static String DeleteDerivateOperation_REALLY_DELETE; + public static String DeleteTaxonBaseHandler_CONFIRM_DELETION; + public static String DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT; + public static String DeleteTaxonBaseHandler_REALLY_DELETE_TAXON; public static String DerivateDropListener_MOVE_TO; public static String DerivateView_DERIVATIVE_EDITOR; public static String DerivateView_SAVING_HIERARCHY; diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java index 34119ea29..b5851aa77 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java @@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase; import eu.etaxonomy.cdm.model.taxon.Synonym; import eu.etaxonomy.cdm.model.taxon.Taxon; import eu.etaxonomy.taxeditor.editor.EditorUtil; +import eu.etaxonomy.taxeditor.editor.Messages; import eu.etaxonomy.taxeditor.editor.Page; import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor; import eu.etaxonomy.taxeditor.editor.name.operation.DeleteMisapplicationOperation; @@ -35,8 +36,6 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled; /** - *

DeleteTaxonBaseHandler class.

- * * @author n.hoffmann * @created 21.04.2009 * @version 1.0 @@ -44,9 +43,6 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled; public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler, IPostOperationEnabled { TaxonNameEditor editor; - /* (non-Javadoc) - * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) - */ /** {@inheritDoc} */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { @@ -59,12 +55,6 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler, return null; } - /** - * @param editor - * @param selectedElement - * @param operation - * @param commandName - */ protected void doExecute(ExecutionEvent event, TaxonNameEditor editor, Object selectedElement) { AbstractPostOperation operation = null; String commandName = null; @@ -86,7 +76,7 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler, } else if (selectedElement instanceof Taxon){ //TODO: how to get the actual classification - if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to delete the selected taxon?")){ + if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), Messages.DeleteTaxonBaseHandler_CONFIRM_DELETION, Messages.DeleteTaxonBaseHandler_REALLY_DELETE_TAXON)){ return ; } @@ -105,7 +95,7 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler, } else { - throw new IllegalArgumentException("Element has to be Synonym, Misapplication or Concept"); + throw new IllegalArgumentException(Messages.DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT); } AbstractUtility.executeOperation(operation); diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties index 052153506..f88d6402c 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties @@ -20,3 +20,17 @@ UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid. UriWithLabelElement_INVALID_URL=Invalid URI UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser + +ChangeConnectionHandler_ALREADY_CONNECTING=Already connecting +ChangeConnectionHandler_CONFIRM_DATASOURCE=Confirm Datasource Connection +ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently connecting to a different datasource already. +ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available +ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Do you really want to connect to this datasource?\n\n +ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource. + +LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database. +LoginDialog_LOGIN=Login +LoginDialog_PASSWORD=Password +LoginDialog_REALLY_CANCEL=Do you really want to cancel? +LoginDialog_USER_LOGIN=User Login +LoginDialog_USER_NAME=Username diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties index ea9b770aa..ca0430e50 100644 --- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties +++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties @@ -18,4 +18,18 @@ OrderPreferencePage_NewNavigatorWindowRequired=Nach dem UriWithLabelElement_URL_NOT_SAVED=URI wird nicht gespeichert\! UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht geöffnet werden. URI ist ung\u00FCtlig. UriWithLabelElement_INVALID_URL=Ung\u00FCltige URI -UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen \ No newline at end of file +UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen + +ChangeConnectionHandler_ALREADY_CONNECTING=Verbindung wird aufgebaut +ChangeConnectionHandler_CONFIRM_DATASOURCE=Verbindung bestätigen +ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=Es wird schon eine Verbindung zu einer Datenquelle aufgebaut +ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Gewählte Datenquelle nicht verfügbar +ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Wollen Sie sich wirklich mit dieser Datenquelle verbinden?\n\n +ChangeConnectionHandler_NOT_AVAILABLE_REASONS=Eventuell ist der Server nicht verfügbar oder erreichbar.\n\nStellen Sie bitte auch sicher, dass sie Netzzugang haben, wenn sie sich zu einer Remote-Datenquelle verbinden. + +LoginDialog_CANCEL_MESSAGE=Ein Abbruch wird die Verbindung zur Datenquelle schließen. +LoginDialog_LOGIN=Login +LoginDialog_PASSWORD=Passwort +LoginDialog_REALLY_CANCEL=Wollen Sie wirklich abbrechen? +LoginDialog_USER_LOGIN=Benutzer Login +LoginDialog_USER_NAME=Benutzername diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java index 0aa1e9c64..eb3f83291 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java @@ -22,6 +22,12 @@ public class Messages extends NLS { public static String LanguageEditorPreferencePage_EditorHasToRestart; public static String LanguageEditorPreferencePage_PleaseRestart; public static String LanguageEditorPreferencePage_RestartRequired; + public static String LoginDialog_CANCEL_MESSAGE; + public static String LoginDialog_LOGIN; + public static String LoginDialog_PASSWORD; + public static String LoginDialog_REALLY_CANCEL; + public static String LoginDialog_USER_LOGIN; + public static String LoginDialog_USER_NAME; public static String OrderPreferencePage_NewNavigatorWindowRequired; public static String OrderPreferencePage_PleaseReopenNavigator; public static String CdmDataSourceViewPart_1; @@ -36,6 +42,12 @@ public class Messages extends NLS { public static String CdmDataSourceViewPart_7; public static String CdmDataSourceViewPart_8; public static String CdmDataSourceViewPart_9; + public static String ChangeConnectionHandler_ALREADY_CONNECTING; + public static String ChangeConnectionHandler_CONFIRM_DATASOURCE; + public static String ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY; + public static String ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE; + public static String ChangeConnectionHandler_REALLY_WANT_TO_CONNECT; + public static String ChangeConnectionHandler_NOT_AVAILABLE_REASONS; public static String UriWithLabelElement_COULD_NOT_OPEN_BROWSER; public static String UriWithLabelElement_INVALID_URL; public static String UriWithLabelElement_OPEN_EXTERNAL_BROWSER; diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java index eaa7ae53c..324befb64 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT - * European Distributed Institute of Taxonomy + * European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu - * + * * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -20,8 +20,9 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import eu.etaxonomy.taxeditor.Messages; +import eu.etaxonomy.taxeditor.model.AbstractUtility; import eu.etaxonomy.taxeditor.store.CdmStore; -import eu.etaxonomy.taxeditor.store.StoreUtil; /** * TODO wrap in a LoginModule @@ -32,40 +33,32 @@ import eu.etaxonomy.taxeditor.store.StoreUtil; * @version 1.0 */ public class LoginDialog extends Dialog { - + private static Text text_password; private static Text text_username; - private String title; + private final String title; - /** - *

Constructor for LoginDialog.

- * - * @param parentShell a {@link org.eclipse.swt.widgets.Shell} object. - */ public LoginDialog(Shell parentShell) { super(parentShell); - title = "Login"; + title = Messages.LoginDialog_LOGIN; } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ + /** {@inheritDoc} */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); //add controls to composite as necessary - + // Label for the heading final CLabel titleLabel = new CLabel(composite, SWT.NONE); - titleLabel.setText("User Login"); + titleLabel.setText(Messages.LoginDialog_USER_LOGIN); // Label for the username final CLabel userNameLabel = new CLabel(composite, SWT.NONE); - userNameLabel.setText("Username"); + userNameLabel.setText(Messages.LoginDialog_USER_NAME); // Textfield for the username text_username = new Text(composite, SWT.BORDER); @@ -73,22 +66,18 @@ public class LoginDialog extends Dialog { // Label for the password final CLabel passwordLabel = new CLabel(composite, SWT.NONE); - passwordLabel.setText("Password"); + passwordLabel.setText(Messages.LoginDialog_PASSWORD); // Textfield for the password text_password = new Text(composite, SWT.PASSWORD | SWT.BORDER); text_password.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - - + + return composite; } - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) - */ /** {@inheritDoc} */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); if (title != null) { @@ -96,33 +85,30 @@ public class LoginDialog extends Dialog { } } - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#okPressed() - */ /** {@inheritDoc} */ @Override protected void okPressed() { String username = text_username.getText(); String password = text_password.getText(); - + boolean result = CdmStore.getLoginManager().authenticate(username, password); - + if(result){ super.okPressed(); } - - } - + + } + @Override - protected void cancelPressed() { + protected void cancelPressed() { if(CdmStore.getLoginManager().getAuthenticatedUser() != null){ super.cancelPressed(); }else{ // if there is no active user and the current user chooses to cancel, we close the connection - boolean result = MessageDialog.openConfirm(getShell(), "Do you really want to cancel", "Aborting the login procedure will close the database."); - + boolean result = MessageDialog.openConfirm(getShell(), Messages.LoginDialog_REALLY_CANCEL, Messages.LoginDialog_CANCEL_MESSAGE); + if(result){ - CdmStore.close(StoreUtil.getMonitor()); + CdmStore.close(AbstractUtility.getMonitor()); super.cancelPressed(); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java index dc1ce081d..4444f18f5 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java @@ -36,8 +36,6 @@ import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; import eu.etaxonomy.taxeditor.store.CdmStore; /** - *

FilteredNamedAreaSelectionDialog class.

- * * @author n.hoffmann * @created May 11, 2010 * @version 1.0 @@ -68,7 +66,7 @@ public class NamedAreaSelectionDialog extends } private Collection> selectedVocabularies; - private final ArrayList preselectedVocabularies; + private ArrayList preselectedVocabularies; /** @@ -88,25 +86,17 @@ public class NamedAreaSelectionDialog extends return getSelectionFromDialog(dialog); } - /** - *

Constructor for FilteredNamedAreaSelectionDialog.

- * - * @param shell a {@link org.eclipse.swt.widgets.Shell} object. - * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. - * @param title a {@link java.lang.String} object. - * @param multi a boolean. - * @param namedArea a {@link eu.etaxonomy.cdm.model.location.NamedArea} object. - * @param preselectedVocabularyUuids the {@link UUID}s of the pre-selected Vocabularies - */ protected NamedAreaSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, NamedArea namedArea, UUID... preselectedVocabularyUuids) { super(shell, conversation, title, multi, NamedAreaSelectionDialog.class.getCanonicalName(), namedArea); - preselectedVocabularies = new ArrayList(); - for(int i=0;i0){ + preselectedVocabularies = new ArrayList(); + for(int i=0;i vocabulary : getAvailableVocabularies()){ IncludeNamedAreaVocabulary action = new IncludeNamedAreaVocabulary(vocabulary); menuManager.add(action); - if(preselectedVocabularies.isEmpty() || preselectedVocabularies.contains(vocabulary)) { + if(preselectedVocabularies==null || preselectedVocabularies.isEmpty() || preselectedVocabularies.contains(vocabulary)) { action.setChecked(true); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java index 7fc0fd5eb..32c20fd1d 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java @@ -260,6 +260,7 @@ public class EntitySelectionElement extends /** {@inheritDoc} */ @Override public void setEnabled(boolean enabled) { + button_selection.setEnabled(enabled); if (isDeletable){ button_remove.setEnabled(enabled); @@ -267,6 +268,7 @@ public class EntitySelectionElement extends if (isEditable) { updateButtonStates(); } + } /* (non-Javadoc) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java index fcb455583..2c140c247 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java @@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.handlers.HandlerUtil; +import eu.etaxonomy.taxeditor.Messages; import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository; import eu.etaxonomy.taxeditor.model.MessagingUtils; import eu.etaxonomy.taxeditor.store.CdmStore; @@ -37,22 +38,20 @@ public class ChangeConnectionHandler extends AbstractHandler { CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement(); if(CdmStore.isConnecting()){ - MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already."); + MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_ALREADY_CONNECTING, this, Messages.ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY); return null; } try { container.getCdmSource().checkConnection(); - boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n" + boolean confirmed = MessagingUtils.confirmDialog(Messages.ChangeConnectionHandler_CONFIRM_DATASOURCE, Messages.ChangeConnectionHandler_REALLY_WANT_TO_CONNECT + container.getCdmSource().getName()); if(confirmed){ CdmDataSourceRepository.changeDataSource(container.getCdmSource()); } } catch (Exception e) { - MessagingUtils.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " + - "not running or the machine is not reachable.\n\n" + - "Please also make sure that you are connected to the network when trying to connect to a remote datasource."); + MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE, this, Messages.ChangeConnectionHandler_NOT_AVAILABLE_REASONS); MessagingUtils.warn(getClass(), e); return null; } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DeleteDataSourceHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DeleteDataSourceHandler.java index 8aa1147e7..72543d8ed 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DeleteDataSourceHandler.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/DeleteDataSourceHandler.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -21,33 +21,28 @@ import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository; import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer; /** - *

DeleteDataSourceHandler class.

- * * @author n.hoffmann * @created 15.04.2009 * @version 1.0 */ public class DeleteDataSourceHandler extends AbstractDataSourceHandler { - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.store.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent) - */ /** {@inheritDoc} */ @Override public boolean specificExecute(ExecutionEvent event) { ISelection selection = HandlerUtil.getActivePart(event).getSite().getSelectionProvider().getSelection(); if(selection instanceof IStructuredSelection){ Object[] selectedObjects = ((IStructuredSelection) selection).toArray(); - + if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you want to delete the selected datasources?")){ return false; } - // Delete from persistent data sources + // Delete from persistent data sources for(Object object : selectedObjects){ CdmPersistentDataSource dataSource = (CdmPersistentDataSource) ((CdmMetaDataAwareDataSourceContainer) object).getCdmSource(); CdmDataSourceRepository.delete(dataSource); } - + return true; } return false;