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


Java RunConfigurationModule类代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TestMethods.java

示例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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:GroovyRunnerUtil.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:GroovyScriptRunConfigurationProducer.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:JavaParametersUtil.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:GroovyScriptRunConfigurationProducer.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:17,代码来源:HaxeCompiler.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:24,代码来源:JavaParametersUtil.java

示例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, "");
          }
  };
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:9,代码来源:LuaConfigurationType.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JavaParametersUtil.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaParametersUtil.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:JavaParametersUtil.java

示例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());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:TestClass.java

示例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;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:13,代码来源:HaxeCompiler.java

示例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));
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:10,代码来源:XQueryRunProfileState.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:JavaParametersUtil.java


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