1 |
1 |
package eu.etaxonomy.taxeditor.editor.name.e4.operation;
|
2 |
2 |
|
3 |
3 |
import java.util.ArrayList;
|
|
4 |
import java.util.HashSet;
|
4 |
5 |
import java.util.List;
|
|
6 |
import java.util.Set;
|
5 |
7 |
import java.util.UUID;
|
6 |
8 |
|
7 |
9 |
import org.eclipse.core.commands.ExecutionException;
|
... | ... | |
16 |
18 |
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
|
17 |
19 |
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
18 |
20 |
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
|
21 |
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
19 |
22 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
|
20 |
23 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
21 |
24 |
import eu.etaxonomy.taxeditor.store.CdmStore;
|
... | ... | |
51 |
54 |
monitor.worked(20);
|
52 |
55 |
|
53 |
56 |
// Switch groups
|
54 |
|
|
55 |
|
monitor.worked(40);
|
|
57 |
monitor.beginTask("Move synonym to another taxon", 40);
|
|
58 |
Taxon oldAccepted = synonym.getAcceptedTaxon();
|
56 |
59 |
|
57 |
60 |
conversationEnabled.getConversationHolder().commit();
|
58 |
|
|
|
61 |
UpdateResult result = null;
|
59 |
62 |
try {
|
60 |
|
UpdateResult result = CdmStore.getService(ITaxonService.class).moveSynonymToAnotherTaxon(synonym,
|
|
63 |
result = CdmStore.getService(ITaxonService.class).moveSynonymToAnotherTaxon(synonym,
|
61 |
64 |
this.element.getUuid(),
|
62 |
65 |
true,
|
63 |
66 |
synonym.getType(),
|
... | ... | |
68 |
71 |
// TODO Auto-generated catch block
|
69 |
72 |
e.printStackTrace();
|
70 |
73 |
}
|
71 |
|
conversationEnabled.getConversationHolder().commit();
|
|
74 |
// conversationEnabled.getConversationHolder().commit();
|
72 |
75 |
|
|
76 |
monitor.worked(40);
|
73 |
77 |
// Redraw editor if it exists
|
|
78 |
Set<Taxon> taxa = new HashSet<>();
|
|
79 |
taxa.add(synonym.getAcceptedTaxon());
|
|
80 |
taxa.add(oldAccepted);
|
|
81 |
|
|
82 |
EditorUtil.updateNameEditors(taxa);
|
|
83 |
// ((TaxonNameEditorE4)EventUtility.getTaxonEditor()).getConversationHolder().commit();
|
|
84 |
|
|
85 |
|
74 |
86 |
return postExecute(null);
|
75 |
87 |
}
|
76 |
88 |
|
code cleaning