import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.IHandlerService;
import eu.etaxonomy.cdm.model.common.ICdmBase;
String commandId = command.getId();
params.put(commandId+".uuid", ((ICdmBase) input).getUuid());
- //build the parameterized command
- ParameterizedCommand pc = ParameterizedCommand.generateCommand(command, params);
+ if(command.isEnabled()) {
+
+ //build the parameterized command
+ ParameterizedCommand pc = ParameterizedCommand.generateCommand(command, params);
- if(command.isEnabled()) {
IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
try {
- handlerService.executeCommand(pc, null);
+ if(pc!=null){
+ handlerService.executeCommand(pc, null);
+ }
+ else{
+ handlerService.executeCommand(commandId, null);
+ }
} catch (NotDefinedException nde) {
throw new RuntimeException("Could not find open command: " + commandId);
} catch (Exception exception) {