Revision 62d0d2ff
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingChangeAcceptedTaxonToSynonymOperation.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
24 | 24 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
25 | 25 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
26 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
27 | 26 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
28 | 27 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
29 | 28 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4; |
... | ... | |
57 | 56 |
super(LABEL, Action.Update, source, async, partService, activePart, application); |
58 | 57 |
this.oldTaxonNodeUuids.addAll(oldTaxonNodeUuids); |
59 | 58 |
this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid; |
60 |
|
|
59 |
|
|
61 | 60 |
} |
62 |
|
|
61 |
|
|
63 | 62 |
/** |
64 | 63 |
* @param label |
65 | 64 |
*/ |
... | ... | |
74 | 73 |
this.oldTaxonNodeUuids.add(oldTaxonNodeUuid); |
75 | 74 |
this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid; |
76 | 75 |
} |
77 |
|
|
76 |
|
|
78 | 77 |
/** |
79 | 78 |
* @param label |
80 | 79 |
*/ |
... | ... | |
92 | 91 |
*/ |
93 | 92 |
@Override |
94 | 93 |
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception { |
95 |
|
|
94 |
|
|
96 | 95 |
if (this.oldTaxonNodeUuids.size() == 1){ |
97 | 96 |
updateResult = CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNodeUuids.iterator().next(), |
98 | 97 |
newAcceptedTaxonNodeUuid, |
... | ... | |
108 | 107 |
} |
109 | 108 |
updateNameEditor(); |
110 | 109 |
return updateResult; |
111 |
|
|
110 |
|
|
112 | 111 |
} |
113 |
|
|
112 |
|
|
114 | 113 |
private void updateNameEditor(){ |
115 | 114 |
if (partService != null){ |
116 | 115 |
Display.getDefault().asyncExec(new Runnable() { |
117 |
public void run() { |
|
116 |
|
|
117 |
@Override |
|
118 |
public void run() { |
|
118 | 119 |
for (MPart part : partService.getParts()){ |
119 | 120 |
Object object = part.getObject(); |
121 |
boolean setFocus = false; |
|
122 |
if (part == activePart){ |
|
123 |
setFocus = true; |
|
124 |
} |
|
120 | 125 |
if (object instanceof TaxonNameEditorE4){ |
121 | 126 |
Set<TaxonNode> nodes = ((TaxonNameEditorE4)object).getTaxon().getTaxonNodes(); |
122 | 127 |
for (TaxonNode node: nodes){ |
123 | 128 |
if (node.getTaxon().getUuid().equals(newAcceptedTaxonNodeUuid)){ |
124 |
EditorUtil.updateEditor(node, partService, application);
|
|
129 |
EditorUtil.updateEditor(node, (TaxonNameEditorE4)object);
|
|
125 | 130 |
} |
126 |
|
|
131 |
|
|
127 | 132 |
} |
128 | 133 |
} |
129 |
}
|
|
134 |
} |
|
130 | 135 |
} |
131 | 136 |
}); |
132 | 137 |
} |
Also available in: Unified diff
ref #7065: instead of creating new taxoneditorInput reopen the name editor