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


Java ConfigurationContext.getFromContext方法代码示例

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


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

示例1: perform

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

import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
public ConfigurationContext createContext(@NotNull PsiElement psiClass, @NotNull MapDataContext dataContext) {
  dataContext.put(CommonDataKeys.PROJECT, myProject);
  if (LangDataKeys.MODULE.getData(dataContext) == null) {
    dataContext.put(LangDataKeys.MODULE, ModuleUtilCore.findModuleForPsiElement(psiClass));
  }
  dataContext.put(Location.DATA_KEY, PsiLocation.fromPsiElement(psiClass));
  return ConfigurationContext.getFromContext(dataContext);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BaseConfigurationTestCase.java

示例3: update

import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Override
public void update(@NotNull AnActionEvent e) {
  final Presentation presentation = e.getPresentation();
  if (!CCProjectService.setCCActionAvailable(e)) {
    presentation.setEnabledAndVisible(false);
    return;
  }

  presentation.setEnabledAndVisible(false);

  final ConfigurationContext context = ConfigurationContext.getFromContext(e.getDataContext());
  Location location = context.getLocation();
  if (location == null) {
    return;
  }
  PsiElement psiElement = location.getPsiElement();
  PsiFile psiFile = psiElement.getContainingFile();
  Project project = e.getProject();
  if (project == null || psiFile == null) {
    return;
  }
  TaskFile taskFile = CCProjectService.getInstance(project).getTaskFile(psiFile.getVirtualFile());
  if (taskFile == null) {
    return;
  }
  if (psiFile.getName().contains(".answer")) {
    presentation.setEnabledAndVisible(true);
    presentation.setText("Run tests from '" + FileUtil.getNameWithoutExtension(psiFile.getName()) + "'");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:CCRunTestsAction.java

示例4: createContextFromPsi

import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
protected ConfigurationContext createContextFromPsi(PsiElement element) {
  final MapDataContext dataContext = new MapDataContext();
  dataContext.put(CommonDataKeys.PROJECT, getProject());
  dataContext.put(LangDataKeys.MODULE, ModuleUtil.findModuleForPsiElement(element));
  dataContext.put(Location.DATA_KEY, PsiLocation.fromPsiElement(element));
  return ConfigurationContext.getFromContext(dataContext);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:8,代码来源:BlazeRunConfigurationProducerTestCase.java

示例5: createContextFromMultipleElements

import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
protected ConfigurationContext createContextFromMultipleElements(PsiElement[] elements) {
  final MapDataContext dataContext = new MapDataContext();
  dataContext.put(CommonDataKeys.PROJECT, getProject());
  dataContext.put(LangDataKeys.MODULE, ModuleUtil.findModuleForPsiElement(elements[0]));
  dataContext.put(Location.DATA_KEY, PsiLocation.fromPsiElement(elements[0]));
  dataContext.put(LangDataKeys.PSI_ELEMENT_ARRAY, elements);
  return ConfigurationContext.getFromContext(dataContext);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:9,代码来源:BlazeRunConfigurationProducerTestCase.java

示例6: actionPerformed

import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
public void actionPerformed(@NotNull AnActionEvent e) {
  final ConfigurationContext context = ConfigurationContext.getFromContext(e.getDataContext());
  run(context);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:CCRunTestsAction.java


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