package com.c2kernel.gui.tree; import java.util.Enumeration; import com.c2kernel.entity.proxy.DomainPathSubscriber; import com.c2kernel.gui.EntityTabManager; import com.c2kernel.lookup.DomainPath; import com.c2kernel.lookup.Path; import com.c2kernel.process.Gateway; import com.c2kernel.utils.Logger; public class NodeContext extends Node implements DomainPathSubscriber { Enumeration children; public NodeContext(Path path, EntityTabManager desktop) { super(path, desktop); this.sysKey=Path.INVALID; createTreeNode(); this.makeExpandable(); this.type = "Cristal Context"; } @Override public void loadChildren() { if (children == null) { Gateway.getProxyManager().subscribeTree(this, (DomainPath)binding); children = binding.getChildren(); } int batch = 75; while (children.hasMoreElements() && batch > 0) { Path newPath = children.nextElement(); if (newPath == null) break; Logger.msg(2, "Subscription.run() - new node: " + newPath ); add( newNode(newPath)); batch--; } end(children.hasMoreElements()); } @Override public void pathAdded(DomainPath path) { add(newNode(path)); } @Override public void refresh() { children = null; super.refresh(); } @Override public void pathRemoved(DomainPath path) { remove(path); } }