- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
-
- Command command = commandService.getCommand(commandId);
- if(command.isEnabled()) {
- IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
- Map<String, UUID> params = new HashMap<String, UUID>();
- if(selectedObject instanceof ICdmBase){
- params.put(commandId+".uuid", ((ICdmBase) selectedObject).getUuid());
- }
- ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, params);
- try {
- handlerService.executeCommand(parameterizedCommand, null);
- } catch (NotDefinedException nde) {
- throw new RuntimeException("Could not find open command: " + commandId);
- } catch (Exception exception) {
- MessagingUtils.error(getClass(), "An exception occured while trying execute "+commandId, exception);
- }
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
+ IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ Map<String, UUID> params = new HashMap<String, UUID>();
+ if(selectedObject instanceof ICdmBase){
+ params.put(command.getId()+".uuid", ((ICdmBase) selectedObject).getUuid());
+ }
+ ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, params);
+ try {
+ handlerService.executeCommand(parameterizedCommand, null);
+ } catch (NotDefinedException nde) {
+ throw new RuntimeException("Could not find open command: " + command.getId());
+ } catch (Exception exception) {
+ MessagingUtils.error(getClass(), "An exception occured while trying execute "+command.getId(), exception);