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


Java PersistentOrderRootType类代码示例

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


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

示例1: getNotExcludedRoots

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private Set<VirtualFile> getNotExcludedRoots() {
  Set<VirtualFile> roots = new LinkedHashSet<VirtualFile>();
  String[] excludedRootUrls = getLibraryEditor().getExcludedRootUrls();
  Set<VirtualFile> excludedRoots = new HashSet<VirtualFile>();
  for (String url : excludedRootUrls) {
    ContainerUtil.addIfNotNull(excludedRoots, VirtualFileManager.getInstance().findFileByUrl(url));
  }
  for (PersistentOrderRootType type : OrderRootType.getAllPersistentTypes()) {
    VirtualFile[] files = getLibraryEditor().getFiles(type);
    for (VirtualFile file : files) {
      if (!VfsUtilCore.isUnder(file, excludedRoots)) {
        roots.add(PathUtil.getLocalFile(file));
      }
    }
  }
  return roots;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:LibraryRootsComponent.java

示例2: writeExternal

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
@Override
public void writeExternal(Element element) {
  List<PersistentOrderRootType> allTypes = OrderRootType.getSortedRootTypes();
  for (PersistentOrderRootType type : allTypes) {
    write(element, type);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProjectRootContainerImpl.java

示例3: read

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private void read(Element element, PersistentOrderRootType type)  {
  String sdkRootName = type.getSdkRootName();
  Element child = sdkRootName != null ? element.getChild(sdkRootName) : null;
  if (child == null) {
    myRoots.put(type, new CompositeProjectRoot());
    return;
  }

  List<Element> children = child.getChildren();
  LOG.assertTrue(children.size() == 1);
  CompositeProjectRoot root = (CompositeProjectRoot)ProjectRootUtil.read(children.get(0));
  myRoots.put(type, root);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ProjectRootContainerImpl.java

示例4: write

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private void write(Element roots, PersistentOrderRootType type) {
  String sdkRootName = type.getSdkRootName();
  if (sdkRootName != null) {
    Element e = new Element(sdkRootName);
    roots.addContent(e);
    final Element root = ProjectRootUtil.write(myRoots.get(type));
    if (root != null) {
      e.addContent(root);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ProjectRootContainerImpl.java

示例5: getJarDirectoryRootType

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private static OrderRootType getJarDirectoryRootType(@Nullable String type) {
  for (PersistentOrderRootType rootType : OrderRootType.getAllPersistentTypes()) {
    if (rootType.name().equals(type)) {
      return rootType;
    }
  }
  return DEFAULT_JAR_DIRECTORY_TYPE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JarDirectories.java

示例6: writeExternal

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
@Override
public void writeExternal(Element element) throws WriteExternalException {
  List<PersistentOrderRootType> allTypes = OrderRootType.getSortedRootTypes();
  for (PersistentOrderRootType type : allTypes) {
    write(element, type);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:ProjectRootContainerImpl.java

示例7: read

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private void read(Element element, PersistentOrderRootType type) throws InvalidDataException {
  Element child = element.getChild(type.getSdkRootName());
  if (child == null) {
    myRoots.put(type, new CompositeProjectRoot());
    return;
  }

  List children = child.getChildren();
  LOG.assertTrue(children.size() == 1);
  CompositeProjectRoot root = (CompositeProjectRoot)ProjectRootUtil.read((Element)children.get(0));
  myRoots.put(type, root);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:ProjectRootContainerImpl.java

示例8: write

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private void write(Element roots, PersistentOrderRootType type) throws WriteExternalException {
  Element e = new Element(type.getSdkRootName());
  roots.addContent(e);
  final Element root = ProjectRootUtil.write(myRoots.get(type));
  if (root != null) {
    e.addContent(root);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:ProjectRootContainerImpl.java

示例9: getSortKey

import com.intellij.openapi.roots.PersistentOrderRootType; //导入依赖的package包/类
private static String getSortKey(OrderRootType orderRootType) {
  if (orderRootType instanceof PersistentOrderRootType) {
    return ((PersistentOrderRootType)orderRootType).getSdkRootName();
  }
  if (orderRootType instanceof OrderRootType.DocumentationRootType) {
    return ((OrderRootType.DocumentationRootType)orderRootType).getSdkRootName();
  }
  return "";
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:LibraryImpl.java


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