package com.vci.client.auth2.view;
|
|
import java.awt.BorderLayout;
|
import java.awt.Color;
|
import java.awt.FlowLayout;
|
import java.awt.GridBagConstraints;
|
import java.awt.GridBagLayout;
|
import java.awt.Toolkit;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.util.ArrayList;
|
import java.util.Iterator;
|
import java.util.List;
|
import java.util.Map;
|
import java.util.Set;
|
|
import javax.swing.JButton;
|
import javax.swing.JCheckBox;
|
import javax.swing.JComponent;
|
import javax.swing.JOptionPane;
|
import javax.swing.JPanel;
|
import javax.swing.JScrollPane;
|
import javax.swing.JSplitPane;
|
import javax.swing.JTextField;
|
import javax.swing.event.TreeSelectionEvent;
|
import javax.swing.event.TreeSelectionListener;
|
import javax.swing.tree.DefaultMutableTreeNode;
|
import javax.swing.tree.DefaultTreeModel;
|
import javax.swing.tree.TreeNode;
|
import javax.swing.tree.TreePath;
|
|
import com.vci.client.auth2.action.CheckRightAction;
|
import com.vci.client.auth2.action.DelAction;
|
import com.vci.client.auth2.action.EditAction;
|
import com.vci.client.auth2.action.NewAction;
|
import com.vci.client.auth2.action.OpsAllClearAction;
|
import com.vci.client.auth2.action.OpsAllSelectAction;
|
import com.vci.client.auth2.action.RefreshAction;
|
import com.vci.client.auth2.action.SaveRuleAction;
|
import com.vci.client.auth2.action.SelectDepAction;
|
import com.vci.client.auth2.action.SelectRoleAction;
|
import com.vci.client.auth2.action.SelectUserAction;
|
import com.vci.client.auth2.model.BooleanTableModel;
|
import com.vci.client.auth2.model.RoleModel;
|
import com.vci.client.auth2.model.UserGroupModel;
|
import com.vci.client.auth2.model.UserModel;
|
import com.vci.client.auth2.utils.ActionConstants;
|
import com.vci.client.auth2.utils.RightManagerHelper;
|
import com.vci.client.auth2.vo.OpItem;
|
import com.vci.client.common.VCIBasePanel;
|
import com.vci.client.framework.rightConfig.object.FunctionObject;
|
import com.vci.client.framework.specialrole.ModuleInterface.IModuleShow;
|
import com.vci.client.omd.btm.ui.BtmTree;
|
import com.vci.client.omd.btm.wrapper.BtmItemWrapper;
|
import com.vci.client.omd.provider.LifeCycleProvider;
|
import com.vci.client.omd.provider.LinkTypeProvider;
|
import com.vci.client.ui.util.PostorderEnumeration;
|
import com.vci.common.qt.object.Symbol;
|
import com.vci.corba.framework.data.CheckValue;
|
import com.vci.corba.framework.data.GrandValue;
|
import com.vci.corba.common.VCIError;
|
import com.vci.corba.omd.btm.BtmItem;
|
import com.vci.corba.omd.lcm.LifeCycle;
|
import com.vci.corba.omd.lcm.TransitionVO;
|
import com.vci.corba.omd.ltm.LinkType;
|
|
public class AbstractUIFunclet extends VCIBasePanel implements IModuleShow {
|
/**
|
*
|
*/
|
private static final long serialVersionUID = -3727722741228601983L;
|
// instance
|
private static AbstractUIFunclet instance = null;
|
// 工具条
|
private JPanel toolBarPanel = new ToolBarPanel();
|
// 左侧区域
|
private JPanel leftMainPanel = new JPanel();
|
// 右侧区域
|
private RightMainPanel rightMainPanel = new RightMainPanel(this);
|
// 类型资源树
|
private BtmTree resourceTree = new BtmTree();
|
private JPanel tipPanel = new JPanel();
|
// Action
|
private JButton[] actions;
|
// 常量
|
private GridBagConstraints gbc;
|
private FlowLayout flowlayout = new FlowLayout(FlowLayout.LEFT, 0, 0);
|
private static FunctionObject funcObj = new FunctionObject();
|
|
public static JPanel getInstance() {
|
// 2015.12.17 liucq 每次需要重新加载
|
instance = new AbstractUIFunclet(funcObj);
|
return instance;
|
}
|
|
public RightMainPanel getRightMainPanel() {
|
return rightMainPanel;
|
}
|
|
public void setRightMainPanel(RightMainPanel rightMainPanel) {
|
this.rightMainPanel = rightMainPanel;
|
}
|
|
public JPanel getLeftMainPanel() {
|
return leftMainPanel;
|
}
|
|
public void setLeftMainPanel(JPanel leftMainPanel) {
|
this.leftMainPanel = leftMainPanel;
|
}
|
|
public JPanel getTipPanel() {
|
return tipPanel;
|
}
|
|
public void setTipPanel(JPanel tipPanel) {
|
this.tipPanel = tipPanel;
|
}
|
|
public BtmTree getResourceTree() {
|
return resourceTree;
|
}
|
|
public void setResourceTree(BtmTree resourceTree) {
|
this.resourceTree = resourceTree;
|
}
|
|
public JButton[] getActions() {
|
return actions;
|
}
|
|
public void setActions(JButton[] actions) {
|
this.actions = actions;
|
updateMenu();
|
}
|
|
public void updateMenu() {
|
for (JButton b : actions) {
|
toolBarPanel.add(b);
|
}
|
}
|
|
public JPanel getToolBar() {
|
toolBarPanel.setLayout(flowlayout);
|
return toolBarPanel;
|
}
|
|
public AbstractUIFunclet(FunctionObject funcObj) {
|
super(funcObj);
|
init();
|
}
|
|
private void init() {
|
initUI();
|
initData();
|
initDetailData();
|
}
|
|
private void initDetailData() {
|
this.getRightMainPanel().getFunclet().enable(false);
|
this.getRightMainPanel().getRuleNameTextField().setEnabled(false);
|
this.getRightMainPanel().getOrdinaryOpPanel().setEnabled(false);
|
this.getRightMainPanel().getRelationAndLifeCycleOpPanel().setEnabled(false);
|
this.getRightMainPanel().getSelectedSubjectComponent().setEnabled(false);
|
}
|
|
private void initData() {
|
// 规则信息
|
BooleanTableModel rules = new BooleanTableModel();
|
this.getRightMainPanel().getRuleTable().setModel(rules);
|
UserModel usermodel = new UserModel();
|
this.getRightMainPanel().getUserTable().setModel(usermodel);
|
|
RoleModel roleModel = new RoleModel();
|
this.getRightMainPanel().getRoleTable().setModel(roleModel);
|
|
UserGroupModel ugModel = new UserGroupModel();
|
this.getRightMainPanel().getUserGroupTable().setModel(ugModel);
|
|
// 增加树监听器
|
this.addResourceTreeSelectListener();
|
// 新增
|
NewAction add = new NewAction("新增");
|
add.setDragEnable(true);
|
add.setFunclet(this);
|
// 修改
|
EditAction edit = new EditAction("编辑");
|
edit.setDragEnable(true);
|
edit.setFunclet(this);
|
// 刷新
|
RefreshAction modify = new RefreshAction("刷新");
|
modify.setFunclet(this);
|
modify.setDragEnable(true);
|
// 删除
|
DelAction del = new DelAction("删除");
|
del.setFunclet(this);
|
del.setDragEnable(true);
|
// 保存
|
SaveRuleAction save = new SaveRuleAction("保存");
|
save.setFunclet(this);
|
save.setDragEnable(true);
|
|
// 查看授权结果
|
CheckRightAction checkRight = new CheckRightAction("查看授权结果");
|
checkRight.setFunclet(this);
|
checkRight.setDragEnable(true);
|
// this.setActions(new JButton[] { add, modify, del, save, edit });
|
// right center tool bar
|
this.getRightMainPanel().getRightCenterToolBar().add(add);
|
this.getRightMainPanel().getRightCenterToolBar().add(modify);
|
this.getRightMainPanel().getRightCenterToolBar().add(del);
|
this.getRightMainPanel().getRightCenterToolBar().add(save);
|
this.getRightMainPanel().getRightCenterToolBar().add(edit);
|
this.getRightMainPanel().getRightCenterToolBar().add(checkRight);
|
SelectUserAction selectUser = new SelectUserAction("选择用户");
|
selectUser.setFunclet(this);
|
SelectRoleAction selectRole = new SelectRoleAction("选择角色");
|
selectRole.setFunclet(this);
|
SelectDepAction selectDep = new SelectDepAction("选择用户组");
|
selectDep.setFunclet(this);
|
this.getRightMainPanel().setSubjectActions(new JButton[] { selectUser, selectRole, selectDep });
|
|
OpsAllClearAction clear = new OpsAllClearAction("清空");
|
clear.setFunclet(this);
|
OpsAllSelectAction allSelelct = new OpsAllSelectAction("全选");
|
allSelelct.setFunclet(this);
|
|
this.getRightMainPanel().setOperationActions(new JButton[] { clear, allSelelct });
|
// 一般操作
|
// String[] operations = ActionConstants.getInstance().getAllBusinessActionNames();//IRightConstant.OPS_ORDINARY.split(",");
|
|
// ((OrdinaryOpPanel) this.getRightMainPanel().getOrdinaryOpPanel())
|
// .setOperations(operations);
|
|
this.enable(false);
|
}
|
|
private void initUI() {
|
this.gbc = new GridBagConstraints();
|
this.gbc.gridx = 0;
|
this.gbc.gridy = 0;
|
this.gbc.weightx = 0.7;
|
this.gbc.weighty = 1.0;
|
this.gbc.fill = GridBagConstraints.HORIZONTAL;
|
this.setBackground(Color.WHITE);
|
this.setLayout(new BorderLayout(0, 0));
|
// Tool bar
|
this.add(getToolBar(actions), BorderLayout.NORTH);
|
// split
|
getRightMainPanel().setFunclet(this);
|
this.add(getSplitPane(JSplitPane.HORIZONTAL_SPLIT, getLeftMain(), getRightMainPanel()), BorderLayout.CENTER);
|
}
|
|
private JPanel getToolBar(JButton[] buttons) {
|
toolBarPanel.setLayout(flowlayout);
|
if (buttons == null) {
|
return toolBarPanel;
|
}
|
for (JButton b : buttons) {
|
toolBarPanel.add(b);
|
}
|
return toolBarPanel;
|
}
|
|
private JPanel getLeftMain() {
|
// main panel
|
leftMainPanel.setLayout(new BorderLayout());
|
JPanel leftNorthPanel = new JPanel();
|
JPanel leftCenterPanel = new JPanel();
|
//JPanel leftSouthPanel = new JPanel();
|
|
// JScrollPane滚动条
|
JScrollPane jscrollPane = new JScrollPane();
|
|
leftMainPanel.add(leftNorthPanel, BorderLayout.NORTH);
|
leftMainPanel.add(leftCenterPanel, BorderLayout.CENTER);
|
//leftMainPanel.add(leftSouthPanel, BorderLayout.SOUTH);
|
|
// left main center tree
|
leftCenterPanel.setLayout(new BorderLayout());
|
leftCenterPanel.add(jscrollPane, BorderLayout.CENTER);
|
jscrollPane.getViewport().add(resourceTree);
|
// left main north text
|
final JTextField textField = new JTextField();
|
// add by caill
|
// 给业务类型树添加定位按钮
|
final JButton sel = new JButton("定位");
|
leftNorthPanel.setLayout(new GridBagLayout());
|
leftNorthPanel.add(textField, gbc);
|
leftNorthPanel.add(sel);
|
// add by caill start
|
// 为定位按钮添加点击事件
|
sel.addActionListener(new ActionListener() {
|
@Override
|
public void actionPerformed(ActionEvent e) {
|
// e.getSource();
|
String test = textField.getText().trim();
|
DefaultTreeModel model = (DefaultTreeModel) resourceTree.getModel();
|
model.reload();
|
TreeNode root = (TreeNode) model.getRoot();
|
PostorderEnumeration enumeration = new PostorderEnumeration(root);
|
while (enumeration.hasMoreElements()) {
|
DefaultMutableTreeNode element = (DefaultMutableTreeNode) enumeration.nextElement();
|
if (element.getUserObject() instanceof BtmItemWrapper) {
|
BtmItemWrapper wrapper = (BtmItemWrapper) element.getUserObject();
|
|
if (wrapper != null && wrapper.btmItem != null && wrapper.btmItem.name.equals(test)) {
|
TreeNode[] path = element.getPath();
|
TreePath treePath = new TreePath(path);
|
resourceTree.setSelectionPath(treePath);
|
return;
|
}
|
}
|
}
|
if (test.equals("")) {
|
JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame, "请输入业务类型", "提示",
|
JOptionPane.INFORMATION_MESSAGE);
|
} else {
|
JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame,
|
"{ " + test + " }业务类型不存在", "提示", JOptionPane.INFORMATION_MESSAGE);
|
}
|
|
}
|
|
});
|
// add by caill end
|
textField.addActionListener(new ActionListener() {
|
|
@Override
|
public void actionPerformed(ActionEvent e) {
|
JTextField text = (JTextField) e.getSource();
|
String test = text.getText().trim();
|
DefaultTreeModel model = (DefaultTreeModel) resourceTree.getModel();
|
model.reload();
|
TreeNode root = (TreeNode) model.getRoot();
|
PostorderEnumeration enumeration = new PostorderEnumeration(root);
|
while (enumeration.hasMoreElements()) {
|
DefaultMutableTreeNode element = (DefaultMutableTreeNode) enumeration.nextElement();
|
if (element.getUserObject() instanceof BtmItemWrapper) {
|
BtmItemWrapper wrapper = (BtmItemWrapper) element.getUserObject();
|
|
if (wrapper != null && wrapper.btmItem != null && wrapper.btmItem.name.equals(test)) {
|
TreeNode[] path = element.getPath();
|
TreePath treePath = new TreePath(path);
|
resourceTree.setSelectionPath(treePath);
|
return;
|
}
|
;
|
}
|
}
|
if (test.equals("")) {
|
JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame, "请输入业务类型", "提示",
|
JOptionPane.INFORMATION_MESSAGE);
|
} else {
|
JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame,
|
"{ " + test + " }业务类型不存在", "提示", JOptionPane.INFORMATION_MESSAGE);
|
}
|
|
}
|
|
});
|
|
// left main south tool bar
|
// leftSouthPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
// ExpandAction one = new ExpandAction("1");
|
// one.setFunclet(this);
|
// one.setLevel(1);
|
// leftSouthPanel.add(one);
|
//
|
// ExpandAction two = new ExpandAction("2");
|
// two.setFunclet(this);
|
// two.setLevel(2);
|
// leftSouthPanel.add(two);
|
//
|
// ExpandAction third = new ExpandAction("3");
|
// third.setFunclet(this);
|
// third.setLevel(3);
|
// leftSouthPanel.add(third);
|
//
|
// ExpandAction four = new ExpandAction("4");
|
// four.setFunclet(this);
|
// four.setLevel(4);
|
// leftSouthPanel.add(four);
|
//
|
// ExpandAction five = new ExpandAction("5");
|
// five.setFunclet(this);
|
// five.setLevel(5);
|
// leftSouthPanel.add(five);
|
//
|
// ExpandAction six = new ExpandAction("6");
|
// six.setFunclet(this);
|
// six.setLevel(6);
|
// leftSouthPanel.add(six);
|
|
return leftMainPanel;
|
}
|
|
private JSplitPane getSplitPane(int type, JComponent one, JComponent other) {
|
// split (JSplitPane.HORIZONTAL_SPLIT)
|
JSplitPane centerPanel = new JSplitPane(type, one, other);
|
centerPanel.setDividerLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 5);
|
// 是否可以展开
|
centerPanel.setOneTouchExpandable(true);
|
return centerPanel;
|
}
|
|
public void enable(boolean value) {
|
// 规则名称
|
this.getRightMainPanel().getRuleNameTextField().setEnabled(value);
|
// 规则面板的Combobox
|
this.getRightMainPanel().getRuleTypeCombbox().setEnabled(value);
|
// 主体面板的Action
|
JButton[] actions = this.getRightMainPanel().getSubjectActions();
|
for (JButton button : actions) {
|
button.setEnabled(value);
|
}
|
// 操作面板Action
|
|
JButton[] opActions = this.getRightMainPanel().getOperationActions();
|
for (JButton button : opActions) {
|
button.setEnabled(value);
|
}
|
// 一般操作控件
|
JCheckBox[] checkBoxs = ((OrdinaryOpPanel) this.getRightMainPanel().getOrdinaryOpPanel()).getOpCheckBoxs();
|
for (JCheckBox cb : checkBoxs) {
|
|
// cb.isSelected()
|
cb.setEnabled(value);
|
}
|
// 关系和跃迁
|
JCheckBox[] rlcheckBoxs = ((RelationAndLifeCycleOpPanel) this.getRightMainPanel()
|
.getRelationAndLifeCycleOpPanel()).getOpCheckBoxs();
|
for (JCheckBox cb : rlcheckBoxs) {
|
|
// cb.isSelected()
|
cb.setEnabled(value);
|
}
|
|
}
|
|
public AbstractUIFunclet getFunclet() {
|
return this;
|
}
|
|
public void addResourceTreeSelectListener() {
|
BtmTree tree = getFunclet().getResourceTree();
|
|
tree.addTreeSelectionListener(new TreeSelectionListener() {
|
public void valueChanged(TreeSelectionEvent e) {
|
TreePath path = e.getPath();
|
if (path == null) {
|
return;
|
}
|
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
|
if (!node.isRoot()) {
|
BtmItemWrapper bizItem = (BtmItemWrapper) node.getUserObject();
|
// 重新刷新规则面板信息
|
GrandValue[] dataSets = RightManagerHelper.getRightDatas(bizItem.btmItem.name);
|
// 设置规则Table
|
// add by caill 2015.12.18 增加参数bizItem.btmItem.name
|
RightManagerHelper.setRuleListDatas(getFunclet(), dataSets, bizItem.btmItem.name);
|
// 刷新操作中的生命周期与链接
|
|
initLcOfOperationPanel(bizItem.btmItem);
|
initActions(bizItem.btmItem.name);
|
|
} else {
|
RightManagerHelper.clear(getFunclet());
|
}
|
enable(false);
|
getRightMainPanel().getLeft().setEnabled(false);
|
getRightMainPanel().getRight().setEnabled(false);
|
}
|
});
|
|
// tree.addMouseListener(new MouseListener() {
|
//
|
// @Override
|
// public void mouseReleased(MouseEvent e) {
|
//
|
// }
|
//
|
// @Override
|
// public void mousePressed(MouseEvent e) {
|
//
|
// }
|
//
|
// @Override
|
// public void mouseExited(MouseEvent e) {
|
//
|
// }
|
//
|
// @Override
|
// public void mouseEntered(MouseEvent e) {
|
//
|
// }
|
//
|
// @Override
|
// public void mouseClicked(MouseEvent e) {
|
// BtmTree resource = (BtmTree) e.getSource();
|
// TreePath path = resource.getSelectionPath();
|
// if (path == null) {
|
// return;
|
// }
|
// DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
|
// if (!node.isRoot()) {
|
// BtmItemWrapper bizItem = (BtmItemWrapper) node.getUserObject();
|
// // 重新刷新规则面板信息
|
// GrandValue[] dataSets = RightManagerHelper.getRightDatas(bizItem.btmItem.name);
|
// // 设置规则Table
|
// // add by caill 2015.12.18 增加参数bizItem.btmItem.name
|
// RightManagerHelper.setRuleListDatas(getFunclet(), dataSets, bizItem.btmItem.name);
|
// // 刷新操作中的生命周期与链接
|
//
|
// initLcOfOperationPanel(bizItem.btmItem);
|
// initActions(bizItem.btmItem.name);
|
//
|
// } else {
|
// RightManagerHelper.clear(getFunclet());
|
// }
|
// enable(false);
|
// getRightMainPanel().getLeft().setEnabled(false);
|
// getRightMainPanel().getRight().setEnabled(false);
|
// }
|
// });
|
|
}
|
|
private void initActions(String typeName) {
|
// String[] operations =
|
// ActionConstants.getInstance().getAllBuinessActionNamesByType(typeName,
|
// "business");//IRightConstant.OPS_ORDINARY.split(",");
|
// ((OrdinaryOpPanel)
|
// this.getRightMainPanel().getOrdinaryOpPanel()).setOperations(operations);
|
// add by caill start 2015.12.18
|
Map<String, String> operations2 = ActionConstants.getInstance().getAllBuinessActionNamesByType2(typeName,
|
"business");
|
((OrdinaryOpPanel) this.getRightMainPanel().getOrdinaryOpPanel()).setOperations2(operations2);
|
// add by caill end
|
}
|
|
public void initLcOfOperationPanel(BtmItem btmName) {
|
// 初始化
|
((RelationAndLifeCycleOpPanel) this.getRightMainPanel().getRelationAndLifeCycleOpPanel()).removeAll();
|
// 关系和跃迁
|
// 缓存中读取链接的信息
|
LinkType[] links = null;
|
LifeCycle lifeCycle = null;
|
try {
|
links = LinkTypeProvider.getInstance().getLinkTypeByBtmName(btmName.name, Symbol.FROM);
|
LifeCycle[] lifeCyles = LifeCycleProvider.getInstance().getLifeCyles();
|
for (int m = 0; m < lifeCyles.length; m++) {
|
if (lifeCyles[m].name.equals(btmName.lifeCycle)) {
|
lifeCycle = lifeCyles[m];
|
break;
|
}
|
}
|
} catch (Throwable e) {
|
e.printStackTrace();
|
}
|
List<String> rloperations = new ArrayList<String>();
|
//
|
// String[] linkActions = ActionConstants.getInstance().getAllLinkActionNames();
|
// add by caill start 2016.1.6 将关系和跃迁区域内的英文显示为中文
|
List<String> rloperationsChina = new ArrayList<String>();
|
Map<String, String> linkActions = ActionConstants.getInstance().getAllBuinessActionNamesByType2(btmName.name,
|
"link");// 将对应的中英文值存放到map中
|
Set<String> keys = null;
|
if (linkActions.size() > 0) {
|
keys = linkActions.keySet();
|
}
|
for (int i = 0; i < links.length; i++) {
|
if (keys.size() != 0) {
|
for (Iterator<String> iterator = keys.iterator(); iterator.hasNext();) {
|
JCheckBox cb = new JCheckBox();
|
String key = iterator.next();
|
rloperations.add(links[i].name + "." + linkActions.get(key));
|
rloperationsChina.add(links[i].name + "." + key); // 增加一个list用来存放中文值
|
}
|
}
|
}
|
// add by caill end
|
/*
|
* String[] linkActions =
|
* ActionConstants.getInstance().getAllBuinessActionNamesByType(btmName.name,
|
* "link"); for (int i = 0; i < links.length; i++) { for (int j = 0; j <
|
* linkActions.length; j++) { rloperations.add(links[i].name + "." +
|
* linkActions[j]); } }
|
*/
|
TransitionVO[] transitions = lifeCycle != null ? lifeCycle.routes : new TransitionVO[0];
|
for (int j = 0; j < transitions.length; j++) {
|
rloperations.add(lifeCycle.name + "." + transitions[j].connect);
|
}
|
((RelationAndLifeCycleOpPanel) this.getRightMainPanel().getRelationAndLifeCycleOpPanel()).setOperations(
|
rloperations.toArray(new String[rloperations.size()]),
|
rloperationsChina.toArray(new String[rloperationsChina.size()])); // add by caill 2016.1.6
|
// 添加rloperationsChina参数以便将中文值传递过去
|
// 关系和跃迁
|
JCheckBox[] rlcheckBoxs = ((RelationAndLifeCycleOpPanel) this.getRightMainPanel()
|
.getRelationAndLifeCycleOpPanel()).getOpCheckBoxs();
|
for (JCheckBox cb : rlcheckBoxs) {
|
// cb.isSelected()
|
cb.setEnabled(false);
|
}
|
}
|
|
public static void main(String[] args) {
|
// CheckValue params = new CheckValue();
|
// try {
|
// params.users = "1";
|
// params.roles = "测试角色";
|
// params.userGroups = "";
|
// params.paramValues = "";
|
// params.businesstype = "PartClsf";
|
// params.opname = "mody";
|
// params.objectmoid = "";
|
// params.objectroid = "";
|
// params.objectoid = "D2AB2C96-9BF4-AB14-BEF9-85CFF0036D0B";
|
//
|
// String where = RightManagerHelper.getAuth2Service().checkRight(params);
|
// String[] ops = where.split(":");
|
// List<OpItem> opitems = new ArrayList<OpItem>();
|
// for (String s : ops) {
|
// if (s != null && !s.equals("")) {
|
// OpItem item = new OpItem();
|
// String[] op = s.split(",");
|
// item.setName(op[0]);
|
// item.setValue(op[1]);
|
// opitems.add(item);
|
// }
|
//
|
// }
|
//
|
// } catch (VCIError e) {
|
// e.printStackTrace();
|
// }
|
// UserEntityObject ueo = new UserEntityObject();
|
// ueo.setIp("192.168.0.50");
|
// ueo.setUserName("eddieliu");
|
// com.vci.rmip.logon.client.LogonApplication.userEntityObject = ueo;
|
// UserObject user = new UserObject();
|
// user.setUserType(2);
|
// user.setUserName("shebei");
|
// user.setTrueName("设备");
|
// com.vci.rmip.logon.client.LogonApplication.userObject = user;
|
//
|
// VCIJFrame frame = new VCIJFrame();
|
// frame.setSize(1600, 880);
|
// com.vci.rmip.logon.client.LogonApplication.frame = frame;
|
//
|
// AbstractUIFunclet view = (AbstractUIFunclet) AbstractUIFunclet
|
// .getInstance();
|
//
|
// frame.add(view);
|
// // 规则信息
|
// RuleModel rules = new RuleModel();
|
// view.getRightMainPanel().getRuleTable().setModel(rules);
|
//
|
// UserModel usermodel = new UserModel();
|
// view.getRightMainPanel().getUserTable().setModel(usermodel);
|
//
|
// RoleModel roleModel = new RoleModel();
|
// view.getRightMainPanel().getRoleTable().setModel(roleModel);
|
//
|
// UserGroupModel ugModel = new UserGroupModel();
|
// view.getRightMainPanel().getUserGroupTable().setModel(ugModel);
|
// // 增加树监听器
|
// view.addResourceTreeSelectListener();
|
// // 新增
|
// NewAction add = new NewAction("新增");
|
// add.setDragEnable(true);
|
// add.setFunclet(view);
|
// // 修改
|
// EditAction edit = new EditAction("编辑");
|
// edit.setDragEnable(true);
|
// edit.setFunclet(view);
|
// // 刷新
|
// RefreshAction modify = new RefreshAction("刷新");
|
// modify.setFunclet(view);
|
// modify.setDragEnable(true);
|
// // 删除
|
// DelAction del = new DelAction("删除");
|
// del.setFunclet(view);
|
// del.setDragEnable(true);
|
// // 保存
|
// SaveRuleAction save = new SaveRuleAction("保存");
|
// save.setFunclet(view);
|
// save.setDragEnable(true);
|
// // view.setActions(new JButton[] { add, modify, del, save, edit });
|
// // right center tool bar
|
// view.getRightMainPanel().getRightCenterToolBar().add(add);
|
// view.getRightMainPanel().getRightCenterToolBar().add(modify);
|
// view.getRightMainPanel().getRightCenterToolBar().add(del);
|
// view.getRightMainPanel().getRightCenterToolBar().add(save);
|
// view.getRightMainPanel().getRightCenterToolBar().add(edit);
|
// SelectUserAction selectUser = new SelectUserAction("选择用户");
|
// selectUser.setFunclet(view);
|
// SelectRoleAction selectRole = new SelectRoleAction("选择角色");
|
// selectRole.setFunclet(view);
|
// SelectDepAction selectDep = new SelectDepAction("选择部门");
|
// selectDep.setFunclet(view);
|
// view.getRightMainPanel().setSubjectActions(
|
// new JButton[] { selectUser, selectRole, selectDep });
|
//
|
// OpsAllClearAction clear = new OpsAllClearAction("清空");
|
// clear.setFunclet(view);
|
// OpsAllSelectAction allSelelct = new OpsAllSelectAction("全选");
|
// allSelelct.setFunclet(view);
|
//
|
// view.getRightMainPanel().setOperationActions(
|
// new JButton[] { clear, allSelelct });
|
// // 一般操作
|
// String[] operations =
|
// "add,del,mody,change,view,query,revision,delall,object,version,hello,upload,download"
|
// .split(",");
|
//
|
// ((OrdinaryOpPanel) view.getRightMainPanel().getOrdinaryOpPanel())
|
// .setOperations(operations);
|
// // 关系和跃迁
|
// String[] rloperations =
|
// "ptop.add ,ptop.del,ptop.mody,lc.begin,lc.end"
|
// .split(",");
|
// ((RelationAndLifeCycleOpPanel) view.getRightMainPanel()
|
// .getRelationAndLifeCycleOpPanel()).setOperations(rloperations);
|
// view.enable(false);
|
// frame.show();
|
}
|
|
@Override
|
public String getUserID() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
@Override
|
public String getRoleID() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
@Override
|
public JPanel getModuleComponent() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
@Override
|
public String getModuleName() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
@Override
|
public String getIconName() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
@Override
|
public String getModuleShowInfo() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
}
|