1
|
/**
|
2
|
* Copyright (C) 2014 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
|
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.handler;
|
10
|
|
11
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
12
|
import org.eclipse.swt.widgets.Shell;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
|
15
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
16
|
import eu.etaxonomy.taxeditor.editor.AppModelId;
|
17
|
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
18
|
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
|
19
|
|
20
|
public class OpenDescriptiveDataSetEditorHandler extends DefaultOpenHandlerBaseE4<DescriptiveDataSet, UuidAndTitleCache<DescriptiveDataSet>>{
|
21
|
|
22
|
@Override
|
23
|
protected void open(UuidAndTitleCache<DescriptiveDataSet> entity, Shell shell, EPartService partService) {
|
24
|
EditorUtil.openDescriptiveDataSetEditor(entity.getUuid(), modelService, partService, application);
|
25
|
}
|
26
|
|
27
|
@Override
|
28
|
protected boolean canExecute(UuidAndTitleCache<DescriptiveDataSet> entity) {
|
29
|
return DescriptiveDataSet.class.isAssignableFrom(entity.getType());
|
30
|
}
|
31
|
|
32
|
@Override
|
33
|
protected String getPartId() {
|
34
|
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DESCRIPTIVEDATASET_DESCRIPTIVEDATASETEDITOR;
|
35
|
}
|
36
|
}
|