1
|
package eu.etaxonomy.taxeditor.handler.defaultHandler.e4;
|
2
|
|
3
|
import java.util.UUID;
|
4
|
|
5
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
6
|
import org.eclipse.jface.wizard.WizardDialog;
|
7
|
import org.eclipse.swt.widgets.Shell;
|
8
|
|
9
|
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
10
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
11
|
import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard;
|
12
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
13
|
|
14
|
public class DefaultOpenClassificationWizardHandlerE4 extends DefaultOpenHandlerBaseE4<TaxonNode> {
|
15
|
|
16
|
@Override
|
17
|
protected TaxonNode getEntity(UUID uuid) {
|
18
|
return CdmStore.getService(ITaxonNodeService.class).load(uuid);
|
19
|
}
|
20
|
|
21
|
@Override
|
22
|
protected void open(TaxonNode entity, Shell shell, EPartService partService) {
|
23
|
NewClassificationWizard classificationWizard = new NewClassificationWizard();
|
24
|
classificationWizard.init(null, null);
|
25
|
classificationWizard.setEntity(entity.getClassification());
|
26
|
WizardDialog dialog = new WizardDialog(shell, classificationWizard);
|
27
|
dialog.open();
|
28
|
}
|
29
|
|
30
|
/**
|
31
|
* {@inheritDoc}
|
32
|
*/
|
33
|
@Override
|
34
|
protected boolean canExecute(TaxonNode entity) {
|
35
|
return entity.getClassification().getRootNode().equals(entity);
|
36
|
}
|
37
|
|
38
|
|
39
|
}
|