Revision 4aa3c52a
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RemotingChangeAcceptedTaxonToSynonymHandlerE4.java | ||
---|---|---|
23 | 23 |
import org.eclipse.jface.viewers.TreeSelection; |
24 | 24 |
import org.eclipse.swt.widgets.Shell; |
25 | 25 |
|
26 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
|
26 | 27 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
27 | 28 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
28 | 29 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
... | ... | |
69 | 70 |
|
70 | 71 |
// check that selected object is a taxon node |
71 | 72 |
Iterator it = selection.iterator(); |
73 |
Classification nextClassification; |
|
74 |
oldTaxonNodes = new HashSet<>(); |
|
72 | 75 |
while(it.hasNext()){ |
73 | 76 |
Object obj = it.next(); |
74 |
if(obj instanceof TaxonNode && ((TaxonNode)obj).hasTaxon()) {
|
|
77 |
if(obj instanceof TaxonNode && ((TaxonNode)obj).hasTaxon()) {
|
|
75 | 78 |
oldTaxonNodes.add((TaxonNode)obj); |
79 |
nextClassification = HibernateProxyHelper.deproxy(((TaxonNode)obj).getClassification(), Classification.class); |
|
76 | 80 |
if (classification == null){ |
77 |
classification = ((TaxonNode)obj).getClassification();
|
|
78 |
}else if (classification != ((TaxonNode)obj).getClassification()){
|
|
81 |
classification = nextClassification;
|
|
82 |
}else if (!classification.equals(nextClassification)){
|
|
79 | 83 |
return new Status(IStatus.ERROR, |
80 | 84 |
"unknown", //$NON-NLS-1$ |
81 | 85 |
TaxonNavigatorLabels.ACCEPTED_TAXA_NEED_TO_BE_FROM_SAME_CLASSIFICATION); |
... | ... | |
131 | 135 |
new RemotingChangeAcceptedTaxonToSynonymOperation(getTrigger(), |
132 | 136 |
false, |
133 | 137 |
nodeUuids, |
134 |
newAcceptedTaxonNode.getUuid()); |
|
138 |
newAcceptedTaxonNode.getUuid(), partService, activePart, application);
|
|
135 | 139 |
|
136 | 140 |
return rcattso; |
137 | 141 |
} |
Also available in: Unified diff
improve name editor update for navigator operations