summaryrefslogtreecommitdiff
path: root/src/main/java/org/cristalise/gui/tree/NodeRole.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/cristalise/gui/tree/NodeRole.java')
-rw-r--r--src/main/java/org/cristalise/gui/tree/NodeRole.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/org/cristalise/gui/tree/NodeRole.java b/src/main/java/org/cristalise/gui/tree/NodeRole.java
new file mode 100644
index 0000000..288d3b6
--- /dev/null
+++ b/src/main/java/org/cristalise/gui/tree/NodeRole.java
@@ -0,0 +1,34 @@
+package org.cristalise.gui.tree;
+
+import org.cristalise.gui.ItemTabManager;
+import org.cristalise.kernel.common.ObjectNotFoundException;
+import org.cristalise.kernel.lookup.AgentPath;
+import org.cristalise.kernel.lookup.Path;
+import org.cristalise.kernel.lookup.RolePath;
+import org.cristalise.kernel.process.Gateway;
+import org.cristalise.kernel.utils.Logger;
+
+
+public class NodeRole extends NodeContext {
+
+ RolePath role;
+ public NodeRole(Path path, ItemTabManager desktop) {
+ super(path, desktop);
+ role = (RolePath)path;
+ }
+ @Override
+ public void loadChildren() {
+ AgentPath[] agents;
+ try {
+ agents = Gateway.getLookup().getAgents(role);
+ for (AgentPath agentPath : agents) {
+ add (newNode(agentPath));
+ }
+ } catch (ObjectNotFoundException e) {
+ Logger.error("Role "+role.getName()+" not found");
+ }
+ super.loadChildren();
+ }
+
+
+}