getOperationSupport().getUndoContext();
}
- /**
- * Returns the selected taxon for referencing in context menus
- *
- * @param event
- * @return
- */
- public static CdmBase getCurrentSelection(ExecutionEvent event){
-
- ISelection menuSelection = HandlerUtil.getActiveMenuSelection(event);
-
- // The selection should always be a tree selection since we are in the
- // taxonomic tree view. Just in case this will be used in another spot.
- if(menuSelection instanceof TreeSelection){
- CdmBase cdmBase = (CdmBase) ((TreeSelection) menuSelection).getFirstElement();
- logger.debug("Selected cdmBase object: " + cdmBase);
- return cdmBase;
- }
- return null;
- }
-
public static IUndoContext getUndoContext() {
// FIXME this has to be more specific. Every widget has to have its own undo context
// return IOperationHistory.GLOBAL_UNDO_CONTEXT;
if(taxonNodes.size() == 1){
openEditor(taxonNodes.iterator().next());
- }else{
+ }else if(taxonNodes.size() > 1){
// FIXME implement a dialog that shows all possible taxa and let the user choose which he wants to open.
- warningDialog("Not implemented yet", "The accepted taxon is either in multiple taxonomic views or the synonym has" +
- " more than one accepted taxon. This case is not handled yet by the software.");
+ warningDialog("Not implemented yet", "The accepted taxon is in multiple taxonomic trees. We currently do not know which one you want to open." +
+ " This case is not handled yet by the software.");
+ }else if(taxonNodes.size() == 0){
+ // this is an undesired state
+ warningDialog("Incorrect state", "The accepted taxon is not in a taxonomic view. This should not have happened.");
}
}