• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DetectedSourceRoot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot的典型用法代码示例。如果您正苦于以下问题:Java DetectedSourceRoot类的具体用法?Java DetectedSourceRoot怎么用?Java DetectedSourceRoot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DetectedSourceRoot类属于com.intellij.ide.util.projectWizard.importSources包,在下文中一共展示了DetectedSourceRoot类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setRoots

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public final void setRoots(final List<File> contentRoots, final List<? extends DetectedSourceRoot> sourceRoots, final Set<String> ignoredNames) {
  myModules = null;
  myLibraries = null;

  myEntryPointRoots.clear();
  myEntryPointRoots.addAll(contentRoots);

  mySourceRoots.clear();
  mySourceRoots.addAll(sourceRoots);

  myIgnoredNames.clear();
  myIgnoredNames.addAll(ignoredNames);

  myJarToPackagesMap.clear();
  myInterner.clear();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ModuleInsight.java


示例2: appendContentRoot

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
private static File appendContentRoot(final ModuleDescriptor module, final File contentRoot) {
  final Set<File> moduleRoots = module.getContentRoots();
  for (File moduleRoot : moduleRoots) {
    if (FileUtil.isAncestor(moduleRoot, contentRoot, false)) {
      return moduleRoot; // no need to include a separate root
    }
    if (FileUtil.isAncestor(contentRoot, moduleRoot, true)) {
      final Collection<DetectedSourceRoot> currentSources = module.getSourceRoots(moduleRoot);
      module.removeContentRoot(moduleRoot);
      module.addContentRoot(contentRoot);
      for (DetectedSourceRoot source : currentSources) {
        module.addSourceRoot(contentRoot, source);
      }
      return contentRoot; // no need to include a separate root
    }
  }
  module.addContentRoot(contentRoot);
  return contentRoot;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ModuleInsight.java


示例3: iterate

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public void iterate() {
  Collection<DetectedProjectRoot> roots = myBuilder.getProjectRoots(myStructureDetector);

  CloudGitDeploymentDetector point = getDeploymentDetector();
  String projectRootTypeName = CloudGitProjectRoot.getProjectRootTypeName(point);
  String javaSourceRootTypeName = CloudGitProjectRoot.getJavaSourceRootTypeName(point);

  for (DetectedProjectRoot root : roots) {
    if ((root instanceof CloudGitProjectRoot) && root.getRootTypeName().equals(projectRootTypeName)) {
      processProjectRoot((CloudGitProjectRoot)root);
    }
    else if ((root instanceof DetectedSourceRoot) && root.getRootTypeName().equals(javaSourceRootTypeName)) {
      processJavaSourceRoot((DetectedSourceRoot)root);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CloudGitChooseAccountStepImpl.java


示例4: merge

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public void merge(final ModuleDescriptor mainModule, final ModuleDescriptor module) {
  for (File contentRoot : module.getContentRoots()) {
    final File _contentRoot = appendContentRoot(mainModule, contentRoot);
    final Collection<DetectedSourceRoot> sources = module.getSourceRoots(contentRoot);
    for (DetectedSourceRoot source : sources) {
      mainModule.addSourceRoot(_contentRoot, source);
    }
  }
  for (File jar : module.getLibraryFiles()) {
    mainModule.addLibraryFile(jar);
  }
  // fix forward dependencies
  for (ModuleDescriptor dependency : module.getDependencies()) {
    if (!mainModule.equals(dependency)) { // avoid self-dependencies
      mainModule.addDependencyOn(dependency);
    }
  }

  myModules.remove(module);
  // fix back dependencies
  for (ModuleDescriptor moduleDescr : myModules) {
    if (moduleDescr.getDependencies().contains(module)) {
      moduleDescr.removeDependencyOn(module);
      if (!moduleDescr.equals(mainModule)) { // avoid self-dependencies
        moduleDescr.addDependencyOn(mainModule);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ModuleInsight.java


示例5: updateDataModel

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
@Override
public void updateDataModel() {
  super.updateDataModel();
  List<ModuleDescriptor> modules = new ArrayList<ModuleDescriptor>();
  for (DetectedProjectRoot root : myBuilder.getProjectRoots(myDetector)) {
    final ModuleDescriptor descriptor = new ModuleDescriptor(root.getDirectory(), StdModuleTypes.JAVA, Collections.<DetectedSourceRoot>emptyList());
    descriptor.addConfigurationUpdater(createModuleConfigurationUpdater());
    modules.add(descriptor);
  }
  myProjectDescriptor.setModules(modules);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GroovySdkForProjectFromSourcesStep.java


示例6: setupProjectStructure

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
@Override
public void setupProjectStructure(@NotNull Collection<DetectedProjectRoot> roots,
                                  @NotNull ProjectDescriptor projectDescriptor,
                                  @NotNull ProjectFromSourcesBuilder builder) {
    if (!roots.isEmpty() && !builder.hasRootsFromOtherDetectors(this)) {
        List<ModuleDescriptor> modules = projectDescriptor.getModules();
        if (modules.isEmpty()) {
            modules = new ArrayList<ModuleDescriptor>();
            for (DetectedProjectRoot root : roots) {
                modules.add(new ModuleDescriptor(root.getDirectory(), SquirrelModuleType.getInstance(), ContainerUtil.<DetectedSourceRoot>emptyList()));
            }
            projectDescriptor.setModules(modules);
        }
    }
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:16,代码来源:SquirrelProjectStructureDetector.java


示例7: setupRootModel

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
private static void setupRootModel(
        ProjectDescriptor projectDescriptor,
        final ModuleDescriptor descriptor,
        final ModifiableRootModel rootModel,
        final Map<LibraryDescriptor, Library> projectLibs) {
    final CompilerModuleExtension compilerModuleExtension =
            rootModel.getModuleExtension(CompilerModuleExtension.class);
    compilerModuleExtension.setExcludeOutput(true);
    rootModel.inheritSdk();

    //Module root model seems to store .iml files root dependencies. (src, test, lib)
    logger.info("Starting setupRootModel in ProjectFromSourcesBuilderImplModified");
    final Set<File> contentRoots = descriptor.getContentRoots();
    for (File contentRoot : contentRoots) {
        final LocalFileSystem lfs = LocalFileSystem.getInstance();
        VirtualFile moduleContentRoot =
                lfs.refreshAndFindFileByPath(
                        FileUtil.toSystemIndependentName(contentRoot.getPath()));
        if (moduleContentRoot != null) {
            final ContentEntry contentEntry = rootModel.addContentEntry(moduleContentRoot);
            final Collection<DetectedSourceRoot> sourceRoots =
                    descriptor.getSourceRoots(contentRoot);
            for (DetectedSourceRoot srcRoot : sourceRoots) {
                final String srcpath =
                        FileUtil.toSystemIndependentName(srcRoot.getDirectory().getPath());
                final VirtualFile sourceRoot = lfs.refreshAndFindFileByPath(srcpath);
                if (sourceRoot != null) {
                    contentEntry.addSourceFolder(
                            sourceRoot,
                            shouldBeTestRoot(srcRoot.getDirectory()),
                            getPackagePrefix(srcRoot));
                }
            }
        }
    }
    logger.info("Inherits compiler output path from project");
    compilerModuleExtension.inheritCompilerOutputPath(true);

    logger.info("Starting to create module level libraries");
    final LibraryTable moduleLibraryTable = rootModel.getModuleLibraryTable();
    for (LibraryDescriptor libDescriptor :
            ModuleInsight.getLibraryDependencies(
                    descriptor, projectDescriptor.getLibraries())) {
        final Library projectLib = projectLibs.get(libDescriptor);
        if (projectLib != null) {
            rootModel.addLibraryEntry(projectLib);
        } else {
            // add as module library
            final Collection<File> jars = libDescriptor.getJars();
            for (File file : jars) {
                Library library = moduleLibraryTable.createLibrary();
                Library.ModifiableModel modifiableModel = library.getModifiableModel();
                modifiableModel.addRoot(
                        VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES);
                modifiableModel.commit();
            }
        }
    }
    logger.info("Ending setupRootModel in ProjectFromSourcesBuilderImplModified");
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:61,代码来源:ProjectFromSourcesBuilderImplModified.java


示例8: ModuleDescriptor

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public ModuleDescriptor(final File contentRoot, final ModuleType moduleType, final Collection<? extends DetectedSourceRoot> sourceRoots) {
  myName = suggestModuleName(contentRoot);
  myContentToSourceRoots.putValues(contentRoot, sourceRoots);
  myModuleType = moduleType;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ModuleDescriptor.java


示例9: getSourceRoots

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public Collection<DetectedSourceRoot> getSourceRoots(File contentRoot) {
  return myContentToSourceRoots.get(contentRoot);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ModuleDescriptor.java


示例10: addContentRoot

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public void addContentRoot(File contentRoot) {
  myContentToSourceRoots.put(contentRoot, new HashSet<DetectedSourceRoot>());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ModuleDescriptor.java


示例11: removeContentRoot

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public Collection<DetectedSourceRoot> removeContentRoot(File contentRoot) {
  return myContentToSourceRoots.remove(contentRoot);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ModuleDescriptor.java


示例12: addSourceRoot

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public void addSourceRoot(final File contentRoot, DetectedSourceRoot sourceRoot) {
  myContentToSourceRoots.putValue(contentRoot, sourceRoot);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ModuleDescriptor.java


示例13: ModuleInsight

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
public ModuleInsight(@Nullable final ProgressIndicator progress, Set<String> existingModuleNames, Set<String> existingProjectLibraryNames) {
  myExistingModuleNames = existingModuleNames;
  myExistingProjectLibraryNames = existingProjectLibraryNames;
  myProgress = new ProgressIndicatorWrapper(progress);
  setRoots(Collections.<File>emptyList(), Collections.<DetectedSourceRoot>emptyList(), Collections.<String>emptySet());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ModuleInsight.java


示例14: createModuleDescriptor

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
protected ModuleDescriptor createModuleDescriptor(final File moduleContentRoot, final Collection<DetectedSourceRoot> sourceRoots) {
  return new ModuleDescriptor(moduleContentRoot, StdModuleTypes.JAVA, sourceRoots);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaModuleInsight.java


示例15: createModuleDescriptor

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
@Override
protected ModuleDescriptor createModuleDescriptor(File moduleContentRoot, Collection<DetectedSourceRoot> sourceRoots) {
  return new ModuleDescriptor(moduleContentRoot, HaxeModuleType.getInstance(), sourceRoots);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:5,代码来源:HaxeModuleInsight.java


示例16: createModuleDescriptor

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
protected abstract ModuleDescriptor createModuleDescriptor(final File moduleContentRoot, Collection<DetectedSourceRoot> sourceRoots); 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:2,代码来源:ModuleInsight.java


示例17: processJavaSourceRoot

import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; //导入依赖的package包/类
protected abstract void processJavaSourceRoot(DetectedSourceRoot root); 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:2,代码来源:CloudGitChooseAccountStepImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConstUI类代码示例发布时间:2022-05-23
下一篇:
Java TesselatorVertexState类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap