Examples of ExecutionEvent


Examples of org.eclipse.core.commands.ExecutionEvent

    return new ExecutionEvent(command, null, event, getCurrentState());
  }

  public ExecutionEvent createExecutionEvent(
      final ParameterizedCommand command, final Event event) {
    return new ExecutionEvent(command.getCommand(), command
        .getParameterMap(), event, getCurrentState());
  }
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

  public final Object executeCommand(final String commandId,
      final Event trigger) throws ExecutionException,
      NotDefinedException, NotEnabledException, NotHandledException {
    final Command command = commandService.getCommand(commandId);
    final ExecutionEvent event = new ExecutionEvent(command,
        Collections.EMPTY_MAP, trigger, getCurrentState());
    return command.executeWithChecks(event);
  }
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

   * @see org.eclipse.ui.commands.ICommand#execute(java.util.Map)
   */
  public final Object execute(Map parameterValuesByName)
      throws ExecutionException, NotHandledException {
    try {
      return command.execute(new ExecutionEvent(command,
          (parameterValuesByName == null) ? Collections.EMPTY_MAP
              : parameterValuesByName, null, null));
    } catch (final org.eclipse.core.commands.ExecutionException e) {
      throw new ExecutionException(e);
    } catch (final org.eclipse.core.commands.NotHandledException e) {
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

  @Test
  public void testHandler() {
    long start = System.nanoTime();

    QWickieHandler handler = new QWickieHandler();
    ExecutionEvent event = new ExecutionEvent();
    //    event.getParameters().put(ISources.ACTIVE_EDITOR_NAME, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor());
    //    try {
    //      handler.execute(event);
    //    } catch (ExecutionException e) {
    //    }
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

  private ExecutionEvent exe;
  private CommandEvent event;

  @Before
  public void setUp() {
    exe = new ExecutionEvent(getCommandService().getCommand("something"),
        Collections.EMPTY_MAP, null, null);
    event = new CommandEvent(new DateTime(), exe);
  }
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

    assertSame(exe, event.getExecutionEvent());
  }

  @Override
  protected CommandEvent createEvent(DateTime time) {
    return new CommandEvent(time, new ExecutionEvent(getCommandService()
        .getCommand("something"), Collections.EMPTY_MAP, null, null));
  }
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

  public Object execute(ExecutionEvent event) throws ExecutionException {
    final ICommandService cs = (ICommandService) HandlerUtil.getActiveSite(
        event).getService(ICommandService.class);
    final Command command = cs
        .getCommand(IWorkbenchCommandConstants.FILE_IMPORT);
    final ExecutionEvent importEvent = new ExecutionEvent(command,
        Collections.singletonMap("importWizardId", SessionImportWizard.ID), //$NON-NLS-1$
        event.getTrigger(), event.getApplicationContext());
    try {
      command.executeWithChecks(importEvent);
    } catch (ExecutionException e) {
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

  public Object execute(ExecutionEvent event) throws ExecutionException {
    final ICommandService cs = (ICommandService) HandlerUtil.getActiveSite(
        event).getService(ICommandService.class);
    final Command command = cs
        .getCommand(IWorkbenchCommandConstants.FILE_EXPORT);
    final ExecutionEvent importEvent = new ExecutionEvent(command,
        Collections.singletonMap("exportWizardId", SessionExportWizard.ID), //$NON-NLS-1$
        event.getTrigger(), event.getApplicationContext());
    try {
      command.executeWithChecks(importEvent);
    } catch (ExecutionException e) {
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

    }
  }

  public void run(final IAction action) {
    try {
      execute(new ExecutionEvent());
    } catch (final ExecutionException e) {
      // TODO Do something meaningful and poignant.
    }
  }
View Full Code Here

Examples of org.eclipse.core.commands.ExecutionEvent

          IEditorPart editor = IDE.openEditor(page, file, true);
          ICommandService cmdService = (ICommandService) editor.getSite().getService(ICommandService.class);
          Command format = cmdService.getCommand("org.eclipse.wst.sse.ui.format.document");
          if (format.isDefined()) {
            try {
              format.executeWithChecks(new ExecutionEvent());
            }
            catch(Exception e1){
              }
            }
        } catch (PartInitException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.