Package org.eclipse.ui.handlers

Examples of org.eclipse.ui.handlers.IHandlerService


   * @since 3.1
   */
    public final void activateHandler() {
    if (handlerActivation == null) {
      final IHandler handler = new ShowViewHandler(getId());
      final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
      handlerActivation = handlerService
          .activateHandler(getId(), handler);
    }
    }
View Full Code Here


   *
   * @since 3.1
   */
  public final void deactivateHandler() {
    if (handlerActivation != null) {
      final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
      handlerService.deactivateHandler(handlerActivation);
      handlerActivation = null;
    }
  }
View Full Code Here

  /**
   * Initialize the local services.
   */
  private void initializeDefaultServices() {
    serviceLocator.registerService(IWorkbenchPartSite.class, this);
    final IHandlerService parentService = (IHandlerService) serviceLocator
        .getService(IHandlerService.class);
    final Expression defaultExpression = new ActivePartExpression(part);
    final IHandlerService slave = new SlaveHandlerService(parentService,
        defaultExpression);
    serviceLocator.registerService(IHandlerService.class, slave);

    final IContextService parentContextService = (IContextService) serviceLocator
        .getService(IContextService.class);
View Full Code Here

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

    /**
     * {@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

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

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

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

    /**
     * {@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;
                }
            };
            this.handlerActivation = handlerService.activateHandler(
                ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, handler );
        }
    }
View Full Code Here

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

  public synchronized void selectionChanged(SelectionChangedEvent event) {
    if (active) {
      logger.trace("entering selectionChanged");
      active = false;

      IHandlerService handlerService = (IHandlerService) this.view
          .getSite().getService(IHandlerService.class);
      try {
        handlerService.executeCommand(CallEditorHandler.CALL_EDITOR_ID,
            null);
      } catch (Exception ex) {

        MessageDialog.showUnexpectedErrorMessage(
            "Failed to call handler with ID "
View Full Code Here

TOP

Related Classes of org.eclipse.ui.handlers.IHandlerService

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.