}
private TreeControl buildTree(Iterator users, Locale locale)
{
TreeControlNode root = new TreeControlNode(SECURITY_NODE_ID, // node id
null, // icon
getMessage(MSG_SECURITY_ROOT, locale), // title
SecurityResources.PORTLET_URL, null, // target window
true, // expand initially
SECURITY_DOMAIN); // domain
TreeControl control = new TreeControl(root);
TreeControlNode userTree = new TreeControlNode(USER_NODE_ID, // node id
null, // icon
getMessage(MSG_USER_ROOT, locale), // title
SecurityResources.PORTLET_URL, null, // target window
false, // expand initially
USER_DOMAIN); // domain
root.addChild(userTree);
while (users.hasNext())
{
User user = (User) users.next();
Principal principal = getPrincipal(user.getSubject(), UserPrincipal.class);
TreeControlNode userNode = new TreeControlNode(principal.getName(), null, principal.getName(),
SecurityResources.PORTLET_URL, null, false, USER_DETAIL_DOMAIN);
userTree.addChild(userNode);
}
return control;