<%@page import="com.amarsoft.are.io.FileTool"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/IncludeBegin.jsp"%><%! private void initTreeView(OHTMLTreeView tviTemp, File file, String sParentId, int folder_length, ArrayList paths){ if(file == null || !file.exists() || file.getName().startsWith(".")) return; if(file.isFile()){ if(!file.getName().endsWith(".lang")) return; String sPath = file.getAbsolutePath().substring(folder_length-4); int index = sPath.lastIndexOf("_"); if(index > 0) sPath = sPath.substring(0, index); if(paths.indexOf(sPath) >= 0) return; paths.add(sPath); String sName = sPath; index = sName.lastIndexOf(File.separator); if(index > 0) sName = sName.substring(index+1); tviTemp.insertPage(sParentId, sName, sPath, "", 0); return; } if(file.getAbsolutePath().length() > folder_length) sParentId = tviTemp.insertFolder(sParentId, file.getName(), "", 0); List children = Arrays.asList(file.listFiles()); Collections.sort(children, new Comparator(){ public int compare(File file1, File file2){ if(file1.isDirectory() && file2.isFile()) return -1; if(file1.isFile() && file2.isDirectory()) return 1; return file1.getName().compareTo(file2.getName()); } }); for(File child : children){ initTreeView(tviTemp, child, sParentId, folder_length, paths); } } %> <% String PG_TITLE = null; String PG_CONTENT_TITLE = null; String PG_CONTNET_TEXT = "请点击左侧列表";//默认的内容区文字 String PG_LEFT_WIDTH = "380";//默认的treeview宽度 OHTMLTreeView tviTemp = new OHTMLTreeView(CurPage, "页面文字配置", "right"); File file = FileTool.findFile("../lang/page"); initTreeView(tviTemp, file, "root", file.getAbsolutePath().length(), new ArrayList()); %> <%@include file="/Resources/CodeParts/View04.jsp"%> <%@ include file="/IncludeEnd.jsp"%>