本文整理汇总了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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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 "";
}