1
|
|
2
|
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.handler;
|
3
|
|
4
|
import java.util.UUID;
|
5
|
|
6
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
7
|
import org.eclipse.swt.widgets.Shell;
|
8
|
|
9
|
import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
|
10
|
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
|
11
|
import eu.etaxonomy.taxeditor.editor.AppModelId;
|
12
|
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
13
|
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
|
14
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
15
|
|
16
|
public class OpenCharacterMatrixHandler extends DefaultOpenHandlerBaseE4<DescriptiveDataSet>{
|
17
|
|
18
|
/**
|
19
|
* {@inheritDoc}
|
20
|
*/
|
21
|
@Override
|
22
|
protected DescriptiveDataSet getEntity(UUID uuid) {
|
23
|
return CdmStore.getService(IDescriptiveDataSetService.class).load(uuid);
|
24
|
}
|
25
|
|
26
|
@Override
|
27
|
protected void open(DescriptiveDataSet entity, Shell shell, EPartService partService) {
|
28
|
EditorUtil.openCharacterMatrix(entity.getUuid(), modelService, partService, application);
|
29
|
}
|
30
|
|
31
|
/**
|
32
|
* {@inheritDoc}
|
33
|
*/
|
34
|
@Override
|
35
|
protected boolean canExecute(DescriptiveDataSet entity) {
|
36
|
return true;
|
37
|
}
|
38
|
|
39
|
@Override
|
40
|
protected String getPartId() {
|
41
|
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DESCRIPTIVEDATASET_MATRIX_CHARACTERMATRIXPART;
|
42
|
}
|
43
|
|
44
|
}
|