• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExecutionUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.execution.runners.ExecutionUtil的典型用法代码示例。如果您正苦于以下问题:Java ExecutionUtil类的具体用法?Java ExecutionUtil怎么用?Java ExecutionUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExecutionUtil类属于com.intellij.execution.runners包,在下文中一共展示了ExecutionUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setConfigurationIcon

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
private static void setConfigurationIcon(final Presentation presentation,
                                         final RunnerAndConfigurationSettings settings,
                                         final Project project) {
  try {
    Icon icon = RunManagerEx.getInstanceEx(project).getConfigurationIcon(settings);
    ExecutionManagerImpl executionManager = ExecutionManagerImpl.getInstance(project);
    List<RunContentDescriptor> runningDescriptors = executionManager.getRunningDescriptors(new Condition<RunnerAndConfigurationSettings>() {
        @Override
        public boolean value(RunnerAndConfigurationSettings s) {
          return s == settings;
        }
      });
    if (runningDescriptors.size() == 1) {
      icon = ExecutionUtil.getLiveIndicator(icon);
    }
    if (runningDescriptors.size() > 1) {
      icon = IconUtil.addText(icon, String.valueOf(runningDescriptors.size()));
    }
    presentation.setIcon(icon);
  }
  catch (IndexNotReadyException ignored) {
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:RunConfigurationsComboBoxAction.java


示例2: executeBeforeRunTask

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public boolean executeBeforeRunTask(ExecutionEnvironment env) {
  executableToDebug = null;
  if (!isDebugging(env)) {
    return true;
  }
  try {
    File executable = getExecutableToDebug();
    if (executable != null) {
      executableToDebug = executable;
      return true;
    }
  } catch (ExecutionException e) {
    ExecutionUtil.handleExecutionError(
        env.getProject(), env.getExecutor().getToolWindowId(), env.getRunProfile(), e);
  }
  return false;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:19,代码来源:BlazeCidrRunConfigurationRunner.java


示例3: executeBeforeRunTask

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public boolean executeBeforeRunTask(ExecutionEnvironment env) {
  if (!isDebugging(env)) {
    return true;
  }
  env.getCopyableUserData(EXECUTABLE_KEY).set(null);
  try {
    File executable = getExecutableToDebug(env);
    env.getCopyableUserData(EXECUTABLE_KEY).set(executable);
    if (executable != null) {
      return true;
    }
  } catch (ExecutionException e) {
    ExecutionUtil.handleExecutionError(
        env.getProject(), env.getExecutor().getToolWindowId(), env.getRunProfile(), e);
  }
  return false;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:19,代码来源:BlazePyRunConfigurationRunner.java


示例4: getInformativeIcon

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
private Icon getInformativeIcon(Project project, final RunnerAndConfigurationSettings selectedConfiguration) {
  final ExecutionManagerImpl executionManager = ExecutionManagerImpl.getInstance(project);

  List<RunContentDescriptor> runningDescriptors = executionManager.getRunningDescriptors(s -> s == selectedConfiguration);
  runningDescriptors = ContainerUtil.filter(runningDescriptors, descriptor -> {
    RunContentDescriptor contentDescriptor = executionManager.getContentManager().findContentDescriptor(myExecutor, descriptor.getProcessHandler());
    return contentDescriptor != null && executionManager.getExecutors(contentDescriptor).contains(myExecutor);
  });

  if (!runningDescriptors.isEmpty() && DefaultRunExecutor.EXECUTOR_ID.equals(myExecutor.getId()) && selectedConfiguration.isSingleton()) {
    return AllIcons.Actions.Restart;
  }
  if (runningDescriptors.isEmpty()) {
    return myExecutor.getIcon();
  }

  if (runningDescriptors.size() == 1) {
    return ExecutionUtil.getLiveIndicator(myExecutor.getIcon());
  }
  else {
    return IconUtil.addText(myExecutor.getIcon(), String.valueOf(runningDescriptors.size()));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ExecutorRegistryImpl.java


示例5: setConfigurationIcon

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
private static void setConfigurationIcon(final Presentation presentation,
                                         final RunnerAndConfigurationSettings settings,
                                         final Project project) {
  try {
    Icon icon = RunManagerEx.getInstanceEx(project).getConfigurationIcon(settings);
    ExecutionManagerImpl executionManager = ExecutionManagerImpl.getInstance(project);
    List<RunContentDescriptor> runningDescriptors = executionManager.getRunningDescriptors(new Condition<RunnerAndConfigurationSettings>() {
      @Override
      public boolean value(RunnerAndConfigurationSettings s) {
        return s == settings;
      }
    });
    if (runningDescriptors.size() == 1) {
      icon = ExecutionUtil.getLiveIndicator(icon);
    }
    if (runningDescriptors.size() > 1) {
      icon = IconUtil.addText(icon, String.valueOf(runningDescriptors.size()));
    }
    presentation.setIcon(icon);
  }
  catch (IndexNotReadyException ignored) {
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:RunConfigurationsComboBoxAction.java


示例6: onChosen

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public PopupStep onChosen(final ConfigurationActionsStep selectedValue, boolean finalChoice) {
  if (finalChoice) {
    return doFinalStep(new Runnable() {
      @Override
      public void run() {
        RunnerAndConfigurationSettings settings = selectedValue.getSettings();
        RunManagerEx.getInstanceEx(myProject).setSelectedConfiguration(settings);
        ExecutionUtil.runConfiguration(settings, myExecutorProvider.getExecutor());
      }
    });
  }
  else {
    return selectedValue;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:ChooseRunConfigurationPopup.java


示例7: perform

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
protected void perform(final ConfigurationContext context) {
  RunnerAndConfigurationSettings configuration = context.findExisting();
  final RunManagerEx runManager = (RunManagerEx)context.getRunManager();
  if (configuration == null) {
    configuration = context.getConfiguration();
    if (configuration == null) {
      return;
    }
    runManager.setTemporaryConfiguration(configuration);
  }
  runManager.setSelectedConfiguration(configuration);

  ExecutionUtil.runConfiguration(configuration, myExecutor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RunContextAction.java


示例8: editConfiguration

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
void editConfiguration(@NotNull final Project project, @NotNull final RunnerAndConfigurationSettings configuration) {
  final Executor executor = getExecutor();
  PropertiesComponent.getInstance().setValue("run.configuration.edit.ad", Boolean.toString(true));
  if (RunDialog.editConfiguration(project, configuration, "Edit configuration settings", executor)) {
    RunManagerEx.getInstanceEx(project).setSelectedConfiguration(configuration);
    ExecutionUtil.runConfiguration(configuration, executor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ChooseRunConfigurationPopup.java


示例9: perform

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public void perform(@NotNull Project project, @NotNull Executor executor, @NotNull DataContext context) {
  RunnerAndConfigurationSettings selectedConfiguration = RunManagerEx.getInstanceEx(project).getSelectedConfiguration();
  if (myConfigurations.contains(selectedConfiguration)) {
    RunManagerEx.getInstanceEx(project).setSelectedConfiguration(selectedConfiguration);
    ExecutionUtil.runConfiguration(selectedConfiguration, myExecutorProvider.getExecutor());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ChooseRunConfigurationPopup.java


示例10: onChosen

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public PopupStep onChosen(final ConfigurationActionsStep selectedValue, boolean finalChoice) {
  if (finalChoice) {
    return doFinalStep(new Runnable() {
      @Override
      public void run() {
        RunnerAndConfigurationSettings settings = selectedValue.getSettings();
        RunManagerEx.getInstanceEx(myProject).setSelectedConfiguration(settings);
        ExecutionUtil.runConfiguration(settings, myExecutorProvider.getExecutor());
      }
    });
  } else {
    return selectedValue;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ChooseRunConfigurationPopup.java


示例11: checkDdms

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
private boolean checkDdms() {
  AndroidDebugBridge bridge = AndroidDebugBridge.getBridge();
  if (myDebugMode && bridge != null && AdbService.canDdmsBeCorrupted(bridge)) {
    message(AndroidBundle.message("ddms.corrupted.error"), STDERR);
    JComponent component = myConsole == null ? null : myConsole.getComponent();
    if (component != null) {
      final ExecutionEnvironment environment = LangDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component));
      if (environment == null) {
        return false;
      }

      myConsole.printHyperlink(AndroidBundle.message("restart.adb.fix.text"), new HyperlinkInfo() {
        @Override
        public void navigate(Project project) {
          AdbService.getInstance().restartDdmlib(project);

          final ProcessHandler processHandler = getProcessHandler();
          if (!processHandler.isProcessTerminated()) {
            processHandler.destroyProcess();
          }
          ExecutionUtil.restart(environment);
        }
      });
      myConsole.print("\n", ConsoleViewContentType.NORMAL_OUTPUT);
    }
    return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:AndroidRunningState.java


示例12: ensureRunnerConfigured

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public boolean ensureRunnerConfigured(@Nullable Module module, RunProfile profile, Executor executor, final Project project) throws ExecutionException {
  if (module == null) {
    throw new ExecutionException("Module is not specified");
  }

  if (LibrariesUtil.getGroovyHomePath(module) == null) {
    ExecutionUtil.handleExecutionError(project, executor.getToolWindowId(), profile, new ExecutionException("Groovy is not configured"));
    ModulesConfigurator.showDialog(module.getProject(), module.getName(), ClasspathEditor.NAME);
    return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DefaultGroovyScriptRunner.java


示例13: executeBeforeRunTask

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public boolean executeBeforeRunTask(ExecutionEnvironment env) {
  try {
    ClassFileManifestBuilder.buildManifest(env, null);
    return true;
  } catch (ExecutionException e) {
    ExecutionUtil.handleExecutionError(
        env.getProject(), env.getExecutor().getToolWindowId(), env.getRunProfile(), e);
    logger.info(e);
  }
  return false;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:13,代码来源:BlazeJavaRunConfigurationHandler.java


示例14: connectInDebugMode

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
public void connectInDebugMode(RunManagerEx runManager) {
    ServerConfiguration serverConfiguration = selectionHandler.getCurrentConfiguration();
    // Create Remote Connection to Server using the IntelliJ Run / Debug Connection
    //AS TODO: It is working but the configuration is listed and made persistent. That is not too bad because
    //AS TODO: after changes a reconnect will update the configuration.
    RemoteConfigurationType remoteConfigurationType = new RemoteConfigurationType();
    RunConfiguration runConfiguration = remoteConfigurationType.getFactory().createTemplateConfiguration(myProject);
    RemoteConfiguration remoteConfiguration = (RemoteConfiguration) runConfiguration;
    // Server means if you are listening. If not you are attaching.
    remoteConfiguration.SERVER_MODE = false;
    remoteConfiguration.USE_SOCKET_TRANSPORT = true;
    remoteConfiguration.HOST = serverConfiguration.getHost();
    remoteConfiguration.PORT = serverConfiguration.getConnectionDebugPort() + "";
    // Set a Name of the Configuration so that it is properly listed.
    remoteConfiguration.setName(serverConfiguration.getName());
    RunnerAndConfigurationSettings configuration = new RunnerAndConfigurationSettingsImpl(
        (RunManagerImpl) runManager,
        runConfiguration,
        false
    );
    runManager.setTemporaryConfiguration(configuration);
    //AS TODO: Make sure that this is the proper way to obtain the DEBUG Executor
    Executor executor = ExecutorRegistry.getInstance().getExecutorById(ToolWindowId.DEBUG);
    ExecutionUtil.runConfiguration(configuration, executor);
    // Update the Modules with the Remote Sling Server
    OsgiClient osgiClient = obtainOSGiClient();
    if(osgiClient != null) {
        BundleStatus status = checkAndUpdateSupportBundle(false);
        if(status != BundleStatus.failed) {
            checkModules(osgiClient);
        }
    }
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:34,代码来源:ServerConnectionManager.java


示例15: actionPerformed

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    final DataContext dataContext = e.getDataContext();
    final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
    if (context.getLocation() == null) return;
    final RunManagerEx runManager = (RunManagerEx) context.getRunManager();
    RunnerAndConfigurationSettings setting = context.getConfiguration();
    if (setting == null || setting.getConfiguration() == null || !(setting.getConfiguration() instanceof PTestRunConfiguration)) {
        ConfigurationFromContext config = CONFIG_PRODUCER.createConfigurationFromContext(context);
        if (config == null) return;
        setting = config.getConfigurationSettings();
        runManager.setTemporaryConfiguration(setting);
    } else {
        boolean hasExistingSetting = false;
        for (RunnerAndConfigurationSettings existingSetting : runManager.getConfigurationSettingsList(new PTestConfigurationType())) {
            if (existingSetting.equals(setting)) {
                hasExistingSetting = true;
                break;
            }
        }
        if (!hasExistingSetting) {
            runManager.setTemporaryConfiguration(setting);
        }
    }
    runManager.setSelectedConfiguration(setting);

    ExecutionUtil.runConfiguration(setting, myExecutor);
}
 
开发者ID:KarlGong,项目名称:ptest-pycharm-plugin,代码行数:29,代码来源:PTestRunLineMarkerAction.java


示例16: runWithConfiguration

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@NotNull
protected OSProcessHandler runWithConfiguration(RunConfiguration configuration) throws ExecutionException {
  final PantsJUnitRunnerAndConfigurationSettings runnerAndConfigurationSettings =
    new PantsJUnitRunnerAndConfigurationSettings(configuration);
  final ExecutionEnvironmentBuilder environmentBuilder =
    ExecutionUtil.createEnvironment(DefaultRunExecutor.getRunExecutorInstance(), runnerAndConfigurationSettings);
  final ExecutionEnvironment environment = environmentBuilder.build();

  ProgramRunnerUtil.executeConfiguration(environment, false, false);
  final OSProcessHandler handler = (OSProcessHandler) environment.getContentToReuse().getProcessHandler();
  assertTrue(handler.waitFor());
  return handler;
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:14,代码来源:PantsIntegrationTestCase.java


示例17: ensureRunnerConfigured

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public boolean ensureRunnerConfigured(@Nullable Module module, RunProfile profile, Executor executor, final Project project) throws ExecutionException {
  if (module == null) {
    throw new ExecutionException("Module is not specified");
  }

  if (LibrariesUtil.getGroovyHomePath(module) == null) {
    ExecutionUtil.handleExecutionError(project, executor.getToolWindowId(), profile, new ExecutionException("Groovy is not configured"));
    ModulesConfigurator.showDialog(module.getProject(), module.getName(), ClasspathEditor.NAME);
    return false;
  }


  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:DefaultGroovyScriptRunner.java


示例18: startDebugSession

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
public void startDebugSession(@Nonnull Project project) {
  XLocalAttachDebugger debugger = getSelectedDebugger();
  UsageTrigger.trigger(ConvertUsagesUtil.ensureProperKey("debugger.attach.local"));
  UsageTrigger.trigger(ConvertUsagesUtil.ensureProperKey("debugger.attach.local." + debugger.getDebuggerDisplayName()));

  try {
    debugger.attachDebugSession(project, myProcessInfo);
  }
  catch (ExecutionException e) {
    ExecutionUtil.handleExecutionError(project, ToolWindowId.DEBUG, myProcessInfo.getExecutableName(), e);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:AttachToLocalProcessAction.java


示例19: editConfiguration

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
void editConfiguration(@Nonnull final Project project, @Nonnull final RunnerAndConfigurationSettings configuration) {
  final Executor executor = getExecutor();
  PropertiesComponent.getInstance().setValue("run.configuration.edit.ad", Boolean.toString(true));
  if (RunDialog.editConfiguration(project, configuration, "Edit configuration settings", executor)) {
    RunManagerEx.getInstanceEx(project).setSelectedConfiguration(configuration);
    ExecutionUtil.runConfiguration(configuration, executor);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ChooseRunConfigurationPopup.java


示例20: perform

import com.intellij.execution.runners.ExecutionUtil; //导入依赖的package包/类
@Override
public void perform(@Nonnull Project project, @Nonnull Executor executor, @Nonnull DataContext context) {
  RunnerAndConfigurationSettings selectedConfiguration = RunManagerEx.getInstanceEx(project).getSelectedConfiguration();
  if (myConfigurations.contains(selectedConfiguration)) {
    RunManagerEx.getInstanceEx(project).setSelectedConfiguration(selectedConfiguration);
    ExecutionUtil.runConfiguration(selectedConfiguration, myExecutorProvider.getExecutor());
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ChooseRunConfigurationPopup.java



注:本文中的com.intellij.execution.runners.ExecutionUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Options类代码示例发布时间:2022-05-23
下一篇:
Java ToolManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap