@Override public String getSortLabel() { try { return command.getName(); } catch (NotDefinedException e) { return command.toString(); } }
stringBuffer.newLine(); stringBuffer.write('\t'); stringBuffer.write(command==null?"":command.toString()); //$NON-NLS-1$ stringBuffer.write(','); stringBuffer.newLine();
stringBuffer.newLine(); stringBuffer.write('\t'); stringBuffer.write(command==null?"":command.toString()); //$NON-NLS-1$ stringBuffer.write(','); stringBuffer.newLine();
stringBuffer.newLine(); stringBuffer.write('\t'); stringBuffer.write(command==null?"":command.toString()); //$NON-NLS-1$ stringBuffer.write(','); stringBuffer.newLine();
/** * Returns a formatted string describes this command. * * @return a description of the command of this element * @since 3.6 */ public String getCommand() { final StringBuilder label = new StringBuilder(); try { Command nestedCommand = command.getCommand(); label.append(command.getName()); if (nestedCommand != null && nestedCommand.getDescription() != null && nestedCommand.getDescription().length() != 0) { label.append(separator).append(nestedCommand.getDescription()); } } catch (NotDefinedException e) { label.append(command.toString()); } return label.toString(); }
/** * Handles the default selection event on the table of possible completions. This attempts to * execute the given command. */ private void executeKeyBinding(Event trigger) { int selectionIndex = completionsTable.getSelectionIndex(); // Try to execute the corresponding command. if (selectionIndex >= 0) { Binding binding = bindings.get(selectionIndex); try { // workbenchKeyboard.updateShellKludge(null); workbenchKeyboard.executeCommand(binding.getParameterizedCommand(), trigger); } catch (CommandException e) { // WorkbenchPlugin.log(binding.getParameterizedCommand().toString(), e); // TODO we probably need to log something here. System.err.println(binding.getParameterizedCommand().toString() + " : " + e); //$NON-NLS-1$ } } }
/** * Handles the default selection event on the table of possible completions. This attempts to * execute the given command. */ private void executeKeyBinding(Event trigger) { int selectionIndex = completionsTable.getSelectionIndex(); // Try to execute the corresponding command. if (selectionIndex >= 0) { close(); Binding binding = bindings.get(selectionIndex); try { // workbenchKeyboard.updateShellKludge(null); workbenchKeyboard.executeCommand(binding.getParameterizedCommand(), trigger); } catch (CommandException e) { // WorkbenchPlugin.log(binding.getParameterizedCommand().toString(), e); // TODO we probably need to log something here. System.err.println(binding.getParameterizedCommand().toString() + " : " + e); //$NON-NLS-1$ } } }
private static void executeCommand(IWorkbench workbench, String commandName, Map<String, Object> params) { if (workbench == null) { workbench = PlatformUI.getWorkbench(); } // get command ICommandService commandService = (ICommandService)workbench.getService(ICommandService.class); Command command = commandService != null ? commandService.getCommand(commandName) : null; // get handler service //IBindingService bindingService = (IBindingService)workbench.getService(IBindingService.class); //TriggerSequence[] triggerSequenceArray = bindingService.getActiveBindingsFor("de.anbos.eclipse.easyshell.plugin.commands.open"); IHandlerService handlerService = (IHandlerService)workbench.getService(IHandlerService.class); if (command != null && handlerService != null) { ParameterizedCommand paramCommand = ParameterizedCommand.generateCommand(command, params); try { handlerService.executeCommand(paramCommand, null); } catch (Exception e) { Activator.logError(Activator.getResourceString("easyshell.message.error.handlerservice.execution"), paramCommand.toString(), e, true); } } }