Examples of IHandlerService


Examples of org.eclipse.ui.handlers.IHandlerService

    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new SurroundWithAction());
    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);
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    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

Examples of org.eclipse.ui.handlers.IHandlerService

        _btnOpenInBrowser.addSelectionListener(new SelectionListener() {
           
            public void widgetSelected(SelectionEvent e) {
                try {
                    ICommandService cService = (ICommandService) getSite().getService(ICommandService.class);
                    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
                   
                    Command command = cService.getCommand("de.innovationgate.eclipse.ids.commands.OpenModuleInBrowser");
                   
                    IParameter paramTMLFile = command.getParameter("de.innovationgate.eclipse.ids.commands.OpenModuleInBrowser.paramTMLFilePath");
 
                    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

Examples of org.eclipse.ui.handlers.IHandlerService

            if (menu.getImageDescriptor() != null) {
              link.setImage(menu.getImageDescriptor().createImage());
            }
            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

Examples of org.eclipse.ui.handlers.IHandlerService

    ICommandService commandService = (ICommandService) serviceLocator.getService(ICommandService.class);
   
    Command command = commandService.getCommand("io.emmet.eclipse.commands." + item.getId());
    command.define(item.getName(), "", commandService.getCategory("io.emmet.eclipse.commands.category"));
   
    IHandlerService handlerService = (IHandlerService) serviceLocator.getService(IHandlerService.class);
    handlerService.activateHandler(command.getId(), handlerFactory(item.getId()));
   
    CommandContributionItemParameter p = new CommandContributionItemParameter(
        serviceLocator, "", command.getId(), CommandContributionItem.STYLE_PUSH);
   
    p.label = item.getName();
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    return type;
  }

  @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

Examples of org.eclipse.ui.handlers.IHandlerService

   * TODO Register prefixes by extension point
   */
  private void registerCorrectionHandlers() {
    final String COMMAND_PREFIX = "org.pdtextensions.core.ui.correction."; //$NON-NLS-1$
    final ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
    final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
   
    for (final Object ob : commandService.getDefinedCommandIds()) {
      String id = (String) ob;
      if (!id.startsWith(COMMAND_PREFIX)) {
        continue;
      }
     
      handlerService.activateHandler(id, new CorrectionCommandHandler());
    }
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    }

    @Override
    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

Examples of org.eclipse.ui.handlers.IHandlerService

    @Override
    public void activated() {
        // add EOF submissions
        final IPageSite site = fPage.getSite();
        final IHandlerService handlerService = (IHandlerService) site
                .getService(IHandlerService.class);
        final IContextService contextService = (IContextService) site
                .getService(IContextService.class);
        fActivatedContext = contextService.activateContext(fContextId);
        fActivatedHandler = handlerService.activateHandler(
                "org.eclipse.debug.ui.commands.eof", fEOFHandler); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    @Override
    public void deactivated() {
        // remove EOF submissions
        final IPageSite site = fPage.getSite();
        final IHandlerService handlerService = (IHandlerService) site
                .getService(IHandlerService.class);
        final IContextService contextService = (IContextService) site
                .getService(IContextService.class);
        handlerService.deactivateHandler(fActivatedHandler);
        contextService.deactivateContext(fActivatedContext);
    }
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.