UUID entityUuid = selectedObject.getUuid();
try {
if(selectedObject instanceof Classification){
- NewClassificationWizard classificationWizard = new NewClassificationWizard();
- classificationWizard.init(null, null);
- classificationWizard.setEntity((Classification) selectedObject);
- WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), classificationWizard);
- dialog.open();
}
else if(selectedObject instanceof TaxonNode){
- EditorUtil.openTaxonNode(entityUuid);
+ TaxonNode taxonNode = (TaxonNode)selectedObject;
+ Classification classification = taxonNode.getClassification();
+ if(classification!=null && classification.getRootNode().equals(taxonNode)){
+ NewClassificationWizard classificationWizard = new NewClassificationWizard();
+ classificationWizard.init(null, null);
+ classificationWizard.setEntity(classification);
+ WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), classificationWizard);
+ dialog.open();
+ }
+ else{
+ EditorUtil.openTaxonNode(entityUuid);
+ }
}else if(selectedObject instanceof TaxonBase){
TaxonBase taxonBase = (TaxonBase)selectedObject;
if(taxonBase.isOrphaned()){
}
private static void openInBulkEditor(ICdmBase selectedObject) {
- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
+ IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class);
String openInBulkEditorCommand = "eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity"; //$NON-NLS-1$
Command command = commandService.getCommand(openInBulkEditorCommand);
if(command.isDefined()){