Examples of IHandlerService


Examples of org.eclipse.ui.handlers.IHandlerService

    /* (non-Javadoc)
     * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
     */
    public void focusGained( FocusEvent e )
    {
        IHandlerService handlerService = ( IHandlerService ) PlatformUI.getWorkbench().getAdapter(
            IHandlerService.class );
        if ( handlerService != null )
        {
            IHandler handler = new org.eclipse.core.commands.AbstractHandler()
            {
                public Object execute( ExecutionEvent event ) throws org.eclipse.core.commands.ExecutionException
                {
                    showPossibleCompletions();
                    return null;
                }
            };
            this.handlerActivation = handlerService.activateHandler(
                ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, handler );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

     */
    public void uninstall()
    {
        if ( handlerActivation != null )
        {
            IHandlerService handlerService = ( IHandlerService ) PlatformUI.getWorkbench().getAdapter(
                IHandlerService.class );
            handlerService.deactivateHandler( handlerActivation );
            handlerActivation = null;
        }

        if ( control != null )
        {
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    /**
     * {@inheritDoc}
     */
    public void focusGained( FocusEvent e )
    {
        IHandlerService handlerService = ( IHandlerService ) PlatformUI.getWorkbench().getAdapter(
            IHandlerService.class );
        if ( handlerService != null )
        {
            IHandler handler = new org.eclipse.core.commands.AbstractHandler()
            {
                public Object execute( ExecutionEvent event ) throws org.eclipse.core.commands.ExecutionException
                {
                    showPossibleCompletions();
                    return null;
                }
            };
            handlerActivation = handlerService.activateHandler(
                ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, handler );
        }
    }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

     */
    public void focusLost( FocusEvent e )
    {
        if ( handlerActivation != null )
        {
            IHandlerService handlerService = ( IHandlerService ) PlatformUI.getWorkbench().getAdapter(
                IHandlerService.class );
            handlerService.deactivateHandler( handlerActivation );
            handlerActivation = null;
        }
    }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    activateHandler(LinkWithSelectionHandler.ID, new LinkWithSelectionHandler(
        settings, selectiontracker));
  }

  private void activateHandler(String id, IHandler handler) {
    final IHandlerService hs = (IHandlerService) getSite().getService(
        IHandlerService.class);
    hs.activateHandler(id, handler);
    handlers.add(handler);
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

            Map parameters = new HashMap();
            parameters.put("org.eclipse.ui.perspectives.showPerspective.perspectiveId", perspectiveDescriptor.getId());
            ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, parameters);

            IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench()
                    .getService(IHandlerService.class);
            try {
                handlerService.executeCommand(parameterizedCommand, null);
            } catch (ExecutionException ex) {
//                StatusManager.getManager().handle(new Status(IStatus.ERROR, ApplicationPlugin.PLUGIN_ID, ex.getMessage(), ex));
            } catch (NotDefinedException ex) {
//                StatusManager.getManager().handle(new Status(IStatus.ERROR, ApplicationPlugin.PLUGIN_ID, ex.getMessage(), ex));
            } catch (NotEnabledException ex) {
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

   * @param action
   *            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.IHandlerService

  /**
   * Dispose the receiver and clear out the references.
   *
   */
  public void dispose() {
    final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
    final Iterator iterator = activations.iterator();
    while (iterator.hasNext()) {
      handlerService.deactivateHandler((IHandlerActivation) iterator
          .next());
    }
    activations.clear();
   
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

            .removePropertyChangeListener(editorPropChangeListnener);
        editorPropChangeListnener = null;
      }
      if (pinEditorHandlerActivation != null) {
        // remove pin editor keyboard shortcut handler
        final IHandlerService handlerService = (IHandlerService) window.getWorkbench().getService(IHandlerService.class);
        handlerService.deactivateHandler(pinEditorHandlerActivation);
        pinEditorHandlerActivation = null;
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

          return null;
        }
      };

      // 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
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.