1
|
package eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler;
|
2
|
|
3
|
import java.util.UUID;
|
4
|
|
5
|
import org.eclipse.core.commands.ExecutionEvent;
|
6
|
import org.eclipse.ui.PartInitException;
|
7
|
|
8
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
9
|
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
|
10
|
import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
|
11
|
import eu.etaxonomy.taxeditor.model.MessagingUtils;
|
12
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
13
|
|
14
|
public class OpenBulkEditorForIdentifiableEntity extends DefaultOpenHandlerBase<IdentifiableEntity> {
|
15
|
|
16
|
@Override
|
17
|
protected IdentifiableEntity getEntity(UUID uuid) {
|
18
|
return CdmStore.getCommonService().find(IdentifiableEntity.class, uuid);
|
19
|
}
|
20
|
|
21
|
@Override
|
22
|
protected void open(ExecutionEvent event, IdentifiableEntity entity) {
|
23
|
try {
|
24
|
BulkEditorUtil.openEditor(entity);
|
25
|
} catch (PartInitException e) {
|
26
|
MessagingUtils.error(this.getClass(), "Bulk Editor could not be opened for "+entity, e);
|
27
|
}
|
28
|
}
|
29
|
|
30
|
|
31
|
}
|