本文整理汇总了Java中com.intellij.execution.configurations.RunConfigurationModule.getModule方法的典型用法代码示例。如果您正苦于以下问题:Java RunConfigurationModule.getModule方法的具体用法?Java RunConfigurationModule.getModule怎么用?Java RunConfigurationModule.getModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.configurations.RunConfigurationModule
的用法示例。
在下文中一共展示了RunConfigurationModule.getModule方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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);
}
示例6: 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);
}
示例7: 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;
}
示例8: 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));
}
示例9: 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);
}