Revision 8aac42d2
Added by Patrick Plitzner over 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java | ||
---|---|---|
16 | 16 |
import org.eclipse.jface.viewers.IStructuredSelection; |
17 | 17 |
import org.eclipse.ui.handlers.HandlerUtil; |
18 | 18 |
|
19 |
import eu.etaxonomy.taxeditor.Messages; |
|
19 | 20 |
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository; |
20 | 21 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
21 | 22 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
37 | 38 |
CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement(); |
38 | 39 |
|
39 | 40 |
if(CdmStore.isConnecting()){ |
40 |
MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
|
|
41 |
MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_ALREADY_CONNECTING, this, Messages.ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY);
|
|
41 | 42 |
return null; |
42 | 43 |
} |
43 | 44 |
|
44 | 45 |
try { |
45 | 46 |
container.getCdmSource().checkConnection(); |
46 |
boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
|
|
47 |
boolean confirmed = MessagingUtils.confirmDialog(Messages.ChangeConnectionHandler_CONFIRM_DATASOURCE, Messages.ChangeConnectionHandler_REALLY_WANT_TO_CONNECT
|
|
47 | 48 |
+ container.getCdmSource().getName()); |
48 | 49 |
|
49 | 50 |
if(confirmed){ |
50 | 51 |
CdmDataSourceRepository.changeDataSource(container.getCdmSource()); |
51 | 52 |
} |
52 | 53 |
} catch (Exception e) { |
53 |
MessagingUtils.warningDialog("Chosen datasource is not available", this, "This could mean that either the database server is " + |
|
54 |
"not running or the machine is not reachable.\n\n" + |
|
55 |
"Please also make sure that you are connected to the network when trying to connect to a remote datasource."); |
|
54 |
MessagingUtils.warningDialog(Messages.ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE, this, Messages.ChangeConnectionHandler_NOT_AVAILABLE_REASONS); |
|
56 | 55 |
MessagingUtils.warn(getClass(), e); |
57 | 56 |
return null; |
58 | 57 |
} |
Also available in: Unified diff
I18n of login and data source view