Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.Command


    }
   
    @Override
    public boolean isLinked() {
        LOGGER.fine("");
        Command command = commandService.getCommand(GFM_VIEWER_PLUGIN_LINKED);
        State state = command.getState(RegistryToggleState.STATE_ID);
        return (Boolean) state.getValue();
    }
View Full Code Here


    }

    @Override
    public boolean isOnline() {
        LOGGER.fine("");
        Command command = commandService.getCommand(GFM_VIEWER_PLUGIN_ONLINE);
        State state = command.getState(RegistryToggleState.STATE_ID);
        return (Boolean) state.getValue();
    }
View Full Code Here

    private static Logger LOGGER = Logger.getLogger(Online.class.getPackage().getName());

    @Override
    public Object execute(final ExecutionEvent event) throws ExecutionException {
        // update toggled state
        final Command command = event.getCommand();
        final boolean state = !HandlerUtil.toggleCommandState(command);
        LOGGER.fine("state: " + state);
        return null;
    }
View Full Code Here

    private static Logger LOGGER = Logger.getLogger(Linked.class.getPackage().getName());

    @Override
    public Object execute(final ExecutionEvent event) throws ExecutionException {
        // update toggled state
        final Command command = event.getCommand();
        final boolean state = !HandlerUtil.toggleCommandState(command);
        LOGGER.fine("state: " + state);
        return null;
    }
View Full Code Here

  }

  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) {
      throw e;
    } catch (CommandException e) {
      EclEmmaUIPlugin.log(e);
    }
View Full Code Here

  }

  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) {
      throw e;
    } catch (CommandException e) {
      EclEmmaUIPlugin.log(e);
    }
View Full Code Here

  public void earlyStartup() {
    // TODO Auto-generated method stub
    String commandId = "org.eclipse.ui.file.save";
    ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
    Command command = service.getCommand(commandId);
    command.addExecutionListener(new IExecutionListener() {
     
      public void preExecute(String commandId, ExecutionEvent event) {
        // TODO Auto-generated method stub
       
      }
View Full Code Here

        IWorkbenchPage page =
          PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          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

        IWorkbenchPage page =
          PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          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

  @Override
  public Object function (Object[] arguments) {
    try {
      IHandlerService handlerService = (IHandlerService) serviceLocator.getService(IHandlerService.class);
      ICommandService commandService = (ICommandService) serviceLocator.getService(ICommandService.class);
      Command showView = commandService.getCommand(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW);
      IParameter parm1 = showView.getParameter(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_PARM_ID);
      Parameterization parmId1 = new Parameterization(parm1, HttpRequestView.ID);
      IParameter parm2 = showView.getParameter(IWorkbenchCommandConstants.VIEWS_SHOW_VIEW_SECONDARY_ID);
      Parameterization parmId2 = new Parameterization(parm2, ScannerPerspectiveFactory.HTTP_VIEW_SECONDARY_ID);
      ParameterizedCommand parmCommand = new ParameterizedCommand(showView, new Parameterization[] { parmId1, parmId2 });
      handlerService.executeCommand(parmCommand, null);

      IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(HttpRequestView.ID, ScannerPerspectiveFactory.HTTP_VIEW_SECONDARY_ID, IWorkbenchPage.VIEW_VISIBLE);
View Full Code Here

TOP

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

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.