1 package eu
.etaxonomy
.taxeditor
.bulkeditor
.handler
.defaultHandler
;
3 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
4 import org
.eclipse
.swt
.widgets
.Shell
;
6 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
7 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
8 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
9 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
10 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
11 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
12 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
13 import eu
.etaxonomy
.cdm
.persistence
.dto
.UuidAndTitleCache
;
14 import eu
.etaxonomy
.taxeditor
.bulkeditor
.BulkEditorUtil
;
15 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.AbstractBulkEditorInput
;
16 import eu
.etaxonomy
.taxeditor
.handler
.defaultHandler
.e4
.DefaultOpenHandlerBaseE4
;
18 public class OpenBulkEditorForIdentifiableEntityE4
extends DefaultOpenHandlerBaseE4
<Object
>{
24 // protected IdentifiableEntity getEntity(UUID uuid) {
25 // return CdmStore.getCommonService().find(IdentifiableEntity.class, uuid);
32 protected void open(Object entity
, Shell shell
, EPartService partService
) {
33 @SuppressWarnings("rawtypes")
34 AbstractBulkEditorInput input
= null;
35 if (entity
instanceof UuidAndTitleCache
){
36 AbstractBulkEditorInput
.NewInstance(((UuidAndTitleCache
)entity
).getClass(), ((UuidAndTitleCache
)entity
).getUuid());
37 }else if (entity
instanceof IdentifiableEntity
){
38 input
= AbstractBulkEditorInput
.NewInstance((IdentifiableEntity
)entity
);
40 BulkEditorUtil
.openBulkEditor(input
, modelService
, partService
, application
);
47 protected boolean canExecute(Object entity
) {
48 if (entity
instanceof UuidAndTitleCache
){
49 return (TaxonName
.class.isAssignableFrom(((UuidAndTitleCache
)entity
).getType())
50 || AgentBase
.class.isAssignableFrom(((UuidAndTitleCache
)entity
).getType())
51 || SpecimenOrObservationBase
.class.isAssignableFrom(((UuidAndTitleCache
)entity
).getType())
52 || TaxonBase
.class.isAssignableFrom(((UuidAndTitleCache
)entity
).getType())
53 || Reference
.class.isAssignableFrom(((UuidAndTitleCache
)entity
).getType()));
56 return entity
instanceof Reference
57 || entity
instanceof TaxonName
58 || entity
instanceof AgentBase
59 || entity
instanceof SpecimenOrObservationBase
60 || entity
instanceof TaxonBase
61 || entity
instanceof Media
67 protected String
getPartId() {
68 return eu
.etaxonomy
.taxeditor
.bulkeditor
.AppModelId
.PARTDESCRIPTOR_BULKEDITOR_EDITOR
;