- private Map<Command, String> getEnabledCommands(Map<String, String> availableViewers) {
- Map<Command, String> enabledCommands = new HashMap<Command, String>();
- for(Entry<String, String> entry:availableViewers.entrySet()){
- final String commandId = entry.getKey();
- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- Command command = commandService.getCommand(commandId);
- if(command.isEnabled()){
- enabledCommands.put(command, entry.getValue());
- }
- }
- return enabledCommands;
- }
-