boolean running = TODSessionFactory.getDefault().isActive();
if (!running) {
return new Object[]{};
}
VariablesWatcher vars = TODSessionFactory.getDefault().getVarialesWatcher();
ArrayList<Object> kids = new ArrayList<Object>();
if(parent instanceof String) {
String s = (String) parent;
if(s.compareTo(this.TOD_ROOT)==0) {
MirroredObjectInstance moi = vars.getThis();
if(moi != null) {
TODDataStorage.ThisObject th = new TODDataStorage.ThisObject();
th.myThis = moi;
kids.add(th);
}
// Add variables in scope.
Iterator<Variable> locals = vars.getVariablesInScope();
while (locals.hasNext()) {
Variable var = locals.next();
ChildNode n = new ChildNode();
n.data = var;
n.parent = moi;