Package org.eclipse.jface.commands

Examples of org.eclipse.jface.commands.ActionHandler


          handlerService.deactivateHandlers(handlerActivations);
        }

        public void focusGained(FocusEvent e) {
          IAction action= (IAction)fGlobalActions.get(ITextEditorActionConstants.REDO);
          handlerActivations.add(handlerService.activateHandler(IWorkbenchCommandConstants.EDIT_REDO, new ActionHandler(action), expression));
          action= (IAction)fGlobalActions.get(ITextEditorActionConstants.UNDO);
          handlerActivations.add(handlerService.activateHandler(IWorkbenchCommandConstants.EDIT_UNDO, new ActionHandler(action), expression));
          action= (IAction)fGlobalActions.get(ITextEditorActionConstants.CONTENT_ASSIST);
          handlerActivations.add(handlerService.activateHandler(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new ActionHandler(action), expression));
        }
      });

      TextViewerAction action= new TextViewerAction(fPatternEditor, ITextOperationTarget.UNDO);
      action.setText(TemplatesMessages.EditTemplateDialog_undo);
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

                    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

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

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

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

        if (cutAction != null) {
          cutAction.update();
          cutHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_CUT,
              new ActionHandler(cutAction),
              new ActiveShellExpression(getParent().getShell()));
        }
        copyAction.update();

        copyHandlerActivation = service.activateHandler(
            IWorkbenchCommandConstants.EDIT_COPY,
            new ActionHandler(copyAction),
            new ActiveShellExpression(getParent().getShell()));
        if (pasteAction != null)
          this.pasteHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_PASTE,
              new ActionHandler(pasteAction),
              new ActiveShellExpression(getParent().getShell()));
        selectAllHandlerActivation = service.activateHandler(
            IWorkbenchCommandConstants.EDIT_SELECT_ALL,
            new ActionHandler(selectAllAction),
            new ActiveShellExpression(getParent().getShell()));
        if (undoAction != null)
          undoHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_UNDO,
              new ActionHandler(undoAction),
              new ActiveShellExpression(getParent().getShell()));
        if (redoAction != null)
          redoHandlerActivation = service.activateHandler(
              IWorkbenchCommandConstants.EDIT_REDO,
              new ActionHandler(redoAction),
              new ActiveShellExpression(getParent().getShell()));
        if (quickFixActionHandler != null)
          quickFixHandlerActivation = getHandlerService().activateHandler(
              quickFixActionHandler.getAction().getActionDefinitionId(),
              quickFixActionHandler,
View Full Code Here

        textOperationTarget.doOperation(ISourceViewer.QUICK_ASSIST);
      }
    };
    quickFixAction
    .setActionDefinitionId(ITextEditorActionDefinitionIds.QUICK_ASSIST);
    return new ActionHandler(quickFixAction);
  }
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.