Package org.eclipse.jface.commands

Examples of org.eclipse.jface.commands.ActionHandler


              .doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
      }
    };
    proposalAction
        .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    return new ActionHandler(proposalAction);
  }
View Full Code Here


    TextViewerAction action = new TextViewerAction(fPatternEditor,
        ITextOperationTarget.UNDO);
    action.setText(PreferencesMessages.EditTemplateDialog_undo);
    fGlobalActions.put(ITextEditorActionConstants.UNDO, action);
    handlerActivations.add(handlerService.activateHandler(
        IWorkbenchActionDefinitionIds.UNDO, new ActionHandler(action),
        expression));

    action = new TextViewerAction(fPatternEditor, ITextOperationTarget.REDO);
    action.setText(PreferencesMessages.EditTemplateDialog_redo);
    fGlobalActions.put(ITextEditorActionConstants.REDO, action);
    handlerActivations.add(handlerService.activateHandler(
        IWorkbenchActionDefinitionIds.REDO, new ActionHandler(action),
        expression));

    action = new TextViewerAction(fPatternEditor, ITextOperationTarget.CUT);
    action.setText(PreferencesMessages.EditTemplateDialog_cut);
    fGlobalActions.put(ITextEditorActionConstants.CUT, action);

    action = new TextViewerAction(fPatternEditor, ITextOperationTarget.COPY);
    action.setText(PreferencesMessages.EditTemplateDialog_copy);
    fGlobalActions.put(ITextEditorActionConstants.COPY, action);

    action = new TextViewerAction(fPatternEditor,
        ITextOperationTarget.PASTE);
    action.setText(PreferencesMessages.EditTemplateDialog_paste);
    fGlobalActions.put(ITextEditorActionConstants.PASTE, action);

    action = new TextViewerAction(fPatternEditor,
        ITextOperationTarget.SELECT_ALL);
    action.setText(PreferencesMessages.EditTemplateDialog_select_all);
    fGlobalActions.put(ITextEditorActionConstants.SELECT_ALL, action);

    action = new TextViewerAction(fPatternEditor,
        ISourceViewer.CONTENTASSIST_PROPOSALS);
    action.setText(PreferencesMessages.EditTemplateDialog_content_assist);
    fGlobalActions.put("ContentAssistProposal", action); //$NON-NLS-1$
    handlerActivations.add(handlerService.activateHandler(
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS,
        new ActionHandler(action), expression));

    fSelectionActions.add(ITextEditorActionConstants.CUT);
    fSelectionActions.add(ITextEditorActionConstants.COPY);
    fSelectionActions.add(ITextEditorActionConstants.PASTE);
View Full Code Here

    bars.setGlobalActionHandler(ActionFactory.COPY.getId(), fCopyAction);
    bars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), fFocusAction);
    bars.setGlobalActionHandler(ActionFactory.DELETE.getId(), fDeleteAction);
   
    IHandlerService handlerService= (IHandlerService) getViewSite().getService(IHandlerService.class);
    handlerService.activateHandler(LINK_WITH_EDITOR_COMMAND_ID, new ActionHandler(fLinkWithEditor));
  }
View Full Code Here

          textViewer.doOperation(operation);
        }
      }
    };
    action.setActionDefinitionId(actionDefinitionId);
    return new ActionHandler(action);
  }
View Full Code Here

      super.setActiveEditor(part);
    }
   
    @Override
    protected ActionHandler getHandler(IEditorPart editorPart) {
      return new ActionHandler(action);
    }
View Full Code Here

    @Override
    protected ActionHandler getHandler(IEditorPart editorPart) {
      ITextEditor textEditor = tryCast(editorPart, ITextEditor.class);
      if(textEditor == null)
        return null;
      return new ActionHandler(textEditor.getAction(editorActionId));
    }
View Full Code Here

        {
            if ( commandService != null )
            {
                IAction pda = ( IAction ) browserActionMap.get( propertyDialogAction );
                pda.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.properties" );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( new ActionHandler( pda ) );

                IAction ra = ( IAction ) browserActionMap.get( refreshAction );
                commandService.getCommand( ra.getActionDefinitionId() ).setHandler( new ActionHandler( ra ) );
            }
        }

        if ( commandService != null )
        {
            IAction ua = ( IAction ) browserActionMap.get( upAction );
            commandService.getCommand( ua.getActionDefinitionId() ).setHandler( new ActionHandler( ua ) );
        }
    }
View Full Code Here

        {
            if ( commandService != null )
            {
                IAction da = ( IAction ) entryEditorActionMap.get( deleteAction );
                da.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.delete" );
                commandService.getCommand( da.getActionDefinitionId() ).setHandler( new ActionHandler( da ) );

                IAction ca = ( IAction ) entryEditorActionMap.get( copyAction );
                ca.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.copy" );
                commandService.getCommand( ca.getActionDefinitionId() ).setHandler( new ActionHandler( ca ) );

                IAction pa = ( IAction ) entryEditorActionMap.get( pasteAction );
                pa.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.paste" );
                commandService.getCommand( pa.getActionDefinitionId() ).setHandler( new ActionHandler( pa ) );

                showQuickFilterAction.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.find" );
                commandService.getCommand( showQuickFilterAction.getActionDefinitionId() ).setHandler(
                    new ActionHandler( showQuickFilterAction ) );

                IAction pda = ( IAction ) entryEditorActionMap.get( propertyDialogAction );
                pda.setActionDefinitionId( "org.apache.directory.ldapstudio.browser.action.properties" );
                commandService.getCommand( pda.getActionDefinitionId() ).setHandler( new ActionHandler( pda ) );
            }
        }

        if ( commandService != null )
        {
            IAction nva = ( IAction ) entryEditorActionMap.get( newValueAction );
            commandService.getCommand( nva.getActionDefinitionId() ).setHandler( new ActionHandler( nva ) );
            commandService.getCommand( openDefaultValueEditorActionProxy.getActionDefinitionId() ).setHandler(
                new ActionHandler( openDefaultValueEditorActionProxy ) );
        }

    }
View Full Code Here

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction leid = ( IAction ) browserActionMap.get( locateEntryInDitAction );
            commandService.getCommand( leid.getActionDefinitionId() ).setHandler( new ActionHandler( leid ) );
        }

    }
View Full Code Here

        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IAction naa = ( IAction ) entryEditorActionMap.get( newAttributeAction );
            commandService.getCommand( naa.getActionDefinitionId() ).setHandler( new ActionHandler( naa ) );
            IAction lid = ( IAction ) entryEditorActionMap.get( locateDnInDitAction );
            commandService.getCommand( lid.getActionDefinitionId() ).setHandler( new ActionHandler( lid ) );
            IAction eada = ( IAction ) entryEditorActionMap.get( editAttributeDescriptionAction );
            commandService.getCommand( eada.getActionDefinitionId() ).setHandler( new ActionHandler( eada ) );
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.commands.ActionHandler

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.