forked from fanruan/design
ju
6 years ago
27 changed files with 90 additions and 135 deletions
@ -1 +1 @@
|
||||
package com.fr.design.roleAuthority;
import com.fr.base.FRContext;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.gui.itree.refreshabletree.loader.ChildrenNodesLoader;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* 将权限细粒度的角色数据包装一下,区分报表平台管理角色和数据决策系统角色
* <p/>
* Author : daisy
* Date: 13-8-30
* Time: 下午3:42
*/
public class RoleDataWrapper implements ChildrenNodesLoader {
private List<String> rolelist = new ArrayList<String>();
private String roleTypename = null;
public RoleDataWrapper(String roleName) {
roleTypename = roleName;
}
/**
* 在此计算并获得与管理类型相对应的
*/
private void calculateRoleList() {
try {
Collections.addAll(rolelist, FRContext.getCurrentEnv().getOrganizationOperator().getRoleGroup());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
//加载所有的角色列表
public ExpandMutableTreeNode[] load() {
calculateRoleList();
return this.load(this.rolelist);
}
//从workbook中读取的角色列表
public ExpandMutableTreeNode[] load(List<String> rolelist) {
this.rolelist = rolelist;
ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[rolelist.size()];
for (int i = 0; i < res.length; i++) {
res[i] = new ExpandMutableTreeNode(rolelist.get(i));
}
return res;
}
public String getRoleTypename(){
return roleTypename;
}
} |
||||
package com.fr.design.roleAuthority;
import com.fr.base.FRContext;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.gui.itree.refreshabletree.loader.ChildrenNodesLoader;
import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* 将权限细粒度的角色数据包装一下,区分报表平台管理角色和数据决策系统角色
* <p/>
* Author : daisy
* Date: 13-8-30
* Time: 下午3:42
*/
public class RoleDataWrapper implements ChildrenNodesLoader {
private List<String> rolelist = new ArrayList<String>();
private String roleTypename = null;
public RoleDataWrapper(String roleName) {
roleTypename = roleName;
}
/**
* 在此计算并获得与管理类型相对应的
*/
private void calculateRoleList() {
try {
Collections.addAll(rolelist, FRContext.getOrganizationOperator().getRoleGroup());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
//加载所有的角色列表
public ExpandMutableTreeNode[] load() {
calculateRoleList();
return this.load(this.rolelist);
}
//从workbook中读取的角色列表
public ExpandMutableTreeNode[] load(List<String> rolelist) {
this.rolelist = rolelist;
ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[rolelist.size()];
for (int i = 0; i < res.length; i++) {
res[i] = new ExpandMutableTreeNode(rolelist.get(i));
}
return res;
}
public String getRoleTypename(){
return roleTypename;
}
} |
Loading…
Reference in new issue