Revision b5b429af
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java | ||
---|---|---|
6 | 6 |
import javax.inject.Named; |
7 | 7 |
|
8 | 8 |
import org.eclipse.e4.core.di.annotations.Execute; |
9 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
9 | 10 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
10 | 11 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
11 | 12 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
32 | 33 |
|
33 | 34 |
/** {@inheritDoc} */ |
34 | 35 |
@Execute |
35 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, MMenuItem menuItem) { |
|
36 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, MMenuItem menuItem, |
|
37 |
UISynchronize sync) { |
|
36 | 38 |
|
37 | 39 |
MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject(); |
38 | 40 |
|
... | ... | |
44 | 46 |
AbstractPostOperation<?> operation = new CreateTaxonDescriptionOperation(menuItem.getLocalizedLabel(), |
45 | 47 |
EditorUtil.getUndoContext(), taxon, mediaView, true); |
46 | 48 |
|
47 |
AbstractUtility.executeOperation(operation); |
|
49 |
AbstractUtility.executeOperation(operation, sync);
|
|
48 | 50 |
} |
49 | 51 |
else if(((CdmBase) viewerInput).isInstanceOf(SpecimenOrObservationBase.class)){ |
50 | 52 |
SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(viewerInput, SpecimenOrObservationBase.class); |
... | ... | |
52 | 54 |
AbstractPostOperation<?> operation = new AddDerivedUnitFacadeMediaOperation(menuItem.getLocalizedLabel(), |
53 | 55 |
BulkEditorUtil.getUndoContext(), specimen, mediaView); |
54 | 56 |
|
55 |
AbstractUtility.executeOperation(operation); |
|
57 |
AbstractUtility.executeOperation(operation, sync);
|
|
56 | 58 |
} |
57 | 59 |
} |
58 | 60 |
} |
Also available in: Unified diff
ref #6925 Inject context into operations to allow sync/async execution