Revision e3a4a3ff
Added by Andreas Müller almost 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeSynonymToAcceptedTaxonHandler.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
28 | 28 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
29 | 29 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
30 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
30 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
31 | 31 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
32 | 32 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
... | ... | |
47 | 47 |
* |
48 | 48 |
* @author n.hoffmann |
49 | 49 |
* @created 21.04.2009 |
50 |
* @version 1.0 |
|
51 | 50 |
*/ |
52 | 51 |
public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled { |
53 | 52 |
private static final Logger logger = Logger |
... | ... | |
85 | 84 |
|
86 | 85 |
TaxonNode parentNode = (TaxonNode) HibernateProxyHelper.deproxy(((TaxonEditorInput) input).getTaxonNode().getParent()); |
87 | 86 |
|
88 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
87 |
List<UUID> excludeTaxa = new ArrayList<>(); |
|
89 | 88 |
//excludeTaxa.add(taxon.getUuid());//there are some cases where the accepted taxon should be the parent of the new created accepted taxon |
90 | 89 |
|
91 | 90 |
TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), Messages.ChangeSynonymToAcceptedTaxonHandler_SELECT_PARENT, null, null, ((TaxonEditorInput) input).getTaxonNode().getClassification()); |
... | ... | |
96 | 95 |
// TODO get synonyms from homotypical group and add them as homotypic synonyms to new accepted taxon |
97 | 96 |
// apply confirmation dialog |
98 | 97 |
HomotypicalGroup group = synonym.getHomotypicGroup(); |
99 |
Set<TaxonNameBase> namesInGroup = group.getTypifiedNames();
|
|
98 |
Set<TaxonName> namesInGroup = group.getTypifiedNames(); |
|
100 | 99 |
// FIXME with this implementation we can not create a taxonNode that is a direct child of the classification node |
101 | 100 |
AbstractPostOperation operation = new ChangeSynonymToAcceptedTaxonOperation(Messages.ChangeSynonymToAcceptedTaxonHandler_CHANGE_SYN_TO_ACC_TAXON, EditorUtil.getUndoContext(), |
102 | 101 |
taxon, newParentNode, synonym, namesInGroup, this, editor, (ICdmEntitySessionEnabled)editor.getEditorInput()); //$NON-NLS-1$ |
... | ... | |
107 | 106 |
return null; |
108 | 107 |
} |
109 | 108 |
|
110 |
/* (non-Javadoc) |
|
111 |
* @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase) |
|
112 |
*/ |
|
113 | 109 |
/** {@inheritDoc} */ |
114 | 110 |
@Override |
115 | 111 |
public boolean postOperation(CdmBase objectAffectedByOperation) { |
Also available in: Unified diff
ref #6446 merge taxon name subclasses in TaxEditor