Package org.eclipse.ui

Examples of org.eclipse.ui.ActiveShellExpression


  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


      // Assign the handler for the pin editor keyboard shortcut.
      final IHandlerService handlerService = (IHandlerService) window.getWorkbench().getService(IHandlerService.class);
      pinEditorHandlerActivation = handlerService.activateHandler(
          "org.eclipse.ui.window.pinEditor", pinEditorHandler, //$NON-NLS-1$
          new ActiveShellExpression(shell));
    }
  }
View Full Code Here

      }
    }

    final Shell shell = getShell();
    if (shell != null) {
      final Expression expression = new ActiveShellExpression(shell);
      for (Iterator iterator = handlersByCommandId.entrySet().iterator(); iterator
          .hasNext();) {
        Map.Entry entry = (Map.Entry) iterator.next();
        String commandId = (String) entry.getKey();
        IHandler handler = (IHandler) entry.getValue();
View Full Code Here

      if ((newShell.getParent() != null)
          && (registeredWindows.get(newShell) == null)) {
        // This is a dialog by default.
        newActivations = new ArrayList();
        final Expression expression = new ActiveShellExpression(
            newShell);
        final IContextActivation dialogWindowActivation = new ContextActivation(
            IContextService.CONTEXT_ID_DIALOG_AND_WINDOW,
            expression, contextService);
        activateContext(dialogWindowActivation);
View Full Code Here

    final List activations = new ArrayList();
    Expression expression;
    IContextActivation dialogWindowActivation;
    switch (type) {
    case IContextService.TYPE_DIALOG:
      expression = new ActiveShellExpression(shell);
      dialogWindowActivation = new ContextActivation(
          IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression,
          contextService);
      activateContext(dialogWindowActivation);
      activations.add(dialogWindowActivation);
      final IContextActivation dialogActivation = new ContextActivation(
          IContextService.CONTEXT_ID_DIALOG, expression,
          contextService);
      activateContext(dialogActivation);
      activations.add(dialogActivation);
      break;
    case IContextService.TYPE_NONE:
      break;
    case IContextService.TYPE_WINDOW:
      expression = new ActiveShellExpression(shell);
      dialogWindowActivation = new ContextActivation(
          IContextService.CONTEXT_ID_DIALOG_AND_WINDOW, expression,
          contextService);
      activateContext(dialogWindowActivation);
      activations.add(dialogWindowActivation);
View Full Code Here

    }

    private void initializeActions() {
      final ArrayList handlerActivations= new ArrayList(3);
      final IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
      final Expression expression= new ActiveShellExpression(fPatternEditor.getControl().getShell());

      getShell().addDisposeListener(new DisposeListener() {

        public void widgetDisposed(DisposeEvent e) {
          handlerService.deactivateHandlers(handlerActivations);
View Full Code Here

        if (cutAction != null) {
          cutAction.update();
          cutHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_CUT,
              new ActionHandler(cutAction),
              new ActiveShellExpression(getParent().getShell()));
        }
        copyAction.update();

        copyHandlerActivation = service.activateHandler(
            IWorkbenchCommandConstants.EDIT_COPY,
            new ActionHandler(copyAction),
            new ActiveShellExpression(getParent().getShell()));
        if (pasteAction != null)
          this.pasteHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_PASTE,
              new ActionHandler(pasteAction),
              new ActiveShellExpression(getParent().getShell()));
        selectAllHandlerActivation = service.activateHandler(
            IWorkbenchCommandConstants.EDIT_SELECT_ALL,
            new ActionHandler(selectAllAction),
            new ActiveShellExpression(getParent().getShell()));
        if (undoAction != null)
          undoHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_UNDO,
              new ActionHandler(undoAction),
              new ActiveShellExpression(getParent().getShell()));
        if (redoAction != null)
          redoHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_REDO,
              new ActionHandler(redoAction),
              new ActiveShellExpression(getParent().getShell()));
        if (quickFixActionHandler != null)
          quickFixHandlerActivation = getHandlerService().activateHandler(
              quickFixActionHandler.getAction().getActionDefinitionId(),
              quickFixActionHandler,
              new ActiveShellExpression(getParent().getShell()));
        if (contentAssistActionHandler != null)
          contentAssistHandlerActivation = getHandlerService().activateHandler(
              contentAssistActionHandler.getAction().getActionDefinitionId(),
              contentAssistActionHandler,
              new ActiveShellExpression(getParent().getShell()));
      }

      public void focusLost(FocusEvent e) {
        IHandlerService service = getHandlerService();
        if (service == null)
View Full Code Here

      public void widgetDisposed(DisposeEvent e) {
        handlerService.deactivateHandlers(handlerActivations);
      }
    });

    Expression expression = new ActiveShellExpression(fPatternEditor
        .getControl().getShell());

    TextViewerAction action = new TextViewerAction(fPatternEditor,
        ITextOperationTarget.UNDO);
    action.setText(PreferencesMessages.EditTemplateDialog_undo);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ActiveShellExpression

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.