Package org.eclipse.ui.handlers

Examples of org.eclipse.ui.handlers.IHandlerService.executeCommand()


            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,
                  Messages.Generic_errorExecutingCommand, e)), false);
View Full Code Here


            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
            UIPlugin.logAndShowError(new CoreException(
View Full Code Here

          public void widgetSelected(SelectionEvent e) { 
            IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
            try {
              ColumnEvent event = new ColumnEvent();
              event.setColumn(columnHeader);
              handlerService.executeCommand("de.ambits.csvmaster.commands.renameColumn", event);
            } catch (Exception e1) {
              MessageDialog.openError(getShell(), "Error", e1.getMessage());
            }
          }
         
View Full Code Here

      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;
        try {
View Full Code Here

    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) {
      this.throwCoreException(e.getMessage(), e);
    }
  }
 
View Full Code Here

    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) {
      this.throwCoreException(e.getMessage(), e);
    }
  }
 
View Full Code Here

    ParameterizedCommand parmCommand = new ParameterizedCommand(command,
        new Parameterization[] { parmUmlPath, parmDoBundling, parmTargetModelFile});
   
    // exec the command
    try {
      handlerService.executeCommand(parmCommand, null);
    } catch (Exception e) {
      this.throwCoreException(e.getMessage(), e);
    }
  }
View Full Code Here

      final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);

      UIThreadRunnable.asyncExec(new VoidResult() {
        public void run() {
          try {
            menuClickResult = handlerService.executeCommand(commandID, null);
          } catch (Exception e) {
            throw new RuntimeException("Failed to execute the command - " + commandID, e); //$NON-NLS-1$
          }
        }
      });
View Full Code Here

   */
  @Override
  public void run() {
    IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
    try {
      handlerService.executeCommand(AUTO_LAYOUT_COMMAND_ID, null);
    } catch (Exception ex) {
      Activator.getLogger().error(ex);
    }
  }
 
View Full Code Here

     * @param fActivateEditorBinding
     */
    public static void executeCommand(String commandId) {
        IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
        try {
            handlerService.executeCommand(commandId, null);
        } catch (Exception e) {
            Log.log(e);
        }

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.