}
public void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws FormatterException {
try {
int nodeIndex = 0;
TreeNode an = (TreeNode) getParameter("treenode");
renderFragment("nodeTab");
if (an != null) {
if ((treeStatus.isExpanded(an))) {
List children = an.getChildren();
if (children != null) {
Iterator i = children.iterator();
while (i.hasNext()) {
TreeNode subNode = (TreeNode) i.next();
if (treeStatus.isExpanded(subNode)) {
if (i.hasNext()) {
setAttribute("expand_path", "branch_contract.gif");
setAttribute("line_path", "line_expand.gif");
} else {
setAttribute("expand_path", "branch_contract_01.gif");
setAttribute("line_path", "spacer.png");
}
setAttribute("expand_action", "collapse-node");
} else {
if (i.hasNext()) {
setAttribute("expand_path", "branch_expand_02.gif");
setAttribute("line_path", "line_expand.gif");
} else {
setAttribute("expand_path", "branch_expand_01.gif");
setAttribute("line_path", "spacer.png");
}
setAttribute("expand_action", "expand-node");
}
if (i.hasNext()) {
setAttribute("line_path", "line_expand.gif");
setAttribute("branchPath", "branch_02.gif");
} else {
setAttribute("branchPath", "branch_01.gif");
setAttribute("line_path", "spacer.png");
}
setAttribute("isEditable", subNode.isEditable());
setAttribute("path_Node", subNode.getPath());
setAttribute("id_Node", subNode.getId());
setAttribute("name_Node", StringEscapeUtils.escapeHtml(StringUtils.defaultString(subNode.getName(getLocale()))));
setAttribute("icon_Node", subNode.getIconId());
setAttribute("iconNodePath", subNode.getIconCategory());
setAttribute("parent_Node", subNode.getParent());
setAttribute("node", subNode);
setAttribute("level_Node", subNode.getLevel());
setAttribute("isEdited", getTreeStatus().isEdited(subNode));
setAttribute("nodeIndex",nodeIndex++);
renderFragment("subNode");
}
}