Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.IHandler


    {
        ICommandService commandService = ( ICommandService ) PlatformUI.getWorkbench().getAdapter(
            ICommandService.class );
        if ( commandService != null )
        {
            IHandler handler = commandService.getCommand( action.getActionDefinitionId() ).getHandler();
            if ( handler instanceof ActionHandler )
            {
                ActionHandler actionHandler = ( ActionHandler ) handler;
                if ( actionHandler != null && actionHandler.getAction() == action )
                {
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

    }
  }

  protected void activateHandler(int operation, String actionDefinitionId) {
    StyledText textWidget = textViewer.getTextWidget();
    IHandler actionHandler = createActionHandler(operation,
        actionDefinitionId);
    IHandlerActivation handlerActivation = handlerService.activateHandler(
        actionDefinitionId, actionHandler,
        new ActiveFocusControlExpression(textWidget));
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 operation
   * @param actionDefinitionId
   */
  protected void activateHandler(int operation, String actionDefinitionId) {
    StyledText textWidget = textViewer.getTextWidget();
    IHandler actionHandler = createActionHandler(operation,
        actionDefinitionId);
    IHandlerActivation handlerActivation = handlerService.activateHandler(
        actionDefinitionId, actionHandler,
        new ActiveFocusControlExpression(textWidget));

View Full Code Here

      if(handlerActivation != null) {
        handlerService.deactivateHandler(handlerActivation);
        handlerActivation = null;
      }
     
      IHandler handler = getHandler(part);
      if(handler != null) {
        handlerActivation = handlerService.activateHandler(commandId, handler);
      }
    }
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

    {
        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

    if (addEntry(entry)) {
      String commandId = ROSTERCOMMAND_PREFIX + getNextCommandIdIndex();
      // Get existing/new command
      Command command = commandService.getCommand(commandId);
      command.define(commandId, null, commandService.getCategory(commandId + ".c")); //$NON-NLS-1$
      IHandler handler = command.getHandler();
      // Only mess with it if it was of old type
      if (handler != null && handler instanceof AbstractRosterMenuHandler) {
        AbstractRosterMenuHandler drh = (AbstractRosterMenuHandler) handler;
        if (drh != null) {
          drh.fireHandlerChangeEvent();
          drh.dispose();
        }
      }
      IHandler newHandler = createRosterEntryHandler(entry);
      command.setHandler(newHandler);
      handlerActivations.add(handlerService.activateHandler(commandId, newHandler));
      return new IContributionItem[] {createCommandContributionItemForEntry(commandId, entry)};
    }
    return NO_CONTRIBUTIONS;
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.