Package org.eclipse.jface.commands

Examples of org.eclipse.jface.commands.ActionHandler


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


                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newProject.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newProject ) );
                        commandService.getCommand( renameProject.getActionDefinitionId() ).setHandler(
                            new ActionHandler( renameProject ) );
                        commandService.getCommand( deleteProject.getActionDefinitionId() ).setHandler(
                            new ActionHandler( deleteProject ) );
                    }
                }
            }

View Full Code Here

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newServer.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newServer ) );
                        commandService.getCommand( openConfiguration.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openConfiguration ) );
                        commandService.getCommand( delete.getActionDefinitionId() ).setHandler(
                            new ActionHandler( delete ) );
                        commandService.getCommand( rename.getActionDefinitionId() ).setHandler(
                            new ActionHandler( rename ) );
                        commandService.getCommand( start.getActionDefinitionId() ).setHandler(
                            new ActionHandler( start ) );
                        commandService.getCommand( stop.getActionDefinitionId() )
                            .setHandler( new ActionHandler( stop ) );
                        commandService.getCommand( properties.getActionDefinitionId() ).setHandler(
                            new ActionHandler( properties ) );
                    }
                }
            }

View Full Code Here

        if ( commandService != null )
        {
            IHandler handler = commandService.getCommand( action.getActionDefinitionId() ).getHandler();
            if ( handler instanceof ActionHandler )
            {
                ActionHandler actionHandler = ( ActionHandler ) handler;
                if ( actionHandler != null && actionHandler.getAction() == action )
                {
                    commandService.getCommand( action.getActionDefinitionId() ).setHandler( null );
                }
            }
            else if ( handler != null )
View Full Code Here

    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            ActionHandler actionHandler = new ActionHandler( action );
            commandService.getCommand( action.getActionDefinitionId() ).setHandler( actionHandler );
        }
    }
View Full Code Here

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newServer.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newServer ) );
                        commandService.getCommand( openConfiguration.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openConfiguration ) );
                        commandService.getCommand( delete.getActionDefinitionId() ).setHandler(
                            new ActionHandler( delete ) );
                        commandService.getCommand( rename.getActionDefinitionId() ).setHandler(
                            new ActionHandler( rename ) );
                        commandService.getCommand( run.getActionDefinitionId() ).setHandler( new ActionHandler( run ) );
                        commandService.getCommand( stop.getActionDefinitionId() )
                            .setHandler( new ActionHandler( stop ) );
                        commandService.getCommand( properties.getActionDefinitionId() ).setHandler(
                            new ActionHandler( properties ) );
                    }
                }
            }

View Full Code Here

                    ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
                        ICommandService.class );
                    if ( commandService != null )
                    {
                        commandService.getCommand( newSchema.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newSchema ) );
                        commandService.getCommand( newAttributeType.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newAttributeType ) );
                        commandService.getCommand( newObjectClass.getActionDefinitionId() ).setHandler(
                            new ActionHandler( newObjectClass ) );
                        commandService.getCommand( openElement.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openElement ) );
                        commandService.getCommand( openTypeHierarchy.getActionDefinitionId() ).setHandler(
                            new ActionHandler( openTypeHierarchy ) );
                        commandService.getCommand( deleteSchemaElement.getActionDefinitionId() ).setHandler(
                            new ActionHandler( deleteSchemaElement ) );
                        commandService.getCommand( renameSchemaElement.getActionDefinitionId() ).setHandler(
                            new ActionHandler( renameSchemaElement ) );
                    }
                }
            }

View Full Code Here

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

    _historyList=new List( _sashForm, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL);
    _queryText=new Text( _queryArea, SWT.MULTI|SWT.H_SCROLL|SWT.V_SCROLL);
    initializeHistoryList();
    makeActions();
    _activation=((IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class)).
    activateHandler(RUN_QUERY_COMMAND, new ActionHandler(_queryAction));
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
  }
View Full Code Here

    if (commandId != null) {
      final Object value = globalActionHandlersByCommandId.get(commandId);
      if (value instanceof ActionHandler) {
        // This handler is about to get clobbered, so dispose it.
        final ActionHandler handler = (ActionHandler) value;
        handler.dispose();
      }

      if (globalAction instanceof CommandAction) {
        final String actionId = globalAction.getId();
        if (actionId != null) {
          final IActionCommandMappingService mappingService = (IActionCommandMappingService) serviceLocator
              .getService(IActionCommandMappingService.class);
          mappingService.map(actionId, commandId);
        }
      } else {
        globalActionHandlersByCommandId.put(commandId,
            new ActionHandler(globalAction));
      }
    }

    submitGlobalActions();
  }
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.