本文整理汇总了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());
}
示例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