Examples of IHandlerActivation


Examples of org.eclipse.ui.handlers.IHandlerActivation

      return;
    }

    final Object value = activationsBySubmission.remove(handlerSubmission);
    if (value instanceof IHandlerActivation) {
      final IHandlerActivation activation = (IHandlerActivation) value;
      handlerService.deactivateHandler(activation);
    }
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

         */
        private void registerKeybindings(IAction action) {
            final IHandler handler = new ActionHandler(action);
            final IHandlerService handlerService = (IHandlerService) PlatformUI
                    .getWorkbench().getAdapter(IHandlerService.class);
            final IHandlerActivation activation = handlerService.activateHandler(
                    action.getActionDefinitionId(), handler);
//                    new ActiveShellExpression(dialog.getShell()),
//                    ISources.ACTIVE_SHELL);
            activations.add(activation);
        }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

   *            the action to register.
   */
  private void registerKeybindings(IAction action) {
    final IHandler handler = new ActionHandler(action);
    final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
    final IHandlerActivation activation = handlerService.activateHandler(
        action.getActionDefinitionId(), handler,
        new ActiveShellExpression(dialog.getShell()));
    activations.add(activation);
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

    List newHandlers = new ArrayList(handlersByCommandId.size());

    Iterator existingIter = handlerActivations.iterator();
    while (existingIter.hasNext()) {
      IHandlerActivation next = (IHandlerActivation) existingIter.next();

      String cmdId = next.getCommandId();

      Object handler = handlersByCommandId.get(cmdId);
      if (handler == next.getHandler()) {
        handlersByCommandId.remove(cmdId);
        newHandlers.add(next);
      } else {
        handlerService.deactivateHandler(next);
      }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

      final IWorkbench workbench = getWorkbench();
      final IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class);
      handlerService.deactivateHandlers(handlerActivations);
      final Iterator activationItr = handlerActivations.iterator();
      while (activationItr.hasNext()) {
        final IHandlerActivation activation = (IHandlerActivation) activationItr
            .next();
        activation.getHandler().dispose();
      }
      handlerActivations.clear();
      globalActionHandlersByCommandId.clear();

      // Remove the enabled submissions. Bug 64024.
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

  private void activateHandler(CommandConfig commandConfig, String commandId)
  {
    IHandlerService handlerService = (IHandlerService) getHandlerService(getServiceLocator());
    IHandler handler = this.createHandlerForCustomCommand(commandConfig);
    IHandlerActivation handlerActivation = handlerService.activateHandler(
        commandId, handler);
    this.setHandlerActivationInCommandConfig(commandConfig, handlerActivation);
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

  protected void activateHandler(int operation, String actionDefinitionId) {
    StyledText textWidget = textViewer.getTextWidget();
    IHandler actionHandler = createActionHandler(operation,
        actionDefinitionId);
    IHandlerActivation handlerActivation = handlerService.activateHandler(
        actionDefinitionId, actionHandler,
        new ActiveFocusControlExpression(textWidget));

    handlerActivations.add(handlerActivation);
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerActivation

   */
  protected void activateHandler(int operation, String actionDefinitionId) {
    StyledText textWidget = textViewer.getTextWidget();
    IHandler actionHandler = createActionHandler(operation,
        actionDefinitionId);
    IHandlerActivation handlerActivation = handlerService.activateHandler(
        actionDefinitionId, actionHandler,
        new ActiveFocusControlExpression(textWidget));

    handlerActivations.add(handlerActivation);
  }
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.