Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.IHandler


          warningsToLog);
      if (enabledWhenExpression == ERROR_EXPRESSION) {
        continue;
      }

      final IHandler proxy = new HandlerProxy(configurationElement,
          ATT_CLASS, enabledWhenExpression, evaluationService);
      handlerActivations.add(handlerService.activateHandler(commandId,
          proxy, activeWhenExpression));

      // Read out the help context identifier.
View Full Code Here


    while (localActivationItr.hasNext()) {
      final Object object = localActivationItr.next();
      if (object instanceof IHandlerActivation) {
        final IHandlerActivation localActivation = (IHandlerActivation) object;
        final String commandId = localActivation.getCommandId();
        final IHandler handler = localActivation.getHandler();
        final IHandlerActivation parentActivation = parent
            .activateHandler(commandId, handler, defaultExpression);
        parentActivations.add(parentActivation);
        localActivationsToParentActivations.put(localActivation,
            parentActivation);
View Full Code Here

   *
   * @see org.eclipse.ui.internal.actions.CommandAction#runWithEvent(org.eclipse.swt.widgets.Event)
   */
  public void runWithEvent(Event event) {
    if (partHandler != null) {
      IHandler oldHandler = getParameterizedCommand().getCommand()
          .getHandler();
      try {
        getParameterizedCommand().getCommand().setHandler(partHandler);
        getParameterizedCommand().executeWithChecks(event, appContext);
      } catch (ExecutionException e) {
View Full Code Here

  }

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression childExpression = childActivation.getExpression();
    final AndExpression expression;
    if (childExpression instanceof AndExpression) {
      expression = (AndExpression) childExpression;
    } else {
View Full Code Here

    service.deactivateHandlers(handlerActivations);
    final Iterator activationItr = handlerActivations.iterator();
    while (activationItr.hasNext()) {
      final IHandlerActivation activation = (IHandlerActivation) activationItr
          .next();
      final IHandler handler = activation.getHandler();
      if (handler != null) {
        handler.dispose();
      }
    }
    handlerActivations.clear();
  }
View Full Code Here

  }

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression expression = childActivation.getExpression();
    final int depth = childActivation.getDepth() + 1;
    final IHandlerActivation localActivation = new HandlerActivation(
        commandId, handler, expression, depth, this);
    handlerAuthority.activateHandler(localActivation);
View Full Code Here

   */
  public final Object executeCommandInContext(
      final ParameterizedCommand command, final Event trigger,
      IEvaluationContext context) throws ExecutionException,
      NotDefinedException, NotEnabledException, NotHandledException {
    IHandler oldHandler = command.getCommand().getHandler();

    IHandler handler = findHandler(command.getId(), context);
    boolean enabled = true;
    if (handler instanceof HandlerProxy) {
      enabled = ((HandlerProxy) handler).getProxyEnabled();
    }

View Full Code Here

        if (commandId != null) {
          actionIdByCommandId.put(commandId, actionID);
          // Register this as a handler with the given definition id.
          // the expression gives the setGlobalActionHandler() a
          // priority.
          final IHandler actionHandler = new ActionHandler(handler);
          Expression handlerExpression = EXPRESSION;
          //XXX add new API in next release to avoid down-casting (bug 137091)
          if (this instanceof EditorActionBars) {
            handlerExpression = ((EditorActionBars)this).getHandlerExpression();
          }
View Full Code Here

         *
         * @param action
         *            the action to register.
         */
        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()),
View Full Code Here

  private void activateHandler() {
    IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
    if (handlerService == null)
      return;
   
    IHandler handler= new AbstractHandler() {
      public Object execute(ExecutionEvent event) throws ExecutionException {
        if (ContentAssistHandler.this.isEnabled()) // don't call AbstractHandler#isEnabled()!
          fContentAssistant.showPossibleCompletions();
        return null;
      }
View Full Code Here

TOP

Related Classes of org.eclipse.core.commands.IHandler

Copyright © 2018 www.massapicom. 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.