Revision b5b429af
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/SetMarkerFlagHandlerE4.java | ||
---|---|---|
16 | 16 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
17 | 17 |
import org.eclipse.e4.core.di.annotations.Execute; |
18 | 18 |
import org.eclipse.e4.core.di.annotations.Optional; |
19 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
19 | 20 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
20 | 21 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
21 | 22 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
40 | 41 |
@Execute |
41 | 42 |
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)IAnnotatableEntity selection, |
42 | 43 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
43 |
MHandledMenuItem menuItem) { |
|
44 |
MHandledMenuItem menuItem, UISynchronize sync) {
|
|
44 | 45 |
|
45 | 46 |
BulkEditorE4 editor = (BulkEditorE4) activePart.getObject(); |
46 | 47 |
MarkerType markerType = (MarkerType) menuItem.getTransientData().get(DynamicMarkerTypeEditingMenuE4.COMMAND_PARAMETER_MARKER_TYPE); |
... | ... | |
48 | 49 |
|
49 | 50 |
|
50 | 51 |
AbstractPostOperation operation = new SetMarkerFlagOperation("Set Marker", BulkEditorUtil.getUndoContext(), Collections.singleton(selection), markerType, markerState, editor); |
51 |
AbstractUtility.executeOperation(operation); |
|
52 |
AbstractUtility.executeOperation(operation, sync);
|
|
52 | 53 |
} |
53 | 54 |
|
54 | 55 |
|
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/SetMarkerFlagHandler.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
44 | 44 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
45 | 45 |
*/ |
46 | 46 |
/** {@inheritDoc} */ |
47 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
48 |
|
|
47 |
@Override |
|
48 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
49 |
|
|
49 | 50 |
ISelection selection = HandlerUtil.getCurrentSelection(event); |
50 |
|
|
51 |
|
|
51 | 52 |
IEditorPart editor = HandlerUtil.getActiveEditor(event); |
52 |
|
|
53 |
|
|
53 | 54 |
Object[] data = (Object[]) ((Event) event.getTrigger()).data; |
54 |
|
|
55 |
if (selection instanceof TextSelection
|
|
55 |
|
|
56 |
if (selection instanceof TextSelection |
|
56 | 57 |
&& editor instanceof BulkEditor) { |
57 | 58 |
TextSelection textSelection = (TextSelection) selection; |
58 | 59 |
BulkEditor bulkEditor = (BulkEditor) editor; |
59 |
|
|
60 |
|
|
60 | 61 |
LineAnnotationModel model = (LineAnnotationModel) bulkEditor.getDocumentProvider().getAnnotationModel(editor.getEditorInput()); |
61 | 62 |
if (model != null) { |
62 | 63 |
Iterator iter = model.getAnnotationIterator(textSelection.getOffset(), textSelection.getLength(), true, true); |
63 |
|
|
64 |
|
|
64 | 65 |
Set<IAnnotatableEntity> annotatableEntities = new HashSet<IAnnotatableEntity>(); |
65 | 66 |
while (iter.hasNext()) { |
66 | 67 |
Object next = iter.next(); |
67 | 68 |
if (next instanceof LineAnnotation) { |
68 | 69 |
Object entity = ((LineAnnotation) next).getEntity(); |
69 |
|
|
70 |
|
|
70 | 71 |
if(entity instanceof IAnnotatableEntity){ |
71 | 72 |
annotatableEntities.add((IAnnotatableEntity) entity); |
72 | 73 |
} |
73 | 74 |
} |
74 | 75 |
} |
75 |
|
|
76 |
|
|
76 | 77 |
AbstractPostOperation operation = new SetMarkerFlagOperation("Set Marker", BulkEditorUtil.getUndoContext(), annotatableEntities, (MarkerType) data[0], (Boolean) data[1], bulkEditor); |
77 |
BulkEditorUtil.executeOperation(operation); |
|
78 | 78 |
} |
79 | 79 |
} |
80 | 80 |
return null; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/handler/CreateChildNodeHandlerE4.java | ||
---|---|---|
8 | 8 |
import org.eclipse.core.commands.operations.IUndoContext; |
9 | 9 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
10 | 10 |
import org.eclipse.e4.core.di.annotations.Execute; |
11 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
11 | 12 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
12 | 13 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
13 | 14 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
33 | 34 |
@Execute |
34 | 35 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
35 | 36 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
36 |
MHandledMenuItem menuItem) { |
|
37 |
MHandledMenuItem menuItem, |
|
38 |
UISynchronize sync) { |
|
37 | 39 |
|
38 | 40 |
PolytomousKeyListEditorE4 editor = (PolytomousKeyListEditorE4) activePart.getObject(); |
39 | 41 |
|
... | ... | |
45 | 47 |
|
46 | 48 |
AbstractPostOperation operation = new CreateNodeOperation( |
47 | 49 |
label, undoContext, pk.getRoot(), editor); |
48 |
AbstractUtility.executeOperation(operation); |
|
50 |
AbstractUtility.executeOperation(operation, sync);
|
|
49 | 51 |
} else { |
50 | 52 |
|
51 | 53 |
String label = menuItem.getLocalizedLabel(); |
... | ... | |
56 | 58 |
|
57 | 59 |
AbstractPostOperation operation = new CreateNodeOperation( |
58 | 60 |
label, undoContext, keyNode, editor); |
59 |
AbstractUtility.executeOperation(operation); |
|
61 |
AbstractUtility.executeOperation(operation, sync);
|
|
60 | 62 |
} |
61 | 63 |
} |
62 | 64 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/handler/CreateSiblingNodeHandlerE4.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
import org.eclipse.core.commands.operations.IUndoContext; |
6 | 6 |
import org.eclipse.e4.core.di.annotations.Execute; |
7 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
7 | 8 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
8 | 9 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
9 | 10 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
27 | 28 |
|
28 | 29 |
@Execute |
29 | 30 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
30 |
@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection, MHandledMenuItem menuItem) { |
|
31 |
@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection, MHandledMenuItem menuItem, |
|
32 |
UISynchronize sync) { |
|
31 | 33 |
|
32 | 34 |
PolytomousKeyListEditorE4 editor = (PolytomousKeyListEditorE4) activePart.getObject(); |
33 | 35 |
|
... | ... | |
38 | 40 |
|
39 | 41 |
AbstractPostOperation operation = new CreateNodeOperation(label, undoContext, keyNode.getParent(), |
40 | 42 |
editor); |
41 |
AbstractUtility.executeOperation(operation); |
|
43 |
AbstractUtility.executeOperation(operation, sync);
|
|
42 | 44 |
} |
43 | 45 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/handler/RefreshNodeNumberingHandlerE4.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
import org.eclipse.core.commands.operations.IUndoContext; |
6 | 6 |
import org.eclipse.e4.core.di.annotations.Execute; |
7 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
7 | 8 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
8 | 9 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
9 | 10 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
21 | 22 |
@Execute |
22 | 23 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
23 | 24 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
24 |
MHandledMenuItem menuItem){ |
|
25 |
MHandledMenuItem menuItem, |
|
26 |
UISynchronize sync){ |
|
25 | 27 |
|
26 | 28 |
PolytomousKeyListEditorE4 editor = (PolytomousKeyListEditorE4) activePart.getObject(); |
27 | 29 |
|
... | ... | |
34 | 36 |
|
35 | 37 |
AbstractPostOperation operation = new RefreshNodeNumberingOperation( |
36 | 38 |
label, undoContext, keyNode, editor); |
37 |
AbstractUtility.executeOperation(operation); |
|
39 |
AbstractUtility.executeOperation(operation, sync);
|
|
38 | 40 |
} |
39 | 41 |
} |
40 | 42 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/CreateChildNodeHandler.java | ||
---|---|---|
58 | 58 |
|
59 | 59 |
AbstractPostOperation operation = new CreateNodeOperation( |
60 | 60 |
label, undoContext, pk.getRoot(), editorPage); |
61 |
AbstractUtility.executeOperation(operation); |
|
62 | 61 |
} catch (NotDefinedException e) { |
63 | 62 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
64 | 63 |
} |
... | ... | |
77 | 76 |
|
78 | 77 |
AbstractPostOperation operation = new CreateNodeOperation( |
79 | 78 |
label, undoContext, keyNode, editorPage); |
80 |
AbstractUtility.executeOperation(operation); |
|
81 | 79 |
} catch (NotDefinedException e) { |
82 | 80 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
83 | 81 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/CreateSiblingNodeHandler.java | ||
---|---|---|
60 | 60 |
|
61 | 61 |
AbstractPostOperation operation = new CreateNodeOperation( |
62 | 62 |
label, undoContext, keyNode.getParent(), editorPage); |
63 |
AbstractUtility.executeOperation(operation); |
|
64 | 63 |
} catch (NotDefinedException e) { |
65 | 64 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
66 | 65 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RefreshNodeNumberingHandler.java | ||
---|---|---|
5 | 5 |
import org.eclipse.core.commands.ExecutionException; |
6 | 6 |
import org.eclipse.core.commands.common.NotDefinedException; |
7 | 7 |
import org.eclipse.core.commands.operations.IUndoContext; |
8 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
9 | 8 |
import org.eclipse.jface.viewers.IStructuredSelection; |
10 | 9 |
import org.eclipse.ui.IEditorPart; |
11 | 10 |
import org.eclipse.ui.handlers.HandlerUtil; |
... | ... | |
15 | 14 |
import eu.etaxonomy.taxeditor.editor.key.KeyEditor; |
16 | 15 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage; |
17 | 16 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor; |
18 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.CreateNodeOperation; |
|
19 | 17 |
import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RefreshNodeNumberingOperation; |
20 | 18 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
21 | 19 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
... | ... | |
31 | 29 |
.getActiveEditor(); |
32 | 30 |
|
33 | 31 |
if (editorPage instanceof PolytomousKeyListEditor) { |
34 |
|
|
32 |
|
|
35 | 33 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil |
36 | 34 |
.getCurrentSelection(event); |
37 | 35 |
|
... | ... | |
45 | 43 |
|
46 | 44 |
AbstractPostOperation operation = new RefreshNodeNumberingOperation( |
47 | 45 |
label, undoContext, keyNode, editorPage); |
48 |
EditorUtil.executeOperation(operation); |
|
49 | 46 |
} catch (NotDefinedException e) { |
50 | 47 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
51 | 48 |
} |
52 |
}
|
|
49 |
} |
|
53 | 50 |
} |
54 |
}
|
|
51 |
} |
|
55 | 52 |
|
56 | 53 |
return null; |
57 | 54 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/IDropTargetableE4.java | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
package eu.etaxonomy.taxeditor.editor.name.e4; |
5 | 5 |
|
6 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
6 | 7 |
import org.eclipse.swt.widgets.Composite; |
7 | 8 |
|
8 | 9 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
... | ... | |
22 | 23 |
public void dragEntered(); |
23 | 24 |
|
24 | 25 |
public void dragLeft(); |
26 |
|
|
27 |
public IEclipseContext getContext(); |
|
25 | 28 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java | ||
---|---|---|
23 | 23 |
import org.eclipse.core.commands.operations.UndoContext; |
24 | 24 |
import org.eclipse.core.runtime.IProgressMonitor; |
25 | 25 |
import org.eclipse.core.runtime.OperationCanceledException; |
26 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
26 | 27 |
import org.eclipse.e4.core.services.events.IEventBroker; |
27 | 28 |
import org.eclipse.e4.ui.di.Focus; |
28 | 29 |
import org.eclipse.e4.ui.di.Persist; |
... | ... | |
122 | 123 |
@Inject |
123 | 124 |
private ESelectionService selService; |
124 | 125 |
|
126 |
@Inject |
|
127 |
private IEclipseContext context; |
|
128 |
|
|
125 | 129 |
@Inject |
126 | 130 |
private MDirtyable dirty; |
127 | 131 |
|
... | ... | |
477 | 481 |
return allGroups; |
478 | 482 |
} |
479 | 483 |
|
484 |
@Override |
|
485 |
public IEclipseContext getContext() { |
|
486 |
return context; |
|
487 |
} |
|
488 |
|
|
480 | 489 |
public boolean isDirty() { |
481 | 490 |
return dirty.isDirty(); |
482 | 491 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupE4.java | ||
---|---|---|
12 | 12 |
import java.util.ArrayList; |
13 | 13 |
import java.util.List; |
14 | 14 |
|
15 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
15 | 16 |
import org.eclipse.swt.SWT; |
16 | 17 |
import org.eclipse.swt.dnd.DND; |
17 | 18 |
import org.eclipse.swt.dnd.DropTarget; |
... | ... | |
42 | 43 |
|
43 | 44 |
private Composite control; |
44 | 45 |
|
46 |
private IEclipseContext context; |
|
47 |
|
|
45 | 48 |
private final List<AbstractGroupedContainerE4> groupedContainers = new ArrayList<>(); |
46 | 49 |
|
47 | 50 |
protected TaxonNameEditorE4 editor; |
... | ... | |
51 | 54 |
|
52 | 55 |
public AbstractGroupE4(TaxonNameEditorE4 editor){ |
53 | 56 |
this.editor = editor; |
57 |
this.context = editor.getContext(); |
|
54 | 58 |
} |
55 | 59 |
|
56 | 60 |
protected void createContent(){ |
... | ... | |
84 | 88 |
|
85 | 89 |
public void add(AbstractGroupedContainerE4 groupedContainer){ |
86 | 90 |
groupedContainers.add(groupedContainer); |
87 |
groupedContainer.setGroup(this); |
|
88 | 91 |
} |
89 | 92 |
|
90 | 93 |
public void remove(AbstractGroupedContainerE4 groupedContainer){ |
... | ... | |
119 | 122 |
} |
120 | 123 |
} |
121 | 124 |
|
125 |
@Override |
|
126 |
public IEclipseContext getContext() { |
|
127 |
return context; |
|
128 |
} |
|
129 |
|
|
122 | 130 |
@Override |
123 | 131 |
public TaxonNameEditorE4 getEditor() { |
124 | 132 |
return editor; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupedContainerE4.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import org.apache.commons.lang.StringUtils; |
17 | 17 |
import org.eclipse.core.runtime.Assert; |
18 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
18 | 19 |
import org.eclipse.jface.dialogs.Dialog; |
19 | 20 |
import org.eclipse.jface.text.IDocument; |
20 | 21 |
import org.eclipse.jface.text.Position; |
... | ... | |
122 | 123 |
|
123 | 124 |
private ISelectionChangedListener selectionChangedListener; |
124 | 125 |
|
125 |
public AbstractGroupedContainerE4(T taxonBase) { |
|
126 |
public AbstractGroupedContainerE4(AbstractGroupE4 group, T taxonBase) {
|
|
126 | 127 |
setData(taxonBase); |
128 |
this.group = group; |
|
127 | 129 |
parseHandler = ParseHandler.NewInstance(taxonBase.getName()); |
128 | 130 |
} |
129 | 131 |
|
... | ... | |
294 | 296 |
|
295 | 297 |
AbstractUtility.executeOperation(new CreateSynonymInNewGroupOperation( |
296 | 298 |
Messages.AbstractGroupedContainer_NEW_HETERO_SYNONYM, getEditor().getUndoContext(), |
297 |
getEditor().getTaxon(), synonymName, getEditor())); |
|
299 |
getEditor().getTaxon(), synonymName, getEditor()), group.getContext().get(UISynchronize.class));
|
|
298 | 300 |
} |
299 | 301 |
|
300 | 302 |
/** |
... | ... | |
839 | 841 |
} |
840 | 842 |
} |
841 | 843 |
|
842 |
public void setGroup(AbstractGroupE4 group) { |
|
843 |
this.group = group; |
|
844 |
} |
|
845 |
|
|
846 | 844 |
public void restoreColor() { |
847 | 845 |
setBackground(backgroundColor); |
848 | 846 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedGroupE4.java | ||
---|---|---|
57 | 57 |
|
58 | 58 |
@Override |
59 | 59 |
protected void createContainers() { |
60 |
this.acceptedContainer = new AcceptedNameContainerE4(getEditor().getTaxon()); |
|
61 |
acceptedContainer.setGroup(this); |
|
60 |
this.acceptedContainer = new AcceptedNameContainerE4(this, getEditor().getTaxon()); |
|
62 | 61 |
|
63 | 62 |
acceptedContainer.createContent(); |
64 | 63 |
|
... | ... | |
74 | 73 |
} |
75 | 74 |
} |
76 | 75 |
|
77 |
public void setAcceptedNameContainer(AcceptedNameContainerE4 acceptedNameContainer) { |
|
78 |
this.acceptedContainer = acceptedNameContainer; |
|
79 |
acceptedContainer.setGroup(this); |
|
80 |
} |
|
81 |
|
|
82 | 76 |
public AcceptedNameContainerE4 getAcceptedNameContainer(){ |
83 | 77 |
return acceptedContainer; |
84 | 78 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedNameContainerE4.java | ||
---|---|---|
16 | 16 |
|
17 | 17 |
public class AcceptedNameContainerE4 extends AbstractGroupedContainerE4<Taxon> { |
18 | 18 |
|
19 |
private AcceptedGroupE4 acceptedGroup; |
|
20 |
|
|
21 |
public AcceptedNameContainerE4(Taxon taxon) { |
|
22 |
super(taxon); |
|
19 |
public AcceptedNameContainerE4(AcceptedGroupE4 group, Taxon taxon) { |
|
20 |
super(group, taxon); |
|
23 | 21 |
} |
24 | 22 |
|
25 | 23 |
@Override |
... | ... | |
35 | 33 |
return AbstractUtility.getFont(Resources.ACCEPTED_TAXON_FONT); |
36 | 34 |
} |
37 | 35 |
|
38 |
public void setGroup(AcceptedGroupE4 group) { |
|
39 |
this.acceptedGroup = group; |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
public AbstractGroupE4 getGroup() { |
|
44 |
return acceptedGroup; |
|
45 |
} |
|
46 |
|
|
47 | 36 |
/** {@inheritDoc} */ |
48 | 37 |
@Override |
49 | 38 |
protected void updateNonEditableInfo() { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/MisapplicationContainerE4.java | ||
---|---|---|
34 | 34 |
TaxonRelationship misapplication; |
35 | 35 |
|
36 | 36 |
public MisapplicationContainerE4(AbstractGroupE4 group, Taxon misappliedName) { |
37 |
super(misappliedName); |
|
37 |
super(group, misappliedName);
|
|
38 | 38 |
|
39 | 39 |
} |
40 | 40 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/SynonymContainerE4.java | ||
---|---|---|
43 | 43 |
* @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object. |
44 | 44 |
*/ |
45 | 45 |
public SynonymContainerE4(AbstractHomotypicalGroupContainerE4 group, Synonym synonym) { |
46 |
super(synonym); |
|
46 |
super(group, synonym);
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
public SynonymContainerE4(AbstractHomotypicalGroupContainerE4 group, Synonym synonym, int indent, Image icon){ |
50 |
super(synonym); |
|
50 |
super(group, synonym);
|
|
51 | 51 |
this.indent = indent; |
52 | 52 |
this.icon = icon; |
53 | 53 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDropTargetListenerE4.java | ||
---|---|---|
4 | 4 |
package eu.etaxonomy.taxeditor.editor.name.e4.dnd; |
5 | 5 |
|
6 | 6 |
import org.eclipse.core.runtime.Assert; |
7 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
7 | 8 |
import org.eclipse.swt.dnd.DND; |
8 | 9 |
import org.eclipse.swt.dnd.DropTargetAdapter; |
9 | 10 |
import org.eclipse.swt.dnd.DropTargetEvent; |
... | ... | |
77 | 78 |
MessagingUtils.warn(getClass(), String.format(Messages.NameEditorDropTargetListener_UNSUCCESSFULL_DROP, taxonBase.getClass(), target)); |
78 | 79 |
dropTargetEvent.detail = DND.DROP_NONE; |
79 | 80 |
} else { |
80 |
AbstractUtility.executeOperation(operation); |
|
81 |
AbstractUtility.executeOperation(operation, target.getContext().get(UISynchronize.class));
|
|
81 | 82 |
} |
82 | 83 |
target.getEditor().getConversationHolder().commit(); |
83 | 84 |
if (!target.equals(EventUtility.getTaxonEditor())){ |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java | ||
---|---|---|
16 | 16 |
import org.apache.log4j.Logger; |
17 | 17 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
18 | 18 |
import org.eclipse.e4.core.di.annotations.Execute; |
19 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
19 | 20 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
20 | 21 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
21 | 22 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
56 | 57 |
@Execute |
57 | 58 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
58 | 59 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
59 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) { |
|
60 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
|
61 |
UISynchronize sync) { |
|
60 | 62 |
|
61 | 63 |
editor = (TaxonNameEditorE4) activePart.getObject(); |
62 | 64 |
|
... | ... | |
96 | 98 |
ChangeSynonymToAcceptedTaxonOperation operation = new ChangeSynonymToAcceptedTaxonOperation(Messages.ChangeSynonymToAcceptedTaxonHandler_CHANGE_SYN_TO_ACC_TAXON, EditorUtil.getUndoContext(), |
97 | 99 |
taxon, newParentNode, synonym, namesInGroup, this, editor, editor.getEditorInput()); //$NON-NLS-1$ |
98 | 100 |
|
99 |
AbstractUtility.executeOperation(operation); |
|
101 |
AbstractUtility.executeOperation(operation, sync);
|
|
100 | 102 |
} |
101 | 103 |
|
102 | 104 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToMisapplicationHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
44 | 45 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
45 | 46 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
46 | 47 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
47 |
MHandledMenuItem menuItem) { |
|
48 |
MHandledMenuItem menuItem, |
|
49 |
UISynchronize sync) { |
|
48 | 50 |
|
49 | 51 |
editor = (TaxonNameEditorE4) activePart.getObject(); |
50 | 52 |
|
... | ... | |
64 | 66 |
} |
65 | 67 |
|
66 | 68 |
|
67 |
AbstractUtility.executeOperation(operation); |
|
69 |
AbstractUtility.executeOperation(operation, sync);
|
|
68 | 70 |
} |
69 | 71 |
|
70 | 72 |
@CanExecute |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToSynonymHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
36 | 37 |
@Execute |
37 | 38 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
38 | 39 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
39 |
MHandledMenuItem menuItem) { |
|
40 |
MHandledMenuItem menuItem, |
|
41 |
UISynchronize sync) { |
|
40 | 42 |
|
41 | 43 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject(); |
42 | 44 |
|
... | ... | |
47 | 49 |
operation = new ChangeConceptToSynonymOperation(menuItem.getLocalizedLabel(), |
48 | 50 |
editor.getUndoContext(), editor.getTaxon(), concept, null, editor); |
49 | 51 |
|
50 |
AbstractUtility.executeOperation(operation); |
|
52 |
AbstractUtility.executeOperation(operation, sync);
|
|
51 | 53 |
|
52 | 54 |
} |
53 | 55 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateHeterotypicSynonymHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
37 | 38 |
|
38 | 39 |
@Execute |
39 | 40 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
40 |
MHandledMenuItem menuItem) { |
|
41 |
MHandledMenuItem menuItem, |
|
42 |
UISynchronize sync) { |
|
41 | 43 |
|
42 | 44 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject(); |
43 | 45 |
|
... | ... | |
46 | 48 |
AbstractPostOperation<?> operation; |
47 | 49 |
operation = new CreateSynonymInNewGroupOperation(menuItem.getLocalizedLabel(), |
48 | 50 |
editor.getUndoContext(), editor.getTaxon(), newSynonymName, editor); |
49 |
AbstractUtility.executeOperation(operation); |
|
51 |
AbstractUtility.executeOperation(operation, sync);
|
|
50 | 52 |
} |
51 | 53 |
|
52 | 54 |
@CanExecute |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateHomotypicSynonymHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
39 | 40 |
|
40 | 41 |
@Execute |
41 | 42 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
42 |
MHandledMenuItem menuItem) { |
|
43 |
MHandledMenuItem menuItem, |
|
44 |
UISynchronize sync) { |
|
43 | 45 |
|
44 | 46 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject(); |
45 | 47 |
Taxon taxon = editor.getTaxon(); |
... | ... | |
49 | 51 |
AbstractPostOperation<?> operation; |
50 | 52 |
operation = new CreateSynonymInExistingHomotypicalGroupOperation(menuItem.getLocalizedLabel(), |
51 | 53 |
editor.getUndoContext(), taxon, group, newSynonymName, editor); |
52 |
AbstractUtility.executeOperation(operation); |
|
54 |
AbstractUtility.executeOperation(operation, sync);
|
|
53 | 55 |
} |
54 | 56 |
|
55 | 57 |
@CanExecute |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateMisapplicationHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
38 | 39 |
|
39 | 40 |
@Execute |
40 | 41 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
41 |
MHandledMenuItem menuItem) { |
|
42 |
MHandledMenuItem menuItem, |
|
43 |
UISynchronize sync) { |
|
42 | 44 |
|
43 | 45 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject(); |
44 | 46 |
|
... | ... | |
50 | 52 |
AbstractPostOperation<?> operation; |
51 | 53 |
operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(), |
52 | 54 |
editor.getUndoContext(), editor.getTaxon(), concept, type, editor); |
53 |
AbstractUtility.executeOperation(operation); |
|
55 |
AbstractUtility.executeOperation(operation, sync);
|
|
54 | 56 |
} |
55 | 57 |
|
56 | 58 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateSynonymInHomotypicalGroupHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
39 | 40 |
@Execute |
40 | 41 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
41 | 42 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
42 |
MHandledMenuItem menuItem) { |
|
43 |
MHandledMenuItem menuItem, |
|
44 |
UISynchronize sync) { |
|
43 | 45 |
|
44 | 46 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject(); |
45 | 47 |
|
... | ... | |
59 | 61 |
|
60 | 62 |
operation = new CreateSynonymInExistingHomotypicalGroupOperation(menuItem.getLocalizedLabel(), editor.getUndoContext(), |
61 | 63 |
editor.getTaxon(), group, newSynonymName, editor); |
62 |
AbstractUtility.executeOperation(operation); |
|
64 |
AbstractUtility.executeOperation(operation, sync);
|
|
63 | 65 |
|
64 | 66 |
} |
65 | 67 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteAllEmptyNamesHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
35 | 36 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
36 | 37 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selectedElement, |
37 | 38 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
38 |
MHandledMenuItem menuItem) { |
|
39 |
MHandledMenuItem menuItem, |
|
40 |
UISynchronize sync) { |
|
39 | 41 |
|
40 | 42 |
editor = (TaxonNameEditorE4) activePart.getObject(); |
41 | 43 |
|
42 | 44 |
for(AbstractGroupedContainerE4 containerWithEmptyName : editor.getEmptyContainers()){ |
43 | 45 |
editor.removeGroup(containerWithEmptyName.getGroup()); |
44 |
doExecute(menuItem.getLocalizedLabel(), shell, editor, containerWithEmptyName.getData()); |
|
46 |
doExecute(menuItem.getLocalizedLabel(), shell, editor, containerWithEmptyName.getData(), sync);
|
|
45 | 47 |
} |
46 | 48 |
|
47 | 49 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteTaxonBaseHandlerE4.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
14 | 14 |
import org.eclipse.e4.core.di.annotations.Execute; |
15 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
15 | 16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
17 | 18 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
53 | 54 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
54 | 55 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
55 | 56 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
56 |
MHandledMenuItem menuItem) { |
|
57 |
MHandledMenuItem menuItem, |
|
58 |
UISynchronize sync) { |
|
57 | 59 |
|
58 | 60 |
editor = (TaxonNameEditorE4) activePart.getObject(); |
59 | 61 |
|
60 |
doExecute(menuItem.getLocalizedLabel(), shell, editor, selection.getFirstElement()); |
|
62 |
doExecute(menuItem.getLocalizedLabel(), shell, editor, selection.getFirstElement(), sync);
|
|
61 | 63 |
|
62 | 64 |
} |
63 | 65 |
|
64 |
protected void doExecute(String commandName, Shell shell, TaxonNameEditorE4 editor, Object selectedElement) { |
|
66 |
protected void doExecute(String commandName, Shell shell, TaxonNameEditorE4 editor, Object selectedElement, |
|
67 |
UISynchronize sync) { |
|
65 | 68 |
AbstractPostOperation operation = null; |
66 | 69 |
|
67 | 70 |
if (selectedElement instanceof TaxonBase){ |
... | ... | |
99 | 102 |
throw new IllegalArgumentException(Messages.DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT); |
100 | 103 |
} |
101 | 104 |
|
102 |
AbstractUtility.executeOperation(operation); |
|
105 |
AbstractUtility.executeOperation(operation, sync);
|
|
103 | 106 |
DeleteResult result = ((DeleteTaxonBaseOperation)operation).getResult(); |
104 | 107 |
if (result != null){ |
105 | 108 |
if (result.isError()){ |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/MoveSynonymToAnotherAcceptedTaxonHandlerE4.java | ||
---|---|---|
9 | 9 |
import org.apache.log4j.Logger; |
10 | 10 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
11 | 11 |
import org.eclipse.e4.core.di.annotations.Execute; |
12 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
12 | 13 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
13 | 14 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
14 | 15 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
40 | 41 |
@Execute |
41 | 42 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
42 | 43 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
43 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) { |
|
44 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
|
45 |
UISynchronize sync) { |
|
44 | 46 |
|
45 | 47 |
editor = (TaxonNameEditorE4) activePart.getObject(); |
46 | 48 |
|
... | ... | |
73 | 75 |
MoveSynonymToAnotherAcceptedTaxonOperationE4 operation = new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.MoveSynonymToAnotherAcceptedTaxonHandler_CHANGE_ACC_TAXON, EditorUtil.getUndoContext(), |
74 | 76 |
synonym.getUuid(), newParentNode.getTaxon(), editor, editor); |
75 | 77 |
|
76 |
AbstractUtility.executeOperation(operation); |
|
78 |
AbstractUtility.executeOperation(operation, sync);
|
|
77 | 79 |
} |
78 | 80 |
} |
79 | 81 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SetBasionymHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
36 | 37 |
@Execute |
37 | 38 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
38 | 39 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
39 |
MHandledMenuItem menuItem) { |
|
40 |
MHandledMenuItem menuItem, |
|
41 |
UISynchronize sync) { |
|
40 | 42 |
|
41 | 43 |
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject(); |
42 | 44 |
|
... | ... | |
46 | 48 |
|
47 | 49 |
operation = new ChangeHomotypicalGroupBasionymOperation(menuItem.getLocalizedLabel(), editor.getUndoContext(), |
48 | 50 |
editor.getTaxon(), selectedTaxonBase, editor); |
49 |
AbstractUtility.executeOperation(operation); |
|
51 |
AbstractUtility.executeOperation(operation, sync);
|
|
50 | 52 |
} |
51 | 53 |
|
52 | 54 |
@CanExecute |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SwapSynonymAndAcceptedHandlerE4.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
15 | 15 |
import org.eclipse.e4.core.di.annotations.Execute; |
16 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
18 | 19 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
49 | 50 |
@Execute |
50 | 51 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
51 | 52 |
@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection, |
52 |
@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, MHandledMenuItem menuItem, EPartService partService) { |
|
53 |
@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, MHandledMenuItem menuItem, EPartService partService, |
|
54 |
UISynchronize sync) { |
|
53 | 55 |
|
54 | 56 |
this.activePart = activePart; |
55 | 57 |
this.partService = partService; |
... | ... | |
66 | 68 |
SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(menuItem.getLocalizedLabel(), |
67 | 69 |
editor.getUndoContext(), editor.getTaxon(), synonym, this, editor.getEditorInput()); |
68 | 70 |
|
69 |
AbstractUtility.executeOperation(operation); |
|
71 |
AbstractUtility.executeOperation(operation, sync);
|
|
70 | 72 |
|
71 | 73 |
} |
72 | 74 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/handler/CreateDescriptionHandler.java | ||
---|---|---|
25 | 25 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4; |
26 | 26 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation; |
27 | 27 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation; |
28 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
29 | 28 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
30 | 29 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
31 | 30 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
... | ... | |
60 | 59 |
Taxon taxon = ((TaxonEditorInput) input).getTaxon(); |
61 | 60 |
try { |
62 | 61 |
operation = createTaxonOperation(event.getCommand().getName(), taxon, postOperationEnabled); |
63 |
AbstractUtility.executeOperation(operation); |
|
64 | 62 |
} catch (NotDefinedException e) { |
65 | 63 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
66 | 64 |
} |
... | ... | |
71 | 69 |
if(viewerInput instanceof SpecimenOrObservationBase<?>){ |
72 | 70 |
try { |
73 | 71 |
operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled); |
74 |
AbstractUtility.executeOperation(operation); |
|
75 | 72 |
} catch (NotDefinedException e) { |
76 | 73 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
77 | 74 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/CreateConceptRelationHandlerE4.java | ||
---|---|---|
17 | 17 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
18 | 18 |
import org.eclipse.e4.core.di.annotations.Execute; |
19 | 19 |
import org.eclipse.e4.core.di.annotations.Optional; |
20 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
20 | 21 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
21 | 22 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
22 | 23 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
48 | 49 |
@Execute |
49 | 50 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
50 | 51 |
@Optional@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, |
51 |
MHandledMenuItem menuItem) { |
|
52 |
MHandledMenuItem menuItem, |
|
53 |
UISynchronize sync) { |
|
52 | 54 |
|
53 | 55 |
String commandId = menuItem.getCommand().getElementId(); |
54 | 56 |
UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".taxonRelationshipType.uuid"); |
... | ... | |
90 | 92 |
|
91 | 93 |
AbstractPostOperation operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(), |
92 | 94 |
undoContext, taxon, relatedConcept, typeInverseContainer, conceptView); |
93 |
AbstractUtility.executeOperation(operation); |
|
95 |
AbstractUtility.executeOperation(operation, sync);
|
|
94 | 96 |
} |
95 | 97 |
} |
96 | 98 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/DeleteConceptRelationHandlerE4.java | ||
---|---|---|
17 | 17 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
18 | 18 |
import org.eclipse.e4.core.di.annotations.Execute; |
19 | 19 |
import org.eclipse.e4.core.di.annotations.Optional; |
20 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
20 | 21 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
21 | 22 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
22 | 23 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
... | ... | |
41 | 42 |
|
42 | 43 |
@Execute |
43 | 44 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
44 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, MMenuItem menuItem) { |
|
45 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, MMenuItem menuItem, |
|
46 |
UISynchronize sync) { |
|
45 | 47 |
|
46 | 48 |
TaxonNameEditorE4 editor = null; |
47 | 49 |
|
... | ... | |
64 | 66 |
//editor should not be null because this is already checked in canExecute |
65 | 67 |
AbstractPostOperation operation = new DeleteConceptRelationOperation(menuItem.getLocalizedLabel(), |
66 | 68 |
editor.getUndoContext(), editor.getTaxon(), relations, conceptView); |
67 |
AbstractUtility.executeOperation(operation); |
|
69 |
AbstractUtility.executeOperation(operation, sync);
|
|
68 | 70 |
} |
69 | 71 |
} |
70 | 72 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateDropListener.java | ||
---|---|---|
11 | 11 |
import org.eclipse.core.runtime.Status; |
12 | 12 |
import org.eclipse.jface.util.LocalSelectionTransfer; |
13 | 13 |
import org.eclipse.jface.viewers.TreeNode; |
14 |
import org.eclipse.jface.viewers.ViewerDropAdapter; |
|
15 | 14 |
import org.eclipse.swt.dnd.DND; |
16 | 15 |
import org.eclipse.swt.dnd.DropTargetEvent; |
17 | 16 |
import org.eclipse.swt.dnd.TransferData; |
... | ... | |
21 | 20 |
import eu.etaxonomy.taxeditor.editor.view.derivate.operation.MoveDerivateOperation; |
22 | 21 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
23 | 22 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
23 |
import eu.etaxonomy.taxeditor.ui.EditViewerDropAdapter; |
|
24 | 24 |
|
25 | 25 |
/** |
26 | 26 |
* @author pplitzner |
27 | 27 |
* @date 18.03.2014 |
28 | 28 |
* |
29 | 29 |
*/ |
30 |
public class DerivateDropListener extends ViewerDropAdapter { |
|
30 |
public class DerivateDropListener extends EditViewerDropAdapter {
|
|
31 | 31 |
|
32 | 32 |
private final DerivateView derivateView; |
33 | 33 |
|
... | ... | |
49 | 49 |
TreeNode draggedNode = EditorUtil.getTreeNodeOfSelection(derivateViewSelection.getSelection()); |
50 | 50 |
if(draggedNode!=null){ |
51 | 51 |
MoveDerivateOperation moveDerivateOperation = new MoveDerivateOperation(String.format(Messages.DerivateDropListener_MOVE_TO, derivateView.getLabelProvider().getDerivateText(draggedNode), derivateView.getLabelProvider().getDerivateText(targetNode)), EditorUtil.getUndoContext(), derivateView, draggedNode, targetNode); |
52 |
return AbstractUtility.executeOperation(moveDerivateOperation).equals(Status.OK_STATUS)?true:false; |
|
52 |
return AbstractUtility.executeOperation(moveDerivateOperation, sync).equals(Status.OK_STATUS)?true:false;
|
|
53 | 53 |
} |
54 | 54 |
} |
55 | 55 |
return false; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java | ||
---|---|---|
17 | 17 |
import javax.inject.Named; |
18 | 18 |
|
19 | 19 |
import org.eclipse.core.runtime.IProgressMonitor; |
20 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
|
21 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
20 | 22 |
import org.eclipse.e4.core.di.annotations.Optional; |
21 | 23 |
import org.eclipse.e4.ui.di.Focus; |
22 | 24 |
import org.eclipse.e4.ui.di.Persist; |
... | ... | |
179 | 181 |
} |
180 | 182 |
|
181 | 183 |
@PostConstruct |
182 |
public void createPartControl(Composite parent, EMenuService menuService) { |
|
184 |
public void createPartControl(Composite parent, EMenuService menuService, |
|
185 |
IEclipseContext context) { |
|
183 | 186 |
if (CdmStore.isActive()){ |
184 | 187 |
if(conversation == null){ |
185 | 188 |
conversation = CdmStore.createConversation(); |
... | ... | |
230 | 233 |
//add drag'n'drop support |
231 | 234 |
Transfer[] transfers = new Transfer[] {LocalSelectionTransfer.getTransfer(),}; |
232 | 235 |
viewer.addDragSupport(dndOperations, transfers, new DerivateDragListener(this)); |
233 |
viewer.addDropSupport(dndOperations, transfers, new DerivateDropListener(this)); |
|
236 |
DerivateDropListener dropListener = new DerivateDropListener(this); |
|
237 |
ContextInjectionFactory.inject(dropListener, context); |
|
238 |
viewer.addDropSupport(dndOperations, transfers, dropListener); |
|
234 | 239 |
} |
235 | 240 |
|
236 | 241 |
public void updateRootEntities() { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java | ||
---|---|---|
13 | 13 |
import java.util.Collection; |
14 | 14 |
|
15 | 15 |
import org.eclipse.jface.viewers.Viewer; |
16 |
import org.eclipse.jface.viewers.ViewerDropAdapter; |
|
17 | 16 |
import org.eclipse.swt.dnd.DND; |
18 | 17 |
import org.eclipse.swt.dnd.TransferData; |
19 | 18 |
|
... | ... | |
24 | 23 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation; |
25 | 24 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
26 | 25 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
26 |
import eu.etaxonomy.taxeditor.ui.EditViewerDropAdapter; |
|
27 | 27 |
|
28 | 28 |
/** |
29 | 29 |
* @author n.hoffmann |
30 | 30 |
* @created Feb 8, 2011 |
31 | 31 |
* @version 1.0 |
32 | 32 |
*/ |
33 |
public class DescriptionElementDropAdapter extends ViewerDropAdapter { |
|
33 |
public class DescriptionElementDropAdapter extends EditViewerDropAdapter {
|
|
34 | 34 |
|
35 | 35 |
private static final String OPERATION_NOT_SUPPORTED_YET = Messages.DescriptionElementDropAdapter_NOT_SUPPORTED; |
36 | 36 |
|
... | ... | |
75 | 75 |
|
76 | 76 |
AbstractPostOperation operation = new MoveDescriptionElementsOperation(Messages.DescriptionElementDropAdapter_MOVE_DESC, EditorUtil.getUndoContext(), target, descriptionElements, isCopy, null); |
77 | 77 |
|
78 |
EditorUtil.executeOperation(operation); |
|
78 |
EditorUtil.executeOperation(operation, sync);
|
|
79 | 79 |
return true; |
80 | 80 |
} |
81 | 81 |
MessagingUtils.warningDialog(OPERATION_NOT_SUPPORTED_YET, this, Messages.DescriptionElementDropAdapter_NOT_SUPPORTED_EMPTY_ELEMENT); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java | ||
---|---|---|
16 | 16 |
|
17 | 17 |
import javax.annotation.PostConstruct; |
18 | 18 |
|
19 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
|
20 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
19 | 21 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
20 | 22 |
import org.eclipse.e4.ui.services.EMenuService; |
21 | 23 |
import org.eclipse.jface.action.Action; |
... | ... | |
88 | 90 |
private DescriptiveContentProvider provider; |
89 | 91 |
|
90 | 92 |
@PostConstruct |
91 |
public void create(Composite parent, EMenuService menuService, MPart thisPart) { |
|
93 |
public void create(Composite parent, EMenuService menuService, MPart thisPart, |
|
94 |
IEclipseContext context) { |
|
92 | 95 |
TreeViewer treeViewer = new TreeViewer(new Tree(parent, SWT.H_SCROLL |
93 | 96 |
| SWT.V_SCROLL | SWT.FULL_SELECTION)); |
94 | 97 |
|
... | ... | |
102 | 105 |
Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() }; |
103 | 106 |
treeViewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener( |
104 | 107 |
this)); |
108 |
DescriptionElementDropAdapter dropListener = new DescriptionElementDropAdapter(viewer); |
|
109 |
ContextInjectionFactory.inject(dropListener, context); |
|
105 | 110 |
treeViewer.addDropSupport(dndOperations, transfers, |
106 |
new DescriptionElementDropAdapter(viewer));
|
|
111 |
dropListener);
|
|
107 | 112 |
|
108 | 113 |
viewer = treeViewer; |
109 | 114 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/CreateDescriptionElementHandlerE4.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import org.eclipse.e4.core.di.annotations.Execute; |
17 | 17 |
import org.eclipse.e4.core.di.annotations.Optional; |
18 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
18 | 19 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
19 | 20 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
20 | 21 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
44 | 45 |
|
45 | 46 |
@Execute |
46 | 47 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
47 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object object, MHandledMenuItem menuItem) { |
|
48 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object object, MHandledMenuItem menuItem, |
|
49 |
UISynchronize sync) { |
|
48 | 50 |
|
49 | 51 |
String commandId = menuItem.getCommand().getElementId(); |
50 | 52 |
UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".feature.uuid"); |
... | ... | |
66 | 68 |
MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description")); //$NON-NLS-1$ |
67 | 69 |
return; |
68 | 70 |
} |
69 |
AbstractPostOperation operation = operationCreationInstance(menuItem.getLocalizedLabel(), feature, description, factualDataPart); |
|
71 |
AbstractPostOperation operation = operationCreationInstance(menuItem.getLocalizedLabel(), feature, description, |
|
72 |
factualDataPart); |
|
70 | 73 |
// TODO use undo context specific to editor |
71 |
AbstractUtility.executeOperation(operation); |
|
74 |
AbstractUtility.executeOperation(operation, sync);
|
|
72 | 75 |
} |
73 | 76 |
|
74 | 77 |
/** |
... | ... | |
80 | 83 |
* @param postOperationEnabled |
81 | 84 |
* @return |
82 | 85 |
*/ |
83 |
protected AbstractPostOperation operationCreationInstance(String label, Feature feature, DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) { |
|
84 |
return new CreateDescriptionElementOperation(label, EditorUtil.getUndoContext(), description, feature, postOperationEnabled); |
|
85 |
} |
|
86 |
protected AbstractPostOperation operationCreationInstance(String label, Feature feature, |
|
87 |
DescriptionBase<?> description, IPostOperationEnabled postOperationEnabled) { |
|
88 |
return new CreateDescriptionElementOperation(label, EditorUtil.getUndoContext(), description, feature, |
|
89 |
postOperationEnabled); |
|
90 |
} |
|
86 | 91 |
|
87 | 92 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/CreateDescriptionHandlerE4.java | ||
---|---|---|
11 | 11 |
import javax.inject.Named; |
12 | 12 |
|
13 | 13 |
import org.eclipse.e4.core.di.annotations.Execute; |
14 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
14 | 15 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
15 | 16 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
16 | 17 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
36 | 37 |
public class CreateDescriptionHandlerE4 { |
37 | 38 |
|
38 | 39 |
@Execute |
39 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, MMenuItem menuItem) { |
|
40 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, MMenuItem menuItem, |
|
41 |
UISynchronize sync) { |
|
40 | 42 |
|
41 | 43 |
FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject(); |
42 | 44 |
|
... | ... | |
47 | 49 |
} |
48 | 50 |
if(viewerInput instanceof SpecimenOrObservationBase<?>){ |
49 | 51 |
operation = new CreateSpecimenDescriptionOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, factualDataPart); |
50 |
AbstractUtility.executeOperation(operation); |
|
52 |
AbstractUtility.executeOperation(operation, sync);
|
|
51 | 53 |
} |
52 | 54 |
if(viewerInput instanceof TaxonBase){ |
53 | 55 |
operation = createTaxonOperation(menuItem.getLocalizedLabel(), (Taxon) viewerInput, factualDataPart); |
54 |
AbstractUtility.executeOperation(operation); |
|
56 |
AbstractUtility.executeOperation(operation, sync);
|
|
55 | 57 |
|
56 | 58 |
} |
57 | 59 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DeleteHandlerE4.java | ||
---|---|---|
18 | 18 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
19 | 19 |
import org.eclipse.e4.core.di.annotations.Execute; |
20 | 20 |
import org.eclipse.e4.core.di.annotations.Optional; |
21 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
21 | 22 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
22 | 23 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
23 | 24 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
... | ... | |
60 | 61 |
@Execute |
61 | 62 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
62 | 63 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, |
63 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MMenuItem menuItem) { |
|
64 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MMenuItem menuItem, |
|
65 |
UISynchronize sync) { |
|
64 | 66 |
|
65 | 67 |
FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject(); |
66 | 68 |
|
... | ... | |
141 | 143 |
|
142 | 144 |
// execute all cumulated operations |
143 | 145 |
for(AbstractPostOperation<?> operation : operations){ |
144 |
AbstractUtility.executeOperation(operation); |
|
146 |
AbstractUtility.executeOperation(operation, sync);
|
|
145 | 147 |
} |
146 | 148 |
} |
147 | 149 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java | ||
---|---|---|
18 | 18 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
19 | 19 |
import org.eclipse.e4.core.di.annotations.Execute; |
20 | 20 |
import org.eclipse.e4.core.di.annotations.Optional; |
21 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
21 | 22 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
22 | 23 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
23 | 24 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
... | ... | |
65 | 66 |
@Execute |
66 | 67 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
67 | 68 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, |
68 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MMenuItem menuItem) { |
|
69 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MMenuItem menuItem, |
|
70 |
UISynchronize sync) { |
|
69 | 71 |
|
70 | 72 |
FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject(); |
71 | 73 |
Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart()); |
... | ... | |
131 | 133 |
menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), |
132 | 134 |
targetTaxon.getUuid(), moveMessage, elements, false, this); |
133 | 135 |
|
134 |
AbstractUtility.executeOperation(operation); |
|
136 |
AbstractUtility.executeOperation(operation, sync);
|
|
135 | 137 |
} |
136 | 138 |
} |
137 | 139 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java | ||
---|---|---|
12 | 12 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
13 | 13 |
import org.eclipse.e4.core.di.annotations.Execute; |
14 | 14 |
import org.eclipse.e4.core.di.annotations.Optional; |
15 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
15 | 16 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
16 | 17 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
... | ... | |
56 | 57 |
@Execute |
57 | 58 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
58 | 59 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) Object selection, |
59 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MMenuItem menuItem) { |
|
60 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, MMenuItem menuItem, |
|
61 |
UISynchronize sync) { |
|
60 | 62 |
|
61 | 63 |
|
62 | 64 |
FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject(); |
... | ... | |
118 | 120 |
this, |
119 | 121 |
editor, |
120 | 122 |
editor.getEditorInput()); |
121 |
AbstractUtility.executeOperation(operation); |
|
123 |
AbstractUtility.executeOperation(operation, sync);
|
|
122 | 124 |
} |
123 | 125 |
|
124 | 126 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java | ||
---|---|---|
25 | 25 |
import eu.etaxonomy.cdm.model.description.Feature; |
26 | 26 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
27 | 27 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation; |
28 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
29 | 28 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
30 | 29 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
31 | 30 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
... | ... | |
74 | 73 |
try { |
75 | 74 |
// TODO use undo context specific to editor |
76 | 75 |
operation = operationCreationInstance(event.getCommand().getName(), event, description, postOperationEnabled); |
77 |
AbstractUtility.executeOperation(operation); |
|
78 | 76 |
} catch (NotDefinedException e) { |
79 | 77 |
MessagingUtils.warn(getClass(), "Command name not set"); //$NON-NLS-1$ |
80 | 78 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java | ||
---|---|---|
22 | 22 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart; |
23 | 23 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateSpecimenDescriptionOperation; |
24 | 24 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation; |
25 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
26 | 25 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
27 | 26 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
28 | 27 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
... | ... | |
52 | 51 |
if(viewerInput instanceof SpecimenOrObservationBase<?>){ |
53 | 52 |
try { |
54 | 53 |
operation = new CreateSpecimenDescriptionOperation(event.getCommand().getName(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, postOperationEnabled); |
55 |
AbstractUtility.executeOperation(operation); |
|
56 | 54 |
} catch (NotDefinedException e) { |
57 | 55 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
58 | 56 |
} |
... | ... | |
60 | 58 |
if(viewerInput instanceof TaxonBase){ |
61 | 59 |
try{ |
62 | 60 |
operation = createTaxonOperation(event.getCommand().getName(), (Taxon) viewerInput, postOperationEnabled); |
63 |
AbstractUtility.executeOperation(operation); |
|
64 | 61 |
} catch (NotDefinedException e) { |
65 | 62 |
MessagingUtils.warn(getClass(), "Command name not set."); //$NON-NLS-1$ |
66 | 63 |
} |
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 |
} |
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 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/CreateMediaHandler.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
import org.eclipse.e4.core.di.annotations.Execute; |
9 | 9 |
import org.eclipse.e4.core.di.annotations.Optional; |
10 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
10 | 11 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
11 | 12 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
12 | 13 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
28 | 29 |
|
29 | 30 |
@Execute |
30 | 31 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
31 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) DescriptionBase description, MMenuItem menuItem) { |
|
32 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION) DescriptionBase description, MMenuItem menuItem, |
|
33 |
UISynchronize sync) { |
|
32 | 34 |
|
33 | 35 |
MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject(); |
34 | 36 |
|
... | ... | |
37 | 39 |
// TODO use undo context specific to editor |
38 | 40 |
operation = new AddMediaToImageGalleryOperation(menuItem.getLocalizedLabel(), |
39 | 41 |
EditorUtil.getUndoContext(), description, mediaView); |
40 |
AbstractUtility.executeOperation(operation); |
|
42 |
AbstractUtility.executeOperation(operation, sync);
|
|
41 | 43 |
} |
42 | 44 |
} |
43 | 45 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
import org.eclipse.core.runtime.IStatus; |
9 | 9 |
import org.eclipse.e4.core.di.annotations.Execute; |
10 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
10 | 11 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
11 | 12 |
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem; |
12 | 13 |
import org.eclipse.e4.ui.services.IServiceConstants; |
... | ... | |
27 | 28 |
import eu.etaxonomy.cdm.model.media.Media; |
28 | 29 |
import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput; |
29 | 30 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
30 |
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput; |
|
31 | 31 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
32 | 32 |
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView; |
33 | 33 |
import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4; |
... | ... | |
49 | 49 |
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart, |
50 | 50 |
@Named(IServiceConstants.ACTIVE_SELECTION) Media media, |
51 | 51 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
52 |
MMenuItem menuItem) { |
Also available in: Unified diff
ref #6925 Inject context into operations to allow sync/async execution