Examples of IHandlerService


Examples of org.eclipse.ui.handlers.IHandlerService

    playlistMenu.add(new Separator());
    playlistMenu.add(exitAction);
  }
 
  public void buildActions(final IWorkbenchWindow window) {
    IHandlerService handlerService = (IHandlerService) window.getService(IHandlerService.class);
   
    buildPlaylistsActions(window, handlerService);
    buildActionsAction(window, handlerService);
    buildViewsAction(window, handlerService);
    buildToolsAction(window, handlerService);   
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

        IContextService contextService = (IContextService)getSite().getService(IContextService.class);
        contextService.activateContext(EDITOR_CONTEXT_ID);
  }
 
  private void activateHandlers() {
      IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
      IHandler rebuildCAD = new RebuildCADHandler();
      handlerService.activateHandler("com.gstaykov.pscoder.rebuildcad", rebuildCAD);

        IHandler commentHandler = new CommentHandler();
        handlerService.activateHandler("com.gstaykov.pscoder.addcomment", commentHandler);

        IHandler goToDefinitionHandler = new GoToDefinitionHandler();
        handlerService.activateHandler("com.gstaykov.pscoder.gotodefinition", goToDefinitionHandler);

        IHandler quickOutlineHandler = new QuickOutlineHandler();
        handlerService.activateHandler("com.gstaykov.pscoder.quickoutline", quickOutlineHandler);       
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    setAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE, action);

    computeAndSetDoubleClickAction();
   
    //add handlers to handler service
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    if (handlerService != null) {
     
      IHandler gotoHandler = new GotoMatchingBracketHandler();
      handlerService.activateHandler(ActionDefinitionIds.GOTO_MATCHING_BRACKET, gotoHandler);
     
      fOutlineHandler = new QuickOutlineHandler();
        handlerService.activateHandler(ActionDefinitionIds.SHOW_OUTLINE, fOutlineHandler);
     
      IHandler toggleCommentHandler = new ToggleLineCommentHandler();
      handlerService.activateHandler(ActionDefinitionIds.TOGGLE_COMMENT, toggleCommentHandler);
     
      IHandler addCommentBlockHandler = new AddBlockCommentHandler();
      handlerService.activateHandler(ActionDefinitionIds.ADD_BLOCK_COMMENT, addCommentBlockHandler);
     
      IHandler removeCommentBlockHandler = new RemoveBlockCommentHandler();
      handlerService.activateHandler(ActionDefinitionIds.REMOVE_BLOCK_COMMENT, removeCommentBlockHandler);
    }

    fShowPropertiesAction = new ShowPropertiesAction(getEditorPart(), getSelectionProvider());
    fFoldingGroup = new FoldingActionGroup(this, getSourceViewer());
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    /**
     * Executes the command as the result of link activation.
     */
    @Override
    public void active() {
        IHandlerService handlerService = (IHandlerService) PlatformUI
            .getWorkbench().getService(IHandlerService.class);
        // ICommandService cmdService = (ICommandService)
        // PlatformUI.getWorkbench().getService(ICommandService.class);
        // /*Category lunch =
        // cmdService.getCategory("z.ex.view.keybindings.category");
        // if (!lunch.isDefined()) {
        // lunch.define("Lunch", "Actions take at lunch time.");
        // }*/
        // Command command = cmdService.getCommand(this.id);
        // if (!command.isDefined())
        // return;
        try {
            handlerService.executeCommand(this.id, null);
        } catch (ExecutionException e) {
            e.printStackTrace();
        } catch (NotDefinedException e) {
            e.printStackTrace();
        } catch (NotEnabledException e) {
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

            }
        });
        addActionToMenu(accountMenu, new Action(Messages.ChangeXMPPAccountAction_configure_account) {
            @Override
            public void run() {
                IHandlerService service = (IHandlerService) PlatformUI
                    .getWorkbench().getActiveWorkbenchWindow().getActivePage()
                    .getActivePart().getSite()
                    .getService(IHandlerService.class);
                try {
                    service
                        .executeCommand(
                            "de.fu_berlin.inf.dpp.ui.commands.OpenSarosPreferences", //$NON-NLS-1$
                            null);
                } catch (Exception e) {
                    log.debug("Could execute command", e); //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

    setAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE, action);

    computeAndSetDoubleClickAction();
   
    //add handlers to handler service
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    if (handlerService != null) {
     
      IHandler gotoHandler = new GotoMatchingBracketHandler();
      handlerService.activateHandler(ActionDefinitionIds.GOTO_MATCHING_BRACKET, gotoHandler);
     
      fOutlineHandler = new QuickOutlineHandler();
        handlerService.activateHandler(ActionDefinitionIds.SHOW_OUTLINE, fOutlineHandler);
     
      IHandler toggleCommentHandler = new ToggleLineCommentHandler();
      handlerService.activateHandler(ActionDefinitionIds.TOGGLE_COMMENT, toggleCommentHandler);
     
      IHandler addCommentBlockHandler = new AddBlockCommentHandler();
      handlerService.activateHandler(ActionDefinitionIds.ADD_BLOCK_COMMENT, addCommentBlockHandler);
     
      IHandler removeCommentBlockHandler = new RemoveBlockCommentHandler();
      handlerService.activateHandler(ActionDefinitionIds.REMOVE_BLOCK_COMMENT, removeCommentBlockHandler);
    }

    fShowPropertiesAction = new ShowPropertiesAction(getEditorPart(), getSelectionProvider());
    fFoldingGroup = new FoldingActionGroup(this, getSourceViewer());
  }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

        }
    }

    private void deactivateHandlers()
    {
        final IHandlerService service = (IHandlerService) _htmlEditor.getSite()
                .getService(IHandlerService.class);
        if (service != null)
        {
            for (final IHandlerActivation activation : _handlers)
            {
                service.deactivateHandler(activation);
            }
        }
        _handlers.clear();
    }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

        _handlers.clear();
    }

    private void activateHandlers()
    {
        final IHandlerService service = (IHandlerService) _htmlEditor.getSite()
                .getService(IHandlerService.class);
        for (int i = 0; i < _actions.length; i++)
        {
            _handlers.add(service.activateHandler(_actions[i].getId(), _actionHandlers.get(i)));
        }
    }
View Full Code Here

Examples of org.eclipse.ui.handlers.IHandlerService

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

Examples of org.eclipse.ui.handlers.IHandlerService

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