Revision 2d8daa57
Added by Patrick Plitzner almost 7 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForIdentifiableEntityE4.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.UUID; |
4 | 4 |
|
5 |
import org.eclipse.e4.core.di.annotations.Execute; |
|
6 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
5 | 7 |
import org.eclipse.ui.PartInitException; |
6 | 8 |
|
7 | 9 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
8 | 10 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil; |
9 |
import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBaseE4; |
|
10 | 11 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
11 | 12 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
12 | 13 |
|
13 |
public class OpenBulkEditorForIdentifiableEntityE4 extends DefaultOpenHandlerBaseE4<IdentifiableEntity> {
|
|
14 |
public class OpenBulkEditorForIdentifiableEntityE4 { |
|
14 | 15 |
|
15 |
@Override |
|
16 |
protected IdentifiableEntity getEntity(UUID uuid) { |
|
17 |
return CdmStore.getCommonService().find(IdentifiableEntity.class, uuid); |
|
18 |
} |
|
19 |
|
|
20 |
@Override |
|
21 |
protected void open(IdentifiableEntity entity) { |
|
16 |
@Execute |
|
17 |
public void execute(MHandledMenuItem menuItem) { |
|
18 |
String commandId = menuItem.getCommand().getElementId(); |
|
19 |
UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".uuid"); |
|
20 |
IdentifiableEntity entity = CdmStore.getCommonService().find(IdentifiableEntity.class, uuid); |
|
22 | 21 |
try { |
23 | 22 |
BulkEditorUtil.openEditor(entity); |
24 | 23 |
} catch (PartInitException e) { |
... | ... | |
26 | 25 |
} |
27 | 26 |
} |
28 | 27 |
|
29 |
|
|
30 | 28 |
} |
Also available in: Unified diff
ref #6566 Migrate "Open in" context menu for specimen editor