Package org.eclipse.core.commands

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


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

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

    {
        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

    {
        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

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

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

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

   * should be created.
   */
  void checkCreatePinEditorShortcutKeyHandler() {
    if (pinEditorHandlerActivation == null) {
      final Shell shell = window.getShell();
      final IHandler pinEditorHandler = new AbstractHandler() {
        public final Object execute(final ExecutionEvent event) {
          // check if the "Close editors automatically" preference is
          // set
          IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
          if (store
View Full Code Here

     * active workbench window is instantiated Eclipse RCP causes this
     * function to fail quietly, so we just don't set the already installed
     * flag true until after it is successful
     */
    ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
    final IHandler handler = this;
    selectionService.addSelectionListener(new ISelectionListener() {
      @Override
      public void selectionChanged(IWorkbenchPart part, ISelection selection) {
        fireHandlerChanged(new HandlerEvent(handler, true, false));
      }
View Full Code Here

TOP

Related Classes of org.eclipse.core.commands.IHandler

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.