private HashMap expandNode(TreeUINode targetNode, String absPathText) { HashMap vals = null; try { vals = getBizContext().getBizContent().list(absPathText, List_Attrs); } catch (KDRSException e1) { log.error("取文件夹内容列表时发生异常。", e1); } if (vals != null) { targetNode.setUserObject(vals); targetNode.setChildrenLoaded(true); createUnloadedChildNode(targetNode, vals); } return vals; }
public boolean showDialog() { if (!isAddControls) { String absPath = PathUtil.makeChildPath("/EAS_Note.kdrs", _tree.getPathTextToShow()); HashMap multiResult[] = null; if (_rpcReducer != null) try { multiResult = (HashMap[]) (HashMap[]) _rpcReducer.getBatchResult( "IBizContent.list2", new Object[] {absPath, List_Attrs}); } catch (NotFoundException e) { WindowUtil.msgboxError( (new StringBuilder()) .append( MultiLanguageUtil.getMLS("ui.NoteFileDialogEx.pathError1", "程序指定模板所在文件夹:")) .append(_tree.getPathTextToShow()) .append( MultiLanguageUtil.getMLS( "ui.NoteFileDialogEx.pathError", "不存在,请联系套打管理员检查套打管理中该路径是否正确!")) .toString(), MultiLanguageUtil.getMLS("ui.NoteFileDialogEx.pathErrorTitle", "路径错误"), this); return false; } catch (KDRSException e) { log.error("GetBatchResult list2 error.", e); } else try { multiResult = getBizContext().getBizContent().list2(absPath, List_Attrs); } catch (NotFoundException e) { WindowUtil.msgboxError( (new StringBuilder()) .append( MultiLanguageUtil.getMLS("ui.NoteFileDialogEx.pathError1", "程序指定模板所在文件夹:")) .append(_tree.getPathTextToShow()) .append( MultiLanguageUtil.getMLS( "ui.NoteFileDialogEx.pathError", "不存在,请联系套打管理员检查套打管理中该路径是否正确!")) .toString(), MultiLanguageUtil.getMLS("ui.NoteFileDialogEx.pathErrorTitle", "路径错误"), this); return false; } catch (KDRSException e) { log.error("", e); if (e instanceof NotFoundException) { WindowUtil.msgboxError( (new StringBuilder()) .append( MultiLanguageUtil.getMLS("ui.NoteFileDialogEx.pathError1", "程序指定模板所在文件夹:")) .append(_tree.getPathTextToShow()) .append( MultiLanguageUtil.getMLS( "ui.NoteFileDialogEx.pathError", "不存在,请联系套打管理员检查套打管理中该路径是否正确!")) .toString(), MultiLanguageUtil.getMLS("ui.NoteFileDialogEx.pathErrorTitle", "路径错误"), this); return false; } } TreeUINode node = _tree.getTreeUI().getRootNode(); node.setChildrenLoaded(true); if (multiResult != null) { int relaRootDeep = PathUtil.splitPath("/EAS_Note.kdrs").length - 1; int i = relaRootDeep; do { if (i >= multiResult.length - 1) break; String name = (String) multiResult[i].get("name"); String alias = (String) multiResult[i].get("alias"); TreeUINode childNode; try { childNode = _tree.newTreeNode("folder", name, alias); } catch (Exception e) { log.error("", e); break; } _tree.getTreeUI().addChildNode(childNode, node); childNode.setChildrenLoaded(true); node = childNode; i++; } while (true); node.setUserObject(multiResult[multiResult.length - 1]); createUnloadedChildNode(node, multiResult[multiResult.length - 1]); _tree.getTreeUI().setSelectionNode(node); _tree.getTreeUI().expand(_tree.getTreeUI().getSelectionPath()); } } return super.showDialog(); }