Search in sources :

Example 1 with SimpleProjectRoot

use of com.intellij.openapi.projectRoots.impl.SimpleProjectRoot in project intellij-community by JetBrains.

the class PythonSdkAdditionalData method savePaths.

private static void savePaths(Element rootElement, Set<SimpleProjectRoot> paths, String root, String element) {
    for (SimpleProjectRoot addedPath : paths) {
        final Element child = new Element(root);
        child.setAttribute(element, addedPath.getUrl());
        rootElement.addContent(child);
    }
}
Also used : SimpleProjectRoot(com.intellij.openapi.projectRoots.impl.SimpleProjectRoot) Element(org.jdom.Element)

Example 2 with SimpleProjectRoot

use of com.intellij.openapi.projectRoots.impl.SimpleProjectRoot in project intellij-community by JetBrains.

the class PythonSdkAdditionalData method collectPaths.

protected static Set<SimpleProjectRoot> collectPaths(@NotNull List<String> paths) {
    final Set<SimpleProjectRoot> files = Sets.newHashSet();
    for (String path : paths) {
        if (StringUtil.isEmpty(path))
            continue;
        VirtualFile file = LocalFileSystem.getInstance().findFileByPath(path);
        SimpleProjectRoot root;
        if (file != null) {
            root = new SimpleProjectRoot(file);
        } else {
            root = new SimpleProjectRoot(path);
        }
        files.add(root);
    }
    return files;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SimpleProjectRoot(com.intellij.openapi.projectRoots.impl.SimpleProjectRoot)

Aggregations

SimpleProjectRoot (com.intellij.openapi.projectRoots.impl.SimpleProjectRoot)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 Element (org.jdom.Element)1