1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.taxeditor.local.view.datasource.e4.handler;
|
11
|
|
12
|
import org.eclipse.jface.dialogs.MessageDialog;
|
13
|
import org.eclipse.swt.widgets.Shell;
|
14
|
|
15
|
import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
|
16
|
import eu.etaxonomy.taxeditor.local.datasource.common.CdmDataSourceRepository;
|
17
|
import eu.etaxonomy.taxeditor.local.view.datasource.CdmMetaDataAwareDataSourceContainer;
|
18
|
import eu.etaxonomy.taxeditor.local.view.datasource.e4.CdmDataSourceViewPartE4;
|
19
|
|
20
|
/**
|
21
|
*
|
22
|
* @author pplitzner
|
23
|
* @date 22.08.2017
|
24
|
*
|
25
|
*/
|
26
|
public class DeleteDataSourceHandlerE4 extends AbstractDataSourceHandler {
|
27
|
|
28
|
|
29
|
|
30
|
/** {@inheritDoc} */
|
31
|
@Override
|
32
|
public boolean specificExecute(CdmDataSourceViewPartE4 dataSourceViewPart, CdmMetaDataAwareDataSourceContainer container, Shell shell) {
|
33
|
if(! MessageDialog.openConfirm(shell, "Confirm Deletion", "Do you want to delete the selected datasources?")){
|
34
|
return false;
|
35
|
}
|
36
|
CdmPersistentDataSource dataSource = (CdmPersistentDataSource) container.getCdmSource();
|
37
|
CdmDataSourceRepository.delete(dataSource);
|
38
|
return true;
|
39
|
}
|
40
|
|
41
|
}
|