Package org.eclipse.ui.handlers

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


    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new CommandContributionItem(new CommandContributionItemParameter(getSite(), null, DisplayHelp.ID, null, null, null, null, "Display help", null, null, CommandContributionItem.STYLE_PUSH, null, true)));
  }
 
  public void shiftRight() throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {   
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    handlerService.executeCommand("org.eclipse.ui.edit.text.shiftRight", null);
  }
 
  public void shiftLeft() throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {   
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    handlerService.executeCommand("org.eclipse.ui.edit.text.shiftLeft", null);
View Full Code Here


    handlerService.executeCommand("org.eclipse.ui.edit.text.shiftRight", null);
  }
 
  public void shiftLeft() throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {   
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    handlerService.executeCommand("org.eclipse.ui.edit.text.shiftLeft", null);
  }

  @Override
  protected String[] getKeyBindingScopes() {
    return new String[] { "de.innovationgate.eclipse.ids.contexts.TMLEditorContext" };
View Full Code Here

 
                    Parameterization parm = new Parameterization(paramTMLFile, getInputFile().getFullPath().toString());
      
                    ParameterizedCommand parmCommand = new ParameterizedCommand(command, new Parameterization[] { parm });
                    handlerService.executeCommand(parmCommand, null);
                }
                catch (NotDefinedException e1) {
                }
                catch (ExecutionException e1) {
                    WorkbenchUtils.showErrorDialog(getSite().getShell(), "Unable to open tml module in browser", e1.getMessage());
View Full Code Here

            link.addHyperlinkListener(new HyperlinkAdapter() {
              public void linkActivated(HyperlinkEvent e) {
                IHandlerService handlerService = (IHandlerService) fEditor.getSite().getService(IHandlerService.class);
                if (handlerService != null) {
                  try {
                    handlerService.executeCommand(menu.getId(), null);
                  } catch (Exception ex) {
                    WorkbenchUtils.showErrorDialog(Plugin.getDefault(), fEditor.getSite().getShell(), "Execution of hyperlink failed", "Unable to execute hyperlink command '" + menu.getId() + "'.", ex);
                  }
                }
              }
View Full Code Here

  @Override
  public void doubleClickAction() {
    IHandlerService handlerService = (IHandlerService) view.getSite()
        .getService(IHandlerService.class);
    try {
      handlerService.executeCommand(
          "org.mongodb.meclipse.editors.handlers.CallEditor", null);
    } catch (Exception ex) {
      System.out.println(ex.toString());
      // throw new RuntimeException(
      // "org.mongodb.meclipse.editors.handlers.CallEditor not found");
View Full Code Here

    public void widgetSelected(final SelectionEvent e) {
        final IWorkbench workbench = PlatformUI.getWorkbench();
        final IHandlerService handlerService = (IHandlerService) workbench
                .getService(IHandlerService.class);
        try {
            handlerService.executeCommand(commandId, null);
        } catch (final Exception ex) {
            throw new RuntimeException(commandId + " not found");
        }

    }
View Full Code Here

    }

    try {
      final IHandlerService handlerService = (IHandlerService) workbench
          .getService(IHandlerService.class);
      handlerService.executeCommand(parameterizedCommand, trigger);
    } catch (final NotDefinedException e) {
      // The command is not defined. Forwarded to the IExecutionListener.
    } catch (final NotEnabledException e) {
      // The command is not enabled. Forwarded to the IExecutionListener.
    } catch (final NotHandledException e) {
View Full Code Here

    final ParameterizedCommand cmd = getCommand(commandService, makeFast);
   
        showDlgAction = new Action(WorkbenchMessages.ShowView_title) {
            public void run() {
        try {
          handlerService.executeCommand(
              cmd, null);
        } catch (final ExecutionException e) {
          // Do nothing.
        } catch (NotDefinedException e) {
          // Do nothing.
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

    viewer.addDoubleClickListener(new IDoubleClickListener() {
      public void doubleClick(DoubleClickEvent event) {
        IHandlerService handlerService = (IHandlerService) getSite()
            .getService(IHandlerService.class);
        try {
          handlerService.executeCommand(getDoubleClickCommandId(),
              null);
        } catch (Exception ex) {
          throw new RuntimeException(getDoubleClickCommandId()
              + " not found or " + ex.getMessage());
        }
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.