private final TreeNode root;
public AdminTreeModel(XUser user) {
//children:
XNode users = new XNode(user, XConstants.TYPE_USERS_NODE);
users.setName(constants.users());
users.setHasChildren(true);
users.setId("AdminNavigatorView#UsersNode");
XNode groups = new XNode(user, XConstants.TYPE_GROUPS_NODE);
groups.setName(constants.groups());
groups.setHasChildren(true);
groups.setId("AdminNavigatorView#GroupsNode");
XNode roles = new XNode(user, XConstants.TYPE_ROLES_NODE);
roles.setName(constants.roles());
roles.setHasChildren(true);
roles.setId("AdminNavigatorView#RolesNode");
//root node
XNode rootNode = new XNode(null, XConstants.TYPE_ROOT_NODE);
rootNode.setId("AdminNavigatorView#RootNode");
rootNode.addChild(users);
rootNode.addChild(groups);
rootNode.addChild(roles);
rootNode.setHasChildren(true);
root = new TreeNode(null, rootNode);
}