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


Java RunnerAndConfigurationSettings.setName方法代码示例

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


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

示例1: setupConfigurationFromContext

import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Override
protected boolean setupConfigurationFromContext(TestNGConfiguration configuration,
                                                ConfigurationContext context,
                                                Ref<PsiElement> sourceElement) {
  final PsiElement element = context.getPsiLocation();
  final PsiFile containingFile = element != null ? element.getContainingFile() : null;
  if (containingFile == null) return false;
  final VirtualFile virtualFile = containingFile.getVirtualFile();
  if (virtualFile == null || !virtualFile.isValid()) return false;
  if (!TestNGUtil.isTestngXML(virtualFile)) return false;
  RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(context);
  setupConfigurationModule(context, configuration);
  final Module originalModule = configuration.getConfigurationModule().getModule();
  configuration.getPersistantData().SUITE_NAME = virtualFile.getPath();
  configuration.getPersistantData().TEST_OBJECT = TestType.SUITE.getType();
  configuration.restoreOriginalModule(originalModule);
  configuration.setGeneratedName();
  settings.setName(configuration.getName());
  sourceElement.set(containingFile);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AbstractTestNGSuiteConfigurationProducer.java

示例2: fillRunnerAndConfigurationSettings

import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
private void fillRunnerAndConfigurationSettings(@NotNull final RunnerAndConfigurationSettings runnerAndConfigurationSettings,
                                                final boolean debugMode, @NotNull final SpecificationNode specificationNode) {

    runnerAndConfigurationSettings.setTemporary(false);

    // True to active the "Run" ToolWindow
    runnerAndConfigurationSettings.setActivateToolWindowBeforeRun(debugMode);

    // True to show the "run configuration UI" before launching LivingDoc
    runnerAndConfigurationSettings.setEditBeforeRun(debugMode);
    runnerAndConfigurationSettings.setName(specificationNode.getNodeName());
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:13,代码来源:ExecuteSpecificationAction.java

示例3: setupConfigurationFromContext

import com.intellij.execution.RunnerAndConfigurationSettings; //导入方法依赖的package包/类
@Override
protected boolean setupConfigurationFromContext(TestNGConfiguration configuration,
                                                ConfigurationContext context,
                                                Ref<PsiElement> sourceElement) {
  if (RunConfigurationProducer.getInstance(AbstractTestNGPatternConfigurationProducer.class).isMultipleElementsSelected(context)) {
    return false;
  }

  final Location contextLocation = context.getLocation();
  setupConfigurationParamName(configuration, contextLocation);

  PsiClass psiClass = null;
  PsiElement element = context.getPsiLocation();
  while (element != null) {
    if (element instanceof PsiClass && isTestNGClass((PsiClass)element)) {
      psiClass = (PsiClass)element;
      break;
    }
    else if (element instanceof PsiMember) {
      psiClass = ((PsiMember)element).getContainingClass();
      if (isTestNGClass(psiClass)) {
        break;
      }
    }
    else if (element instanceof PsiClassOwner) {
      final PsiClass[] classes = ((PsiClassOwner)element).getClasses();
      if (classes.length == 1) {
        psiClass = classes[0];
        break;
      }
    }
    element = element.getParent();
  }
  if (!isTestNGClass(psiClass)) return false;

  myPsiElement = psiClass;
  final Project project = context.getProject();
  RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(context);
  setupConfigurationModule(context, configuration);
  final Module originalModule = configuration.getConfigurationModule().getModule();
  configuration.setClassConfiguration(psiClass);

  PsiMethod method = PsiTreeUtil.getParentOfType(context.getPsiLocation(), PsiMethod.class, false);
  while (method != null) {
    if (TestNGUtil.hasTest(method)) {
      configuration.setMethodConfiguration(PsiLocation.fromPsiElement(project, method));
      myPsiElement = method;
    }
    method = PsiTreeUtil.getParentOfType(method, PsiMethod.class);
  }

  configuration.restoreOriginalModule(originalModule);
  settings.setName(configuration.getName());
  sourceElement.set(myPsiElement);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:57,代码来源:AbstractTestNGInClassConfigurationProducer.java


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