Examples of IHandler


Examples of org.eclipse.core.commands.IHandler

        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

Examples of org.eclipse.core.commands.IHandler

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

Examples of org.eclipse.core.commands.IHandler

  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

Examples of org.eclipse.core.commands.IHandler

        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.core.commands.IHandler

   
    //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.core.commands.IHandler

   
    //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.core.commands.IHandler

    {
        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;
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

    {
        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;
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

   */
  public final IHandler getHandler(String commandId) {
    if (fHandlers == null)
      throw new IllegalStateException();

    IHandler handler= (IHandler)fHandlers.get(commandId);
    if (handler != null)
      return handler;
   
    Assert.isLegal(false);
    return null;
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

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