Revision 954982ef
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/e4/handler/CreateDataSourceHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.core.runtime.IStatus; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
16 |
import org.eclipse.e4.core.di.annotations.Execute; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
20 | 21 |
import org.eclipse.swt.widgets.Shell; |
21 | 22 |
|
22 | 23 |
import eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceWizard; |
23 |
import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer; |
|
24 | 24 |
import eu.etaxonomy.taxeditor.view.datasource.e4.CdmDataSourceViewPartE4; |
25 | 25 |
|
26 | 26 |
/** |
... | ... | |
29 | 29 |
* @date 22.08.2017 |
30 | 30 |
* |
31 | 31 |
*/ |
32 |
public class CreateDataSourceHandlerE4 extends AbstractDataSourceHandlerE4 {
|
|
32 |
public class CreateDataSourceHandlerE4 { |
|
33 | 33 |
|
34 |
/** {@inheritDoc} */
|
|
35 |
@Override
|
|
36 |
public boolean specificExecute(CdmDataSourceViewPartE4 dataSourceViewPart, CdmMetaDataAwareDataSourceContainer container, Shell shell) {
|
|
37 |
CdmDataSourceWizard wizard = new CdmDataSourceWizard();
|
|
34 |
@Execute
|
|
35 |
public void execute(
|
|
36 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
|
|
37 |
@Named(IServiceConstants.ACTIVE_PART)MPart thisPart) {
|
|
38 | 38 |
|
39 |
WizardDialog dialog = new WizardDialog(shell, wizard);
|
|
39 |
CdmDataSourceViewPartE4 view = (CdmDataSourceViewPartE4) thisPart.getObject();
|
|
40 | 40 |
|
41 |
return dialog.open() == IStatus.OK; |
|
42 |
} |
|
41 |
CdmDataSourceWizard wizard = new CdmDataSourceWizard(); |
|
42 |
|
|
43 |
WizardDialog dialog = new WizardDialog(shell, wizard); |
|
44 |
|
|
45 |
boolean refresh = dialog.open() == IStatus.OK; |
|
46 |
|
|
47 |
if(refresh) { |
|
48 |
view.refresh(); |
|
49 |
} |
|
50 |
} |
|
43 | 51 |
|
44 | 52 |
@CanExecute |
45 | 53 |
public boolean canExecute( |
Also available in: Unified diff
fix #7698 Fix class cast exception