//OrgTreePanel是一个panel orgTree = new OrgTreePanel(TcApp.getSession()); contentPanel.add(orgTree, BorderLayout.CENTER); //获取选中的东西 OrgObject orgObject = orgTree.getSelectedObject(); if (orgObject == null) return; if (orgObject.getComponent() instanceof TCComponentGroupMember) { // 得到当前选择的用户对象完整组织结构 TCComponentGroupMember fMember = (TCComponentGroupMember) orgObject .getComponent(); try { TCComponentGroup group = fMember.getGroup(); TCComponentUser user = fMember.getUser(); System.out.println(group + "-" + user); } catch (TCException e1) { e1.printStackTrace(); } } /** * 获取当前选中的人员ID * @return */ public String getSelectUserID(){ String userID = null; try { OrgObject orgObject = orgTree.getSelectedObject(); if (orgObject != null && orgObject.getType() == OrgObject.GROUPMEMBER) { TCComponentUser user = orgObject.getUser(); userID = user.getProperty("user_id"); } } catch (TCException e) { e.printStackTrace(); } return userID; }
胖客户端组织树
时间: 2024-10-11 00:04:29