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


Java RunManagerEx.getBeforeRunTasks方法代码示例

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


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

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

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

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

示例4: doIsSelected

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@Override
protected boolean doIsSelected(AnActionEvent e) {
  final DataContext context = e.getDataContext();
  final Pair<MavenProject, String> desc = getTaskDesc(context);
  if (desc != null) {
    final RunManagerEx runManager = getRunManager(context);
    if(runManager == null) return false;
    for (MavenBeforeRunTask each : runManager.getBeforeRunTasks(MavenBeforeRunTasksProvider.ID)) {
      if (each.isFor(desc.first, desc.second)) return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ToggleBeforeRunTaskAction.java

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

示例6: getBuildTasks

import com.intellij.execution.RunManagerEx; //导入方法依赖的package包/类
@NotNull
@Override
protected List<? extends BeforeRunTask> getBuildTasks(
    RunManagerEx runManager, RunConfiguration configuration) {
  return runManager.getBeforeRunTasks(configuration, MavenBeforeRunTasksProvider.ID);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:7,代码来源:MavenBuildDeploymentSourceType.java


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