Revision b5b429af
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddExistingMediaHandler.java | ||
---|---|---|
5 | 5 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
6 | 6 |
import org.eclipse.e4.core.di.annotations.Execute; |
7 | 7 |
import org.eclipse.e4.core.di.annotations.Optional; |
8 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
8 | 9 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
9 | 10 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
10 | 11 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
22 | 23 |
|
23 | 24 |
@Execute |
24 | 25 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
25 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) DescriptionBase description, MMenuItem menuItem) { |
|
26 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) DescriptionBase description, MMenuItem menuItem, |
|
27 |
UISynchronize sync) { |
|
26 | 28 |
|
27 | 29 |
MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject(); |
28 | 30 |
|
... | ... | |
34 | 36 |
// TODO use undo context specific to editor |
35 | 37 |
operation = new AddExistingMediaToImageGalleryOperation(media, menuItem.getLocalizedLabel(), |
36 | 38 |
EditorUtil.getUndoContext(), description, mediaView); |
37 |
AbstractUtility.executeOperation(operation); |
|
39 |
AbstractUtility.executeOperation(operation, sync);
|
|
38 | 40 |
} |
39 | 41 |
} |
40 | 42 |
} |
Also available in: Unified diff
ref #6925 Inject context into operations to allow sync/async execution