summaryrefslogtreecommitdiff
path: root/src/main/java/org/cristalise/gui/tree/NodeRole.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-07 09:18:33 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-07 09:18:33 +0200
commit5e4034b5cba89460a62fa958fc78c2b85acb3d5f (patch)
treeaa8e32f014801459ad65acdf45eee70d16008fe6 /src/main/java/org/cristalise/gui/tree/NodeRole.java
parenta5a9d90ec6714ad6a9358c35ca7093e5868373f7 (diff)
Repackage to org.cristalise
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();
+ }
+
+
+}