- private static void openInBulkEditor(ICdmBase selectedObject) {
- 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()){
- Map<String, UUID> params = new HashMap<String, UUID>();
- params.put(openInBulkEditorCommand+".uuid", selectedObject.getUuid()); //$NON-NLS-1$
- ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, params);
- try {
- if(parameterizedCommand!=null){
- handlerService.executeCommand(parameterizedCommand, null);
- return;
- }
- else{
- handlerService.executeCommand(command.getId(), null);
- return;
- }
- } catch (NotDefinedException nde) {
- throw new RuntimeException("Could not find open command: " + command.getId()); //$NON-NLS-1$
- } catch (Exception exception) {
- MessagingUtils.error(NavigationUtil.class, "An exception occured while trying to execute "+command.getId(), exception); //$NON-NLS-1$
- }
- }
- }
-