标签:style class blog code color com
//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; }
标签:style class blog code color com
原文地址:http://www.cnblogs.com/sosomaxba/p/3785947.html