Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ParameterizedCommand


   */
  protected ParameterizedCommand getForwardCommand() {
    // TODO Auto-generated method stub
    final ICommandService commandService = (ICommandService) window.getWorkbench().getService(ICommandService.class);
    final Command command = commandService.getCommand("org.eclipse.ui.window.nextView"); //$NON-NLS-1$
    ParameterizedCommand commandF = new ParameterizedCommand(command, null);
    return commandF;
  }
View Full Code Here


   * @see org.eclipse.ui.internal.CycleBaseHandler#getBackwardCommand()
   */
  protected ParameterizedCommand getBackwardCommand() {
    final ICommandService commandService = (ICommandService) window.getWorkbench().getService(ICommandService.class);
    final Command command = commandService.getCommand("org.eclipse.ui.window.previousPerspective"); //$NON-NLS-1$
    ParameterizedCommand commandBack = new ParameterizedCommand(command, null);
    return commandBack;
  }
View Full Code Here

   * @see org.eclipse.ui.internal.CycleBaseHandler#getForwardCommand()
   */
  protected ParameterizedCommand getForwardCommand() {
    final ICommandService commandService = (ICommandService) window.getWorkbench().getService(ICommandService.class);
    final Command command = commandService.getCommand("org.eclipse.ui.window.nextPerspective"); //$NON-NLS-1$
    ParameterizedCommand commandF = new ParameterizedCommand(command, null);
    return commandF;
  }
View Full Code Here

          try {
            Collection combinations = ParameterizedCommand
                .generateCombinations(command);
            for (Iterator it = combinations.iterator(); it
                .hasNext();) {
              ParameterizedCommand pc = (ParameterizedCommand) it.next();
              String id = pc.serialize();
              idToElement.put(id,
                  new CommandElement(pc, id, this));
            }
          } catch (final NotDefinedException e) {
            // It is safe to just ignore undefined commands.
View Full Code Here

              (ICommandService) getSite().getService(ICommandService.class);
            Command cmd = commandService.getCommand("net.sf.logsaw.ui.commands.AddLogResourceCommand"); //$NON-NLS-1$
            try {
              Parameterization param = new Parameterization(
                  cmd.getParameter("net.sf.logsaw.ui.commands.AddLogResourceCommand.filename"), ((String[]) target)[0]); //$NON-NLS-1$
              ParameterizedCommand paraCmd = new ParameterizedCommand(cmd, new Parameterization[] {param});
              handlerService.executeCommand(paraCmd, null);
            } catch (CommandException e) {
              // log and show error
              UIPlugin.logAndShowError(new CoreException(new Status(
                  IStatus.ERROR, UIPlugin.PLUGIN_ID,
View Full Code Here

            int pageNumber = Integer.valueOf(text.getText().trim());
            IHandlerService service =
              (IHandlerService) getWorkbenchWindow().getService(IHandlerService.class);
            Parameterization param = new Parameterization(
                cmd.getParameter("net.sf.logsaw.ui.commands.GoToPageCommand.pageNumber"), Integer.toString(pageNumber)); //$NON-NLS-1$
            ParameterizedCommand paraCmd = new ParameterizedCommand(cmd, new Parameterization[] {param});
            service.executeCommand(paraCmd, null);
          } catch (NumberFormatException e1) {
            // nadda
          } catch (CommandException e1) {
            // Log and show error
View Full Code Here

      Command showView = commandService.getCommand(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW);
      IParameter parm1 = showView.getParameter(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID);
      Parameterization parmId1 = new Parameterization(parm1, HttpRequestView.ID);
      IParameter parm2 = showView.getParameter(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_SECONDARY_ID);
      Parameterization parmId2 = new Parameterization(parm2, ScannerPerspectiveFactory.HTTP_VIEW_SECONDARY_ID);
      ParameterizedCommand parmCommand = new ParameterizedCommand(showView, new Parameterization[] { parmId1, parmId2 });
      handlerService.executeCommand(parmCommand, null);

      IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(HttpRequestView.ID, ScannerPerspectiveFactory.HTTP_VIEW_SECONDARY_ID, IWorkbenchPage.VIEW_VISIBLE);
      if(view instanceof HttpRequestView && arguments[0] instanceof String) {
        final HttpRequestView requestView = (HttpRequestView) view;
View Full Code Here

    }

    // parametrize it
    Parameterization parmRoot = new Parameterization(rootParm, containerName);
    Parameterization parmProjectName = new Parameterization(projectNameParm, projectName);
    ParameterizedCommand parmCommand = new ParameterizedCommand(cmd, new Parameterization[] { parmRoot, parmProjectName });

    // exec the command
    try {
      handlerService.executeCommand(parmCommand, null);
    } catch (Exception e) {
View Full Code Here

    }

    // parametrize it
    Parameterization parmDir = new Parameterization(dirParm, containerName);
    Parameterization parmFile = new Parameterization(fileParm, fileName);
    ParameterizedCommand parmCommand = new ParameterizedCommand(createPmiFileCmd, new Parameterization[] { parmDir, parmFile });

    // exec the command
    try {
      handlerService.executeCommand(parmCommand, null);
    } catch (Exception e) {
View Full Code Here

 
    // parametrize it
    Parameterization parmUmlPath = new Parameterization(umlPathParm, umlResourcePath);
    Parameterization parmDoBundling = new Parameterization(doBundlingParm, Boolean.toString(doBundling));
    Parameterization parmTargetModelFile = new Parameterization(targetModelFileParm, modelPath);
    ParameterizedCommand parmCommand = new ParameterizedCommand(command,
        new Parameterization[] { parmUmlPath, parmDoBundling, parmTargetModelFile});
   
    // exec the command
    try {
      handlerService.executeCommand(parmCommand, null);
View Full Code Here

TOP

Related Classes of org.eclipse.core.commands.ParameterizedCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.