首页 > 代码库 > 胖客户端组织树

胖客户端组织树

//OrgTreePanel是一个panelorgTree = 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;    }