private void printNameString(
      JspWriter out,
      TreeControlNode node,
      boolean isCatalog,
      String updateTreeAction,
      HttpServletResponse response,
      String hyperlink,
      String action)
      throws IOException {
    // if ((action != null) && (isCatalog || !node.isLeaf()))
    if (action != null) {
      out.print("<a href=\"");
      out.print(response.encodeURL(action));
      out.print("\"");
      out.print(" onclick=\"");
      out.print("self.location.href='" + updateTreeAction + "'");
      out.print("\">");
      out.print("<img src=\"");

      if (node.isExpanded()) {
        out.print(IMAGE_HANDLE_EXPANDED);
      } else {
        out.print(IMAGE_HANDLE_UNEXPANDED);
      }

      out.print("\" border=\"0\">");
      out.print("</a>");

      // Render the label for this node (if any)
      if (node.getLabel() != null) {
        if (hyperlink != null) {
          // Note the leading space so that the text has some space
          // between it and any preceding images
          out.print("<a href=\"");
          out.print(hyperlink);
          out.print("\"");

          String target = node.getTarget();

          if (target != null) {
            out.print(" target=\"");
            out.print(target);
            out.print("\"");
          }

          // to refresh the tree in the same 'self' frame
          out.print(" onclick=\"");
          out.print("self.location.href='" + updateTreeAction + "'");
          out.print("\"");
          out.print(">");
        }

        if (node.isSelected()) {
          out.println("<B>");
        }

        out.print(node.getLabel());

        if (node.isSelected()) {
          out.println("</B>");
        }

        if (hyperlink != null) {
          out.print("</a>");
        }
      }
    }
  }