diff options
Diffstat (limited to 'source/com/c2kernel/gui/data/NodeContext.java')
| -rwxr-xr-x | source/com/c2kernel/gui/data/NodeContext.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/source/com/c2kernel/gui/data/NodeContext.java b/source/com/c2kernel/gui/data/NodeContext.java new file mode 100755 index 0000000..6e2bc75 --- /dev/null +++ b/source/com/c2kernel/gui/data/NodeContext.java @@ -0,0 +1,61 @@ +package com.c2kernel.gui.data;
+
+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";
+ }
+
+
+ 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 = (Path)children.nextElement();
+ if (newPath == null) break;
+ Logger.msg(2, "Subscription.run() - new node: " + newPath );
+ add( newNode(newPath));
+ batch--;
+ }
+ end(children.hasMoreElements());
+ }
+
+ public void pathAdded(DomainPath path) {
+ add(newNode(path));
+ }
+
+ public void refresh() {
+ children = null;
+ super.refresh();
+ }
+ public void pathRemoved(DomainPath path) {
+ remove(path);
+ }
+
+}
+
+
+
+
+
+
+
|
