📄 publicdirectoryview.java
字号:
} } if (mappingAddress.equals("")) { out.print( "<a target=_parent href='../netdisk/netdisk_public_attach_list.jsp?dir_code=" + StrUtil.UrlEncode(code) + "&dir_name=" + StrUtil.UrlEncode(name) + "'>" + name + "</a>"); } else { out.print( "<a target=_parent href='netdisk_public_mapping_list.jsp?mappingAddress=" + StrUtil.UrlEncode(mappingAddress) + "'>" + name + "</a>"); } out.print(" </td><td width='15%' align=right nowrap>"); if (!leaf.getCode().equals("root")) { if (leaf.getIsHome()) out.print("首页 "); if (mappingAddress.equals("")) { out.print( "<a target=dirbottomFrame href='netdisk_public_dir_bottom.jsp?parent_code=" + StrUtil.UrlEncode(code, "utf-8") + "&parent_name=" + StrUtil.UrlEncode(name, "utf-8") + "&op=AddChild'>添子目录</a> "); } else { out.print( "映射目录 "); } out.print("<a target=_parent href='netdisk_public_dir_priv_m.jsp?dirCode=" + StrUtil.UrlEncode(code) + "'>权限</a> "); out.print( "<a target='dirbottomFrame' href='netdisk_public_dir_bottom.jsp?op=modify&code=" + StrUtil.UrlEncode(code, "utf-8") + "&name=" + StrUtil.UrlEncode(name, "utf-8") + "&description=" + StrUtil.UrlEncode(description, "utf-8") + "'>修改</a> "); out.print( "<a target=_self href=# onClick=\"if (window.confirm('您确定要删除" + name + "吗?')) window.location.href='?op=del&root_code=" + StrUtil.UrlEncode(rootLeaf.getCode()) + "&delcode=" + StrUtil.UrlEncode(code, "utf-8") + "'\">删除</a> "); out.print("<a href='?op=move&direction=up&root_code=" + StrUtil.UrlEncode(rootLeaf.getCode()) + "&code=" + StrUtil.UrlEncode(code, "utf-8") + "'>上移</a> "); out.print("<a href='?op=move&direction=down&root_code=" + StrUtil.UrlEncode(rootLeaf.getCode()) + "&code=" + StrUtil.UrlEncode(code, "utf-8") + "'>下移</a> "); } out.println(" </td></tr></tbody></table>"); } void ShowLeafAsOption(JspWriter out, PublicLeaf leaf, int rootlayer) throws Exception { String code = leaf.getCode(); String name = leaf.getName(); int layer = leaf.getLayer(); String description = leaf.getDescription(); String blank = ""; int d = layer-rootlayer; for (int i=0; i<d; i++) { blank += " "; } if (leaf.getChildCount()>0) { out.print("<option value='" + code + "' style='COLOR: #0005ff'>" + blank + "╋ " + name + "</option>"); } else { out.print("<option value=\"" + code + "\" style='COLOR: #0005ff'>" + blank + "├『" + name + "』</option>"); } } public void ShowDirectoryAsOptions(JspWriter out, PublicLeaf leaf, int rootlayer) throws Exception { ShowLeafAsOption(out, leaf, rootlayer); PublicDirectory dir = new PublicDirectory(); Vector children = dir.getChildren(leaf.getCode()); int size = children.size(); if (size == 0) return; int i = 0; Iterator ri = children.iterator(); while (ri.hasNext()) { PublicLeaf childlf = (PublicLeaf) ri.next(); ShowDirectoryAsOptions(out, childlf, rootlayer); } } void ShowLeafAsOptionWithCode(JspWriter out, PublicLeaf leaf, int rootlayer) throws Exception { String code = leaf.getCode(); String name = leaf.getName(); String mappingAddress = leaf.getMappingAddress(); int layer = leaf.getLayer(); String description = leaf.getDescription(); String blank = ""; int d = layer-rootlayer; for (int i=0; i<d; i++) { blank += " "; } if(mappingAddress.equals("")){ if (leaf.getChildCount() > 0) out.print("<option value='" + code + "'>" + blank + "╋ " + name + "</option>"); else out.print("<option value='" + code + "'>" + blank + " " + name + "</option>"); } } public void ShowDirectoryAsOptionsWithCode(JspWriter out, PublicLeaf leaf, int rootlayer) throws Exception { ShowLeafAsOptionWithCode(out, leaf, rootlayer); PublicDirectory dir = new PublicDirectory(); Vector children = dir.getChildren(leaf.getCode()); int size = children.size(); if (size == 0) return; int i = 0; Iterator ri = children.iterator(); while (ri.hasNext()) { PublicLeaf childlf = (PublicLeaf) ri.next(); ShowDirectoryAsOptionsWithCode(out, childlf, rootlayer); } } void ListTreeFunc(JspWriter out, PublicLeaf leaf, boolean isLastChild, String target, String func, String tableClass, String tableClassMouseOn) throws Exception { ShowLeafFunc(out, leaf, isLastChild, target, func, tableClass, tableClassMouseOn); PublicDirectory dir = new PublicDirectory(); Vector children = dir.getChildren(leaf.getCode()); int size = children.size(); if (size == 0) return; int i = 0; if (size > 0) out.print("<table id='childoftable" + leaf.getCode() + "' cellspacing=0 cellpadding=0 width='100%' align=center><tr><td>"); Iterator ri = children.iterator(); while (ri.hasNext()) { i++; PublicLeaf childlf = (PublicLeaf) ri.next(); boolean isLastChild1 = true; if (size != i) isLastChild1 = false; ListTreeFunc(out, childlf, isLastChild1, target, func, tableClass, tableClassMouseOn); } if (size > 0) out.print("</td></tr></table>"); } void ShowLeafFunc(JspWriter out, PublicLeaf leaf, boolean isLastChild, String target, String func, String tableClass, String tableClassMouseOn) throws Exception { String code = leaf.getCode(); String name = leaf.getName(); int layer = leaf.getLayer(); String description = leaf.getDescription(); if (!isLastChild) { PublicLeaf brotherleaf = leaf.getBrother("down"); if (brotherleaf != null) { Vector r = new Vector(); leaf.getAllChild(r, leaf); int count = r.size(); if (count>0) { PublicUprightLineNode uln = new PublicUprightLineNode(layer, count); UprightLineNodes.addElement(uln); } } } int childcount = leaf.getChildCount(); String tableid = "table" + leaf.getCode(); out.println("<table id=" + tableid + " name=" + tableid + " class='" + tableClass + "' cellspacing=0 cellpadding=0 width='100%' align=center onMouseOver=\"this.className='" + tableClassMouseOn + "'\" onMouseOut=\"this.className='" + tableClass + "'\" border=0>"); out.println(" <tbody><tr>"); out.println(" <td height='13' align=left nowrap>"); for (int k = rootLeaf.getLayer(); k <= layer - 1; k++) { boolean isShowed = false; Iterator ir = UprightLineNodes.iterator(); while (ir.hasNext()) { PublicUprightLineNode node = (PublicUprightLineNode) ir.next(); if (node.getLayer() == k) { node.show(out, "images/i_plus-2.gif"); if (node.getCount() == 0) { UprightLineNodes.remove(node); } isShowed = true; break; } } if (!isShowed) out.println("<img src='' width=20 height=1>"); } if (leaf.getCode().equals(rootLeaf.getCode())) { out.println("<img onClick=\"ShowChild(this, '" + tableid + "')\" src='images/i_puls-root.gif' align='absmiddle'><img src='images/folder_01.gif' align='absmiddle'>"); } else { if (isLastChild) { if (childcount > 0) out.println("<img onClick=\"ShowChild(this, '" + tableid + "')\" src='images/i_plus2-2.gif' align='absmiddle'><img src='images/folder_01.gif' align='absmiddle'>"); else out.println("<img src='images/i_plus-2-3.gif' align='absmiddle'><img src='images/folder_01.gif' align='absmiddle'>"); } else { if (childcount > 0) out.println("<img onClick=\"ShowChild(this, '" + tableid + "')\" src='images/i_plus2-1.gif' align='absmiddle'><img src='images/folder_01.gif' align='absmiddle'>"); else out.println("<img src='images/i_plus-2-2.gif' align='absmiddle'><img src='images/folder_01.gif' align='absmiddle'>"); } } out.print( "<a target='" + target + "' href='#' onClick=\"" + func + "('" + code + "', '" + name + "')\">" + name + "</a>"); out.print(" </td>"); out.println(" </tr></tbody></table>"); } public void ListFunc(JspWriter out, String target, String func, String tableClass, String tableClassMouseOn) throws Exception { ListTreeFunc(out, rootLeaf, true, target, func, tableClass, tableClassMouseOn); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -