List<UUID> excludeTaxa = new ArrayList<UUID>();
excludeTaxa.add(oldParent.getUuid());
-
- TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), Messages.MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON, excludeTaxa, null, ((TaxonEditorInput)input).getTaxonNode().getClassification());
+
+ TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), Messages.MoveSynonymToAnotherAcceptedTaxonHandler_SELECT_ACC_TAXON, excludeTaxa, ((TaxonEditorInput)input).getTaxonNode(), ((TaxonEditorInput)input).getTaxonNode().getClassification());
if(newParentNode!=null){
MoveSynonymToAnotherAcceptedTaxonOperation operation = new MoveSynonymToAnotherAcceptedTaxonOperation(Messages.MoveSynonymToAnotherAcceptedTaxonHandler_CHANGE_ACC_TAXON, EditorUtil.getUndoContext(),
import org.eclipse.ui.handlers.HandlerUtil;
import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
-import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
.getLogger(RemotingChangeAcceptedTaxonToSynonymHandler.class);
- private ITaxonTreeNode oldTaxonNode;
+ private TaxonNode oldTaxonNode;
/**
* @param label
// check that selected object is a taxon node
Object obj = selection.iterator().next();
- if(obj instanceof ITaxonTreeNode) {
- oldTaxonNode = (ITaxonTreeNode)obj;
+ if(obj instanceof TaxonNode) {
+ oldTaxonNode = (TaxonNode)obj;
} else {
return new Status(IStatus.ERROR,
"unknown", //$NON-NLS-1$
TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
}
// check that the source taxon node does not have children
- if(((TaxonNode)oldTaxonNode).getCountChildren() > 0) {
+ if(oldTaxonNode.getCountChildren() > 0) {
return new Status(IStatus.ERROR,
"unknown", //$NON-NLS-1$
TaxonNavigatorLabels.SOURCE_TAXON_HAS_CHILDREN_MESSAGE);
}
// check if corresponding name editor is closed
- boolean editorClosed = NavigatorHandlerUtils.closeObsoleteEditor(event, (TaxonNode) oldTaxonNode);
+ boolean editorClosed = NavigatorHandlerUtils.closeObsoleteEditor(event, oldTaxonNode);
if(editorClosed != true) {
return new Status(IStatus.ERROR,
"unknown", //$NON-NLS-1$
@Override
public AbstractOperation prepareOperation(ExecutionEvent event) {
List<UUID> excludeTaxa = new ArrayList<UUID>();
- excludeTaxa.add(((TaxonNode)oldTaxonNode).getTaxon().getUuid());
+ excludeTaxa.add(oldTaxonNode.getTaxon().getUuid());
TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
new ConversationHolderMock(),
Messages.RemotingChangeAcceptedTaxonToSynonymHandler_CHOOSE_TAXON,
excludeTaxa,
- null,
- ((TaxonNode)oldTaxonNode).getClassification());
+ oldTaxonNode,
+ oldTaxonNode.getClassification());
if (newAcceptedTaxonNode == null) {
return null;