public InterpreterInfoTreeNodeRoot(IInterpreterInfo interpreterInfo, IPythonNature nature, Object parent, X data) {
super(parent, data);
this.interpreterInfo = interpreterInfo;
Assert.isNotNull(interpreterInfo);
InterpreterInfoTreeNodeRoot root = this;
ImageCache imageCache = PydevPlugin.getImageCache();
String executableOrJar = interpreterInfo.getExecutableOrJar();
File file = new File(executableOrJar);
if (file.exists()) {
belowRootFiles = new PythonpathTreeNode(root, file.getParentFile(),
imageCache.get(UIConstants.PY_INTERPRETER_ICON), true);
} else {
belowRootFiles = null;
}
systemLibs = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage("System Libs",
imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));
List<String> pythonPath = interpreterInfo.getPythonPath();
Collections.sort(pythonPath);
for (String string : pythonPath) {
new PythonpathTreeNode(systemLibs, new File(string), imageCache.get(UIConstants.LIB_SYSTEM), true);
}
externalLibs = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage("External Libs",
imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));
IPythonPathNature pythonPathNature = nature.getPythonPathNature();
try {
List<String> projectExternalSourcePath = pythonPathNature.getProjectExternalSourcePathAsList(true);
Collections.sort(projectExternalSourcePath);
for (String string : projectExternalSourcePath) {
File f = new File(string);
new PythonpathTreeNode(externalLibs, f, imageCache.get(UIConstants.LIB_SYSTEM), true);
}
} catch (CoreException e) {
Log.log(e);
}
predefinedCompletions = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage(
"Predefined Completions", imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));
for (String string : interpreterInfo.getPredefinedCompletionsPath()) {
new PythonpathTreeNode(predefinedCompletions, new File(string), imageCache.get(UIConstants.LIB_SYSTEM),
true);
}
forcedBuiltins = new InterpreterInfoTreeNode<LabelAndImage>(root, new LabelAndImage("Forced builtins",
imageCache.get(UIConstants.LIB_SYSTEM_ROOT)));
for (Iterator<String> it = interpreterInfo.forcedLibsIterator(); it.hasNext();) {
String string = it.next();
new InterpreterInfoTreeNode<LabelAndImage>(forcedBuiltins, new LabelAndImage(string,
imageCache.get(UIConstants.LIB_FORCED_BUILTIN)));
}
}