码迷,mamicode.com
首页 > 其他好文 > 详细

胖客户端组织树

时间:2014-06-15 07:40:40      阅读:205      评论:0      收藏:0      [点我收藏+]

标签: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;
    }

 

胖客户端组织树,布布扣,bubuko.com

胖客户端组织树

标签:style   class   blog   code   color   com   

原文地址:http://www.cnblogs.com/sosomaxba/p/3785947.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!