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


Java RunManagerEx.getInstanceEx方法代码示例

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


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

示例1: testReusingConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public void testReusingConfiguration() {
  RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
  PsiClass psiClass = findClass(getModule1(), CLASS_NAME);
  PsiPackage psiPackage = JUnitUtil.getContainingPackage(psiClass);

  ConfigurationContext context = createContext(psiClass);
  assertEquals(null, context.findExisting());
  RunnerAndConfigurationSettings testClass = context.getConfiguration();
  runManager.addConfiguration(testClass,  false);
  context = createContext(psiClass);
  assertSame(testClass, context.findExisting());

  runManager.setSelectedConfiguration(testClass);
  context = createContext(psiPackage);
  assertEquals(null, context.findExisting());
  RunnerAndConfigurationSettings testPackage = context.getConfiguration();
  runManager.addConfiguration(testPackage,  false);
  context = createContext(psiPackage);
  assertSame(testPackage, context.findExisting());
  assertSame(testClass, runManager.getSelectedConfiguration());
  runManager.setSelectedConfiguration(context.findExisting());
  assertSame(testPackage, runManager.getSelectedConfiguration());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ContextConfigurationTest.java

示例2: createAndRunConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Override
public void createAndRunConfiguration(@NotNull ServerType<?> serverType, @Nullable RemoteServer<?> remoteServer) {
  DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
  RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
  ConfigurationFactoryEx factory = configurationType.getFactory();
  RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
  factory.onNewConfigurationCreated(settings.getConfiguration());
  DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>)settings.getConfiguration();
  if (remoteServer != null) {
    runConfiguration.setServerName(remoteServer.getName());
  }
  if (RunDialog.editConfiguration(myProject, settings, "Create Deployment Configuration",
                                  DefaultRunExecutor.getRunExecutorInstance())) {
    runManager.addConfiguration(settings, runManager.isConfigurationShared(settings), runManager.getBeforeRunTasks(runConfiguration),
                                false);
    runManager.setSelectedConfiguration(settings);
    ProgramRunnerUtil.executeConfiguration(myProject, settings, DefaultRunExecutor.getRunExecutorInstance());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DeploymentConfigurationManagerImpl.java

示例3: createConfigurationByElement

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Nullable
@Override
protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
  if (!(location instanceof ExternalSystemTaskLocation)) {
    return null;
  }
  
  ExternalSystemTaskLocation taskLocation = (ExternalSystemTaskLocation)location;
  mySourceElement = taskLocation.getPsiElement();

  RunManagerEx runManager = RunManagerEx.getInstanceEx(taskLocation.getProject());
  RunnerAndConfigurationSettings settings = runManager.createConfiguration("", getConfigurationFactory());
  ExternalSystemRunConfiguration configuration = (ExternalSystemRunConfiguration)settings.getConfiguration();
  ExternalSystemTaskExecutionSettings taskExecutionSettings = configuration.getSettings();
  ExternalTaskExecutionInfo task = taskLocation.getTaskInfo();
  taskExecutionSettings.setExternalProjectPath(task.getSettings().getExternalProjectPath());
  taskExecutionSettings.setTaskNames(task.getSettings().getTaskNames());
  configuration.setName(AbstractExternalSystemTaskConfigurationType.generateName(location.getProject(), taskExecutionSettings));
  return settings;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractExternalSystemRuntimeConfigurationProducer.java

示例4: getDescription

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public String getDescription(MavenProject project, String goal) {
  List<String> result = new ArrayList<String>();
  MavenCompilerTask compilerTask = new MavenCompilerTask(project.getPath(), goal);
  synchronized (this) {
    for (Phase phase : Phase.values()) {
      if (myState.getTasks(phase).contains(compilerTask)) {
        result.add(TasksBundle.message(phase.myMessageKey));
      }
    }
  }
  RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
  for (MavenBeforeRunTask each : runManager.getBeforeRunTasks(MavenBeforeRunTasksProvider.ID)) {
    if (each.isFor(project, goal)) {
      result.add(TasksBundle.message("maven.tasks.goal.before.run"));
      break;
    }
  }

  return StringUtil.join(result, ", ");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:MavenTasksManager.java

示例5: addConfigurations

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
private void addConfigurations() {
  RunManagerImpl runManager = (RunManagerImpl) RunManagerEx.getInstanceEx(project);
  BlazeCommandRunConfigurationType.BlazeCommandRunConfigurationFactory configurationFactory =
      BlazeCommandRunConfigurationType.getInstance().getFactory();

  BlazeCommandRunConfiguration blazeAndroidBinaryConfiguration =
      configurationFactory.createTemplateConfiguration(project);
  blazeAndroidBinaryConfiguration.setName("AndroidBinaryConfiguration");
  blazeAndroidBinaryConfiguration.setTarget(Label.create("//label:android_binary_rule"));

  BlazeCommandRunConfiguration blazeAndroidTestConfiguration =
      configurationFactory.createTemplateConfiguration(project);
  blazeAndroidTestConfiguration.setName("AndroidTestConfiguration");
  blazeAndroidTestConfiguration.setTarget(Label.create("//label:android_test_rule"));

  runManager.addConfiguration(
      runManager.createConfiguration(blazeAndroidBinaryConfiguration, configurationFactory),
      true);
  runManager.addConfiguration(
      runManager.createConfiguration(blazeAndroidTestConfiguration, configurationFactory), true);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:BlazeConfigurationsTest.java

示例6: setBuildBeforeRunTask

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
/**
 * Creates a pre-deploy task ({@link BeforeRunTask}) for the given build-system and attaches it to
 * this module deployment source type. Invoked when a new deployment configuration is created.
 *
 * <p>Provides the common functionality for creating the build-system packaging task, delegating
 * build-system specific functions to the concrete sub-types.
 *
 * <p>Only creates a new task if one is not already configured.
 */
@Override
public void setBuildBeforeRunTask(
    @NotNull RunConfiguration configuration, @NotNull ModuleDeploymentSource source) {

  Module module = source.getModule();

  if (module == null) {
    return;
  }

  setConfiguration(configuration);

  RunManagerEx runManager = RunManagerEx.getInstanceEx(configuration.getProject());
  final Collection<? extends BeforeRunTask> buildTasks = getBuildTasks(runManager, configuration);

  if (!hasBuildTaskForModule(buildTasks, module)) {
    BeforeRunTask buildTask = createBuildTask(module);
    if (buildTask != null) {
      List<BeforeRunTask> tasks = runManager.getBeforeRunTasks(configuration);
      ImmutableList<BeforeRunTask> newTaskList =
          ImmutableList.<BeforeRunTask>builder().addAll(tasks).add(buildTask).build();
      runManager.setBeforeRunTasks(configuration, newTaskList, true);
    }
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:35,代码来源:BuildDeploymentSourceType.java

示例7: performAction

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Override
protected void performAction(AnActionEvent e) {
	Project project = e.getProject();
	if (project == null) {
		throw new NotificationException("No project found", "Are you in any project?");
	}

	RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
	RunnerAndConfigurationSettings selectedConfiguration = runManager.getSelectedConfiguration();
	if (selectedConfiguration == null) {
		return;
	}
	RunConfiguration configuration = selectedConfiguration.getConfiguration();
	if (configuration instanceof TaskConfiguration) {
		removeFiles(project, (TaskConfiguration) configuration);
		runManager.removeConfiguration(selectedConfiguration);
		selectSomeTaskConfiguration(runManager);
	}
	else {
		Notificator.showNotification(
				"Not a JHelper configuration",
				"To delete a configuration you should choose it first",
				NotificationType.WARNING
		);
	}
}
 
开发者ID:AlexeyDmitriev,项目名称:JHelper,代码行数:27,代码来源:DeleteTaskAction.java

示例8: getDescription

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public String getDescription(MavenProject project, String goal) {
  List<String> result = new ArrayList<String>();
  MavenCompilerTask compilerTask = new MavenCompilerTask(project.getPath(), goal);
  synchronized (this) {
    if (myState.beforeCompileTasks.contains(compilerTask)) {
      result.add(TasksBundle.message("maven.tasks.goal.before.compile"));
    }
    if (myState.afterCompileTasks.contains(compilerTask)) {
      result.add(TasksBundle.message("maven.tasks.goal.after.compile"));
    }
  }
  RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
  for (MavenBeforeRunTask each : runManager.getBeforeRunTasks(MavenBeforeRunTasksProvider.ID)) {
    if (each.isFor(project, goal)) {
      result.add(TasksBundle.message("maven.tasks.goal.before.run"));
      break;
    }
  }

  return StringUtil.join(result, ", ");
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:MavenTasksManager.java

示例9: ensureRunConfigurationExists

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
protected static void ensureRunConfigurationExists(Module module, ConfigurationType configurationType, String name) {
  final RunManagerEx runManager = RunManagerEx.getInstanceEx(module.getProject());
  for (final RunConfiguration runConfiguration : runManager.getConfigurations(configurationType)) {
    if (runConfiguration instanceof MvcRunConfiguration && ((MvcRunConfiguration)runConfiguration).getModule() == module) {
      return;
    }
  }

  final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
  final RunnerAndConfigurationSettings runSettings = runManager.createRunConfiguration(name,
                                                                                                                               factory);
  final MvcRunConfiguration configuration = (MvcRunConfiguration)runSettings.getConfiguration();
  configuration.setModule(module);
  runManager.addConfiguration(runSettings, false);
  runManager.setActiveConfiguration(runSettings);

  RunManagerEx.disableTasks(module.getProject(), configuration, CompileStepBeforeRun.ID, CompileStepBeforeRunNoErrorCheck.ID);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:MvcFramework.java

示例10: handleDoubleClickOrEnter

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Override
public void handleDoubleClickOrEnter(SimpleTree tree, InputEvent inputEvent) {
  final Project project = getExternalProjectsView().getProject();
  ProgramRunnerUtil.executeConfiguration(project, mySettings, DefaultRunExecutor.getRunExecutorInstance());
  final RunManagerEx runManagerEx = RunManagerEx.getInstanceEx(project);
  runManagerEx.setSelectedConfiguration(mySettings);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RunConfigurationNode.java

示例11: createConfiguration

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
private static TestNGConfiguration createConfiguration(final Project project) {
  final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
  final RunnerAndConfigurationSettings settings =
    manager.createRunConfiguration("testt", TestNGConfigurationType.getInstance().getConfigurationFactories()[0]);
  manager.addConfiguration(settings, false);
  return (TestNGConfiguration)settings.getConfiguration();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ConfigurationsTest.java

示例12: handleTargetRename

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public void handleTargetRename(String oldName, String newName) {
  final RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
  for (AntBeforeRunTask task : runManager.getBeforeRunTasks(ID)) {
    if (oldName.equals(task.getTargetName())) {
      task.setTargetName(newName);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AntBeforeRunTaskProvider.java

示例13: doDebug

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
public void doDebug(Project project, ServerConnectionManager connectionManager) {
    RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
    if(runManager != null) {
        connectionManager.connectInDebugMode(runManager);
    } else {
        getMessageManager(project).showAlert("action.debug.configuration.failure");
    }
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:9,代码来源:StartDebugConnectionAction.java

示例14: 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

示例15: getRunManager

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Nullable
private static RunManagerEx getRunManager(DataContext context) {
  final Project project = MavenActionUtil.getProject(context);
  if(project == null) return null;
  return RunManagerEx.getInstanceEx(project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ToggleBeforeRunTaskAction.java


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