forked from aptana/Pydev
/
InterpretersGroup.java
34 lines (28 loc) · 1.05 KB
/
InterpretersGroup.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.python.pydev.analysis.indexview;
import org.python.pydev.core.IInterpreterInfo;
import org.python.pydev.core.IInterpreterManager;
import org.python.pydev.plugin.PydevPlugin;
public class InterpretersGroup extends ElementWithChildren{
public InterpretersGroup(ITreeElement parent) {
super(parent);
}
public boolean hasChildren() {
return true;
}
@Override
public void calculateChildren() {
IInterpreterManager[] allInterpreterManagers = PydevPlugin.getAllInterpreterManagers();
for (IInterpreterManager iInterpreterManager : allInterpreterManagers) {
IInterpreterInfo[] interpreterInfos = iInterpreterManager.getInterpreterInfos();
if(interpreterInfos != null && interpreterInfos.length > 0){
for (IInterpreterInfo iInterpreterInfo : interpreterInfos) {
addChild(new InterpreterGroup(this, iInterpreterInfo));
}
}
}
}
@Override
public String toString() {
return "Interpreters";
}
}