package com.vci.client.uif.actions.client; import java.util.Map; import javax.swing.JOptionPane; import com.vci.client.common.ConfigUtils; import com.vci.client.ui.swing.components.VCIJOptionPane; public abstract class DoseNotSelectDataHasRightCheckAction extends AbstractBusionessOperationAction { /** * Action框架主入口,继承复写请慎重... */ public boolean doAction(){ // 不基于已选择的数据,不需要对数据进行权限判断 String rightSwitch = ConfigUtils.getConfigValue("right.switch"); if(rightSwitch != null && rightSwitch.equals("on")){ //判断使用的选择的数据还是Sourcedata Object obj = null; boolean select = false; Map params = getButtonParams(); if(params.containsKey("needselect")) { String needselect = params.get("needselect"); if(needselect.equalsIgnoreCase("true")) { select = true; } } if(!select) { obj = getRegionPanel().getSourceData(); } else { Object[] objs = getDataModel().getSelectObjects(); if(objs != null && objs.length > 0) { obj = objs[0]; } } //判断是否为空 if(obj != null) { setCheckObject(obj); if(!checkHasRight()){ VCIJOptionPane.showMessageDialog( getParentComponent(), "您没有权限进行此操作!", "提示", JOptionPane.INFORMATION_MESSAGE); return false; } } } // 在选定了数据及有权限之后,执行 boolean res = doActionDetailBySelectedObject(); return res; } }