当前位置: 首页>>代码示例>>Java>>正文


Java RunManagerEx.setTemporaryConfiguration方法代码示例

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


在下文中一共展示了RunManagerEx.setTemporaryConfiguration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: perform

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Override
protected void perform(@NotNull Project project,
                       @NotNull ProjectSystemId projectSystemId,
                       @NotNull TaskData taskData,
                       @NotNull AnActionEvent e) {
  final ExternalTaskExecutionInfo taskExecutionInfo = ExternalSystemActionUtil.buildTaskInfo(taskData);
  ExternalSystemUtil.runTask(taskExecutionInfo.getSettings(), taskExecutionInfo.getExecutorId(), project, projectSystemId);

  final DataContext dataContext = e.getDataContext();
  final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
  RunnerAndConfigurationSettings configuration = context.findExisting();
  RunManagerEx runManager = (RunManagerEx)context.getRunManager();
  if (configuration == null) {
    configuration = context.getConfiguration();
    if (configuration == null) {
      return;
    }
    runManager.setTemporaryConfiguration(configuration);
  }
  runManager.setSelectedConfiguration(configuration);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:RunExternalSystemTaskAction.java

示例2: connectInDebugMode

import com.intellij.execution.RunManagerEx; //导入方法依赖的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

示例3: actionPerformed

import com.intellij.execution.RunManagerEx; //导入方法依赖的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

示例4: actionPerformed

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Override
public void actionPerformed(@NotNull final AnActionEvent e) {
  final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
  ExecuteGradleTaskHistoryService historyService = ExecuteGradleTaskHistoryService.getInstance(project);
  GradleRunTaskDialog dialog = new GradleRunTaskDialog(project, historyService.getHistory());
  String lastWorkingDirectory = historyService.getWorkDirectory();
  if (lastWorkingDirectory.length() == 0) {
    lastWorkingDirectory = obtainAppropriateWorkingDirectory(e);
  }

  dialog.setWorkDirectory(lastWorkingDirectory);

  if (StringUtil.isEmptyOrSpaces(historyService.getCanceledCommand())) {
    if (historyService.getHistory().size() > 0) {
      dialog.setCommandLine(historyService.getHistory().get(0));
    }
  }
  else {
    dialog.setCommandLine(historyService.getCanceledCommand());
  }

  if (!dialog.showAndGet()) {
    historyService.setCanceledCommand(dialog.getCommandLine());
    return;
  }

  historyService.setCanceledCommand(null);

  String fullCommandLine = dialog.getCommandLine();
  fullCommandLine = fullCommandLine.trim();

  String workDirectory = dialog.getWorkDirectory();

  historyService.addCommand(fullCommandLine, workDirectory);

  final ExternalTaskExecutionInfo taskExecutionInfo;
  try {
    taskExecutionInfo = buildTaskInfo(workDirectory, fullCommandLine);
  }
  catch (CommandLineArgumentException ex) {
    final NotificationData notificationData = new NotificationData(
      "<b>Command-line arguments cannot be parsed</b>",
      "<i>" + fullCommandLine + "</i> \n" + ex.getMessage(),
      NotificationCategory.WARNING, NotificationSource.TASK_EXECUTION
    );
    notificationData.setBalloonNotification(true);
    ExternalSystemNotificationManager.getInstance(project).showNotification(GradleConstants.SYSTEM_ID, notificationData);
    return;
  }
  RunManagerEx runManager = RunManagerEx.getInstanceEx(project);

  ExternalSystemUtil.runTask(taskExecutionInfo.getSettings(), taskExecutionInfo.getExecutorId(), project, GradleConstants.SYSTEM_ID);

  RunnerAndConfigurationSettings configuration =
    ExternalSystemUtil.createExternalSystemRunnerAndConfigurationSettings(taskExecutionInfo.getSettings(),
                                                                          project, GradleConstants.SYSTEM_ID);
  if (configuration == null) return;

  final RunnerAndConfigurationSettings existingConfiguration = runManager.findConfigurationByName(configuration.getName());
  if(existingConfiguration == null) {
    runManager.setTemporaryConfiguration(configuration);
  } else {
    runManager.setSelectedConfiguration(existingConfiguration);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:66,代码来源:GradleExecuteTaskAction.java


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