package com.vci.client.auth2.action;
|
|
import javax.swing.tree.DefaultMutableTreeNode;
|
import javax.swing.tree.TreePath;
|
|
import com.vci.client.auth2.utils.RightManagerHelper;
|
import com.vci.client.omd.btm.ui.BtmTree;
|
import com.vci.client.omd.btm.ui.ResourceTree;
|
import com.vci.client.omd.btm.wrapper.BtmItemWrapper;
|
import com.vci.corba.framework.data.GrandValue;
|
|
public class RefreshAction extends Action {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = -2263866118674785277L;
|
|
public RefreshAction(String name) {
|
super(name);
|
}
|
|
@Override
|
public void execute() {
|
// // 获取资源类型树
|
// BtmItem btm = GrandRightHelper.getResourceType(getFunclet());
|
// if (btm == null) {
|
// JOptionPane.showMessageDialog(
|
// com.vci.rmip.logon.client.LogonApplication.frame,
|
// "请选择业务类型", "提示", JOptionPane.WARNING_MESSAGE);
|
// return;
|
// }
|
// GrandValue[] dataSets = GrandRightHelper.getRightDatas(btm.name);
|
// if (dataSets.length == 0) {
|
// JOptionPane.showMessageDialog(
|
// com.vci.rmip.logon.client.LogonApplication.frame,
|
// "业务类型无规则信息", "提示", JOptionPane.WARNING_MESSAGE);
|
// return;
|
// }
|
// // 设置规则Table
|
// GrandRightHelper.setRuleListDatas(getFunclet(), dataSets);
|
// GrandRightHelper.addRuleTableSelectListener(getFunclet());
|
|
|
|
BtmTree resource = (BtmTree) getFunclet().getResourceTree();
|
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);
|
// 刷新操作中的生命周期与链接
|
|
getFunclet().initLcOfOperationPanel(bizItem.btmItem);
|
|
} else {
|
RightManagerHelper.clear(getFunclet());
|
}
|
//RightManagerHelper.clear(getFunclet());
|
// 资源树
|
getFunclet().getResourceTree().setEnabled(true);
|
getFunclet().enable(false);
|
getFunclet().getRightMainPanel().getSelectedSubjectComponent().setEnabled(false);
|
getFunclet().getRightMainPanel().getOrdinaryOpPanel().setEnabled(false);
|
getFunclet().getRightMainPanel().getRelationAndLifeCycleOpPanel().setEnabled(false);
|
getFunclet().getRightMainPanel().getLeft().setEnabled(false);
|
getFunclet().getRightMainPanel().getRight().setEnabled(false);
|
}
|
|
}
|