Package org.eclipse.ui.handlers

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


  private void executeOpenCommand() {
    IHandlerService srv = CommonUtils.getService(getViewSite(), IHandlerService.class);

    try {
      srv.executeCommand("org.eclipse.egit.ui.RepositoriesViewOpen", null); //$NON-NLS-1$
    } catch (Exception e) {
      Activator.handleError(e.getMessage(), e, false);
    }
  }
View Full Code Here


    try {
      if (c != null)
        handlerService.executeCommandInContext(
            new ParameterizedCommand(cmd, null), null, c);
      else
        handlerService.executeCommand(commandId, null);

      return true;
    } catch (CommandException ignored) {
      // Ignored
    }
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

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

        if( handlerService != null ) {
          try {
            handlerService.executeCommand(UPDATE_MANAGER_COMMAND, new Event()); // show software updates dialog
          } catch(Exception e) {
            InstaSearchPlugin.log(e);
            setProperty(IProgressConstants.ACTION_PROPERTY, new ShowExceptionAction(e, "Error Launching Update Manager"));
          }
        }
View Full Code Here

   *             exception
   */
  private void executeExport() throws Exception {
    if ( validateAndShowErrors() ) {
      IHandlerService hs = (IHandlerService) PlatformUI.getWorkbench().getService( IHandlerService.class );
      hs.executeCommand( "at.bestsolution.efxclipse.tooling.jdt.ui.export", null );
    }
  }

  /**
   * @throws Exception
View Full Code Here

   *             exception
   */
  private void executeGenerateAnt() throws Exception {
    if ( validateAndShowErrors() ) {
      IHandlerService hs = (IHandlerService) PlatformUI.getWorkbench().getService( IHandlerService.class );
      hs.executeCommand( "at.bestsolution.efxclipse.tooling.jdt.ui.generateAnt", null );
    }
  }

  /**
   * @return <true> if build configuration is valid, <false> otherwise
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.