Revision 884aefac
Added by Katja Luther about 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/e4/DefaultOpenClassificationWizardHandlerE4.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.taxeditor.handler.defaultHandler.e4; |
2 | 2 |
|
3 |
import java.util.UUID; |
|
4 |
|
|
5 | 3 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
4 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
6 | 5 |
import org.eclipse.jface.wizard.WizardDialog; |
7 | 6 |
import org.eclipse.swt.widgets.Shell; |
8 | 7 |
|
9 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
|
10 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
|
8 |
import eu.etaxonomy.cdm.api.service.IClassificationService;
|
|
9 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
|
11 | 10 |
import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard; |
12 | 11 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
13 | 12 |
|
14 |
public class DefaultOpenClassificationWizardHandlerE4 extends DefaultOpenHandlerBaseE4<TaxonNode> { |
|
13 |
public class DefaultOpenClassificationWizardHandlerE4 extends DefaultOpenHandlerBaseE4<TaxonNodeDto> {
|
|
15 | 14 |
|
16 |
@Override |
|
17 |
protected TaxonNode getEntity(UUID uuid) { |
|
18 |
return CdmStore.getService(ITaxonNodeService.class).load(uuid); |
|
19 |
} |
|
15 |
// @Override
|
|
16 |
// protected TaxonNode getEntity(UUID uuid) {
|
|
17 |
// return CdmStore.getService(ITaxonNodeService.class).load(uuid);
|
|
18 |
// }
|
|
20 | 19 |
|
21 | 20 |
@Override |
22 |
protected void open(TaxonNode entity, Shell shell, EPartService partService) { |
|
21 |
protected void open(TaxonNodeDto entity, Shell shell, EPartService partService) {
|
|
23 | 22 |
NewClassificationWizard classificationWizard = new NewClassificationWizard(); |
24 | 23 |
classificationWizard.init(null, null); |
25 |
classificationWizard.setEntity(entity.getClassification());
|
|
24 |
classificationWizard.setEntity(CdmStore.getService(IClassificationService.class).load(entity.getClassificationUUID()));
|
|
26 | 25 |
WizardDialog dialog = new WizardDialog(shell, classificationWizard); |
27 | 26 |
dialog.open(); |
28 | 27 |
} |
... | ... | |
31 | 30 |
* {@inheritDoc} |
32 | 31 |
*/ |
33 | 32 |
@Override |
34 |
protected boolean canExecute(TaxonNode entity) { |
|
35 |
return entity.getClassification().getRootNode().equals(entity); |
|
33 |
protected boolean canExecute(IStructuredSelection entity) { |
|
34 |
return true; |
|
35 |
// return entity.getClassification().getRootNode().equals(entity); |
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
|
Also available in: Unified diff
ref #8047: allow multiselect for open distribution editor