Revision 81783422
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionElementsOperation.java | ||
---|---|---|
19 | 19 |
import org.eclipse.core.runtime.IAdaptable; |
20 | 20 |
import org.eclipse.core.runtime.IProgressMonitor; |
21 | 21 |
import org.eclipse.core.runtime.IStatus; |
22 |
import org.eclipse.e4.ui.di.UISynchronize; |
|
22 | 23 |
|
23 | 24 |
import eu.etaxonomy.cdm.api.service.IDescriptionService; |
24 | 25 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
... | ... | |
41 | 42 |
private UUID targetTaxonUuid; |
42 | 43 |
private String moveMessage; |
43 | 44 |
private boolean isCopy; |
45 |
private UISynchronize sync; |
|
44 | 46 |
|
45 | 47 |
/** |
46 | 48 |
* |
... | ... | |
54 | 56 |
public MoveDescriptionElementsOperation(String label, |
55 | 57 |
IUndoContext undoContext, DescriptionBase targetDescription, |
56 | 58 |
Collection<DescriptionElementBase> descriptionElements, boolean isCopy, |
57 |
IPostOperationEnabled postOperationEnabled) { |
|
59 |
IPostOperationEnabled postOperationEnabled, UISynchronize sync) {
|
|
58 | 60 |
super(label, undoContext, postOperationEnabled); |
59 | 61 |
this.targetDescription = targetDescription; |
60 | 62 |
this.descriptionElements = descriptionElements; |
61 | 63 |
this.isCopy = isCopy; |
62 |
|
|
64 |
this.sync = sync; |
|
63 | 65 |
service = CdmStore.getService(IDescriptionService.class); |
64 | 66 |
} |
65 | 67 |
|
66 | 68 |
public MoveDescriptionElementsOperation(String label, |
67 | 69 |
IUndoContext undoContext, UUID targetTaxonUuid,String moveMessage, |
68 | 70 |
Collection<DescriptionElementBase> descriptionElements, boolean isCopy, |
69 |
IPostOperationEnabled postOperationEnabled) { |
|
71 |
IPostOperationEnabled postOperationEnabled, UISynchronize sync) {
|
|
70 | 72 |
super(label, undoContext, postOperationEnabled); |
71 | 73 |
this.targetTaxonUuid = targetTaxonUuid; |
72 | 74 |
this.descriptionElements = descriptionElements; |
73 | 75 |
this.moveMessage = moveMessage; |
74 | 76 |
this.isCopy = isCopy; |
75 |
|
|
77 |
this.sync = sync; |
|
76 | 78 |
service = CdmStore.getService(IDescriptionService.class); |
77 | 79 |
} |
78 | 80 |
|
... | ... | |
87 | 89 |
for(DescriptionElementBase deBase : descriptionElements) { |
88 | 90 |
descriptionElementsUuid.add(deBase.getUuid()); |
89 | 91 |
} |
90 |
UpdateResult result;
|
|
92 |
UpdateResult result; |
|
91 | 93 |
if(targetDescription == null){ |
92 | 94 |
result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetTaxonUuid, moveMessage, isCopy); |
93 | 95 |
|
94 | 96 |
} else { |
95 | 97 |
UUID targetDescriptionUuid = targetDescription.getUuid(); |
96 | 98 |
result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetDescriptionUuid, isCopy); |
97 |
|
|
99 |
|
|
98 | 100 |
} |
99 | 101 |
return postExecute(targetDescription); |
100 | 102 |
} |
Also available in: Unified diff
some smaller changes for drag & drop of factual data