本文整理汇总了Java中com.intellij.execution.configurations.RunConfigurationModule类的典型用法代码示例。如果您正苦于以下问题:Java RunConfigurationModule类的具体用法?Java RunConfigurationModule怎么用?Java RunConfigurationModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RunConfigurationModule类属于com.intellij.execution.configurations包,在下文中一共展示了RunConfigurationModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJavaParameters
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
@Override
protected JavaParameters createJavaParameters() throws ExecutionException {
final JavaParameters javaParameters = super.createDefaultJavaParameters();
final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
RunConfigurationModule module = getConfiguration().getConfigurationModule();
final Project project = module.getProject();
final SourceScope scope = getSourceScope();
final GlobalSearchScope searchScope = scope != null ? scope.getGlobalSearchScope() : GlobalSearchScope.allScope(project);
addClassesListToJavaParameters(myFailedTests, new Function<AbstractTestProxy, String>() {
@Override
public String fun(AbstractTestProxy testInfo) {
return testInfo != null ? getTestPresentation(testInfo, project, searchScope) : null;
}
}, data.getPackageName(), true, javaParameters);
return javaParameters;
}
示例2: getConfigurationName
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
public static String getConfigurationName(PsiClass aClass, RunConfigurationModule module) {
String qualifiedName = aClass.getQualifiedName();
Project project = module.getProject();
if (qualifiedName == null) {
return module.getModuleName();
}
PsiClass psiClass =
JavaPsiFacade.getInstance(project).findClass(qualifiedName.replace('$', '.'), GlobalSearchScope.projectScope(project));
if (psiClass != null) {
return psiClass.getName();
}
else {
int lastDot = qualifiedName.lastIndexOf('.');
if (lastDot == -1 || lastDot == qualifiedName.length() - 1) {
return qualifiedName;
}
return qualifiedName.substring(lastDot + 1, qualifiedName.length());
}
}
示例3: createConfiguration
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
@Nullable
private RunnerAndConfigurationSettings createConfiguration(@Nullable final PsiClass aClass) {
if (aClass == null) return null;
final Project project = aClass.getProject();
RunnerAndConfigurationSettings settings = RunManagerEx.getInstanceEx(project).createConfiguration("", getConfigurationFactory());
final GroovyScriptRunConfiguration configuration = (GroovyScriptRunConfiguration)settings.getConfiguration();
final PsiFile file = aClass.getContainingFile().getOriginalFile();
final PsiDirectory dir = file.getContainingDirectory();
if (dir != null) {
configuration.setWorkDir(dir.getVirtualFile().getPath());
}
final VirtualFile vFile = file.getVirtualFile();
if (vFile == null) return null;
String path = ScriptFileUtil.getScriptFilePath(vFile);
configuration.setScriptPath(path);
RunConfigurationModule module = configuration.getConfigurationModule();
String name = GroovyRunnerUtil.getConfigurationName(aClass, module);
configuration.setName(StringUtil.isEmpty(name) ? vFile.getName() : name);
configuration.setModule(JavaExecutionUtil.findModule(aClass));
return settings;
}
示例4: getClasspathType
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
public static int getClasspathType(final RunConfigurationModule configurationModule, final String mainClassName,
final boolean classMustHaveSource) throws CantRunException {
final Module module = configurationModule.getModule();
if (module == null) throw CantRunException.noModuleConfigured(configurationModule.getModuleName());
final PsiClass psiClass = JavaExecutionUtil.findMainClass(module, mainClassName);
if (psiClass == null) {
if (!classMustHaveSource) return JavaParameters.JDK_AND_CLASSES_AND_TESTS;
throw CantRunException.classNotFound(mainClassName, module);
}
final PsiFile psiFile = psiClass.getContainingFile();
if (psiFile == null) throw CantRunException.classNotFound(mainClassName, module);
final VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null) throw CantRunException.classNotFound(mainClassName, module);
Module classModule = psiClass.isValid() ? ModuleUtilCore.findModuleForPsiElement(psiClass) : null;
if (classModule == null) classModule = module;
ModuleFileIndex fileIndex = ModuleRootManager.getInstance(classModule).getFileIndex();
if (fileIndex.isInSourceContent(virtualFile)) {
return fileIndex.
isInTestSourceContent(virtualFile) ? JavaParameters.JDK_AND_CLASSES_AND_TESTS : JavaParameters.JDK_AND_CLASSES;
}
final List<OrderEntry> entriesForFile = fileIndex.getOrderEntriesForFile(virtualFile);
for (OrderEntry entry : entriesForFile) {
if (entry instanceof ExportableOrderEntry && ((ExportableOrderEntry)entry).getScope() == DependencyScope.TEST) return JavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
return JavaParameters.JDK_AND_CLASSES;
}
示例5: createConfiguration
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
@Nullable
private RunnerAndConfigurationSettings createConfiguration(@Nullable final PsiClass aClass) {
if (aClass == null) return null;
final Project project = aClass.getProject();
RunnerAndConfigurationSettings settings = RunManagerEx.getInstanceEx(project).createConfiguration("", getConfigurationFactory());
final GroovyScriptRunConfiguration configuration = (GroovyScriptRunConfiguration)settings.getConfiguration();
final PsiFile file = aClass.getContainingFile().getOriginalFile();
final PsiDirectory dir = file.getContainingDirectory();
if (dir == null) return null;
configuration.setWorkDir(dir.getVirtualFile().getPath());
final VirtualFile vFile = file.getVirtualFile();
if (vFile == null) return null;
configuration.setScriptPath(vFile.getPath());
RunConfigurationModule module = configuration.getConfigurationModule();
String name = GroovyRunnerUtil.getConfigurationName(aClass, module);
configuration.setName(name);
configuration.setModule(JavaExecutionUtil.findModule(aClass));
return settings;
}
示例6: findProcessingItemIndexByModule
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
private static int findProcessingItemIndexByModule(ProcessingItem[] items, RunConfigurationModule moduleConfiguration)
{
final Module module = moduleConfiguration.getModule();
if(module == null || module.getModuleDir() == null)
{
return -1;
}
for(int i = 0; i < items.length; ++i)
{
if(module.getModuleDir().equals(items[i].getFile()))
{
return i;
}
}
return -1;
}
示例7: getClasspathType
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
@MagicConstant(valuesFromClass = OwnJavaParameters.class)
public static int getClasspathType(final RunConfigurationModule configurationModule,
final String mainClassName,
final boolean classMustHaveSource,
final boolean includeProvidedDependencies) throws CantRunException
{
final Module module = configurationModule.getModule();
if(module == null)
{
throw CantRunException.noModuleConfigured(configurationModule.getModuleName());
}
Boolean inProduction = isClassInProductionSources(mainClassName, module);
if(inProduction == null)
{
if(!classMustHaveSource)
{
return OwnJavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
throw CantRunException.classNotFound(mainClassName, module);
}
return inProduction ? (includeProvidedDependencies ? OwnJavaParameters.JDK_AND_CLASSES_AND_PROVIDED : OwnJavaParameters.JDK_AND_CLASSES) : OwnJavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
示例8: LuaConfigurationType
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
public LuaConfigurationType() {
myFactory = new ConfigurationFactory(this) {
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new LuaRunConfiguration(new RunConfigurationModule(project), this, "");
}
};
}
示例9: getClasspathType
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
@MagicConstant(valuesFromClass = JavaParameters.class)
public static int getClasspathType(final RunConfigurationModule configurationModule, final String mainClassName,
final boolean classMustHaveSource) throws CantRunException {
final Module module = configurationModule.getModule();
if (module == null) throw CantRunException.noModuleConfigured(configurationModule.getModuleName());
Boolean inProduction = isClassInProductionSources(mainClassName, module);
if (inProduction == null) {
if (!classMustHaveSource) {
return JavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
throw CantRunException.classNotFound(mainClassName, module);
}
return inProduction ? JavaParameters.JDK_AND_CLASSES : JavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
示例10: configureModule
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
public static void configureModule(final RunConfigurationModule runConfigurationModule,
final JavaParameters parameters,
@MagicConstant(valuesFromClass = JavaParameters.class) final int classPathType,
@Nullable String jreHome) throws CantRunException {
Module module = runConfigurationModule.getModule();
if (module == null) {
throw CantRunException.noModuleConfigured(runConfigurationModule.getModuleName());
}
configureModule(module, parameters, classPathType, jreHome);
}
示例11: configureModule
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
public static void configureModule(final RunConfigurationModule runConfigurationModule,
final JavaParameters parameters,
@MagicConstant(valuesFromClass = JavaParameters.class) final int classPathType,
final String jreHome) throws CantRunException {
Module module = runConfigurationModule.getModule();
if (module == null) {
throw CantRunException.noModuleConfigured(runConfigurationModule.getModuleName());
}
configureModule(module, parameters, classPathType, jreHome);
}
示例12: initialize
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
protected void initialize() throws ExecutionException {
super.initialize();
final JUnitConfiguration.Data data = myConfiguration.getPersistentData();
RunConfigurationModule module = myConfiguration.getConfigurationModule();
configureModule(myJavaParameters, module, data.getMainClassName());
myJavaParameters.getProgramParametersList().add(data.getMainClassName());
}
示例13: findProcessingItemIndexByModule
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
private static int findProcessingItemIndexByModule(ProcessingItem[] items, RunConfigurationModule moduleConfiguration) {
final Module module = moduleConfiguration.getModule();
if (module == null || module.getModuleFile() == null) {
return -1;
}
for (int i = 0; i < items.length; ++i) {
if (module.getModuleFile().equals(items[i].getFile())) {
return i;
}
}
return -1;
}
示例14: configureModule
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
private void configureModule(final RunConfigurationModule runConfigurationModule,
final SimpleJavaParameters parameters,
@Nullable String jreHome) throws CantRunException {
Module module = runConfigurationModule.getModule();
if (module == null) {
throw CantRunException.noModuleConfigured(runConfigurationModule.getModuleName());
}
configureByModule(parameters, module, createModuleJdk(module, jreHome));
}
示例15: configureModule
import com.intellij.execution.configurations.RunConfigurationModule; //导入依赖的package包/类
public static void configureModule(final RunConfigurationModule runConfigurationModule,
final OwnJavaParameters parameters,
@MagicConstant(valuesFromClass = OwnJavaParameters.class) final int classPathType,
@Nullable String alternativeJreName) throws CantRunException
{
Module module = runConfigurationModule.getModule();
if(module == null)
{
throw CantRunException.noModuleConfigured(runConfigurationModule.getModuleName());
}
configureModule(module, parameters, classPathType, alternativeJreName);
}