1
|
package eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler;
|
2
|
|
3
|
import java.util.UUID;
|
4
|
|
5
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
6
|
import org.eclipse.swt.widgets.Shell;
|
7
|
|
8
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
9
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
10
|
import eu.etaxonomy.cdm.model.media.Media;
|
11
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
12
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
13
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
14
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
15
|
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
|
16
|
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
|
17
|
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
|
18
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
19
|
|
20
|
public class OpenBulkEditorForIdentifiableEntityE4 extends DefaultOpenHandlerBaseE4<IdentifiableEntity>{
|
21
|
|
22
|
/**
|
23
|
* {@inheritDoc}
|
24
|
*/
|
25
|
@Override
|
26
|
protected IdentifiableEntity getEntity(UUID uuid) {
|
27
|
return CdmStore.getCommonService().find(IdentifiableEntity.class, uuid);
|
28
|
}
|
29
|
|
30
|
/**
|
31
|
* {@inheritDoc}
|
32
|
*/
|
33
|
@Override
|
34
|
protected void open(IdentifiableEntity entity, Shell shell, EPartService partService) {
|
35
|
AbstractBulkEditorInput input = AbstractBulkEditorInput.NewInstance(entity);
|
36
|
BulkEditorUtil.openBulkEditor(input, modelService, partService, application);
|
37
|
}
|
38
|
|
39
|
/**
|
40
|
* {@inheritDoc}
|
41
|
*/
|
42
|
@Override
|
43
|
protected boolean canExecute(IdentifiableEntity entity) {
|
44
|
return entity instanceof Reference
|
45
|
|| entity instanceof TaxonName
|
46
|
|| entity instanceof AgentBase
|
47
|
|| entity instanceof SpecimenOrObservationBase
|
48
|
|| entity instanceof TaxonBase
|
49
|
|| entity instanceof Media
|
50
|
;
|
51
|
}
|
52
|
|
53
|
@Override
|
54
|
protected String getPartId() {
|
55
|
return eu.etaxonomy.taxeditor.bulkeditor.AppModelId.PARTDESCRIPTOR_BULKEDITOR_EDITOR;
|
56
|
}
|
57
|
|
58
|
}
|