package nc.ui.hbbb.hbscheme.view;

import nc.bs.framework.common.NCLocator;
import nc.itf.iufo.query.IUfoQueryInitService;
import nc.ui.iufo.uf2.HyperlinkListView;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.uif2.AppEvent;
import nc.ui.uif2.components.AutoShowUpEventSource;
import nc.ui.uif2.components.IAutoShowUpComponent;
import nc.ui.uif2.components.IAutoShowUpEventListener;
import nc.ui.uif2.components.ITabbedPaneAwareComponent;
import nc.ui.uif2.components.ITabbedPaneAwareComponentListener;
import nc.ui.uif2.components.TabbedPaneAwareCompnonetDelegate;
import nc.vo.hbbb.hbscheme.HBSchemeVO;
import nc.vo.pub.BusinessRuntimeException;

/**
 * 
 * @modified by jiaah at 2012-1-4 同步60
 *
 */
public class HBSchemeListView  extends HyperlinkListView implements ITabbedPaneAwareComponent, IAutoShowUpComponent {
	/**
	 * 
	 */
	private static final long serialVersionUID = -440750328980274264L;

	private AutoShowUpEventSource autoShowUpComponent;
	
	private TabbedPaneAwareCompnonetDelegate tabbedPaneAwareComponent;

	public HBSchemeListView() {
		autoShowUpComponent = new AutoShowUpEventSource(this);
		tabbedPaneAwareComponent = new TabbedPaneAwareCompnonetDelegate();
	}
	
	public void initUI() {
//		IUfoQueryInitService service = NCLocator.getInstance().lookup(IUfoQueryInitService.class);
//		int install = service.queryIsInstallNCC("UFOC");
//		if(install == 1){
//			String errorMsg = "由于您是新安装/升级到改版本的用户，且以前未使用过企业报表/合并报表，" +
//			 		"当前版本无法使用合并报表的相关功能，" +
//			 		"如您是NC6.5的升迁用户，且拥有企业报表及合并报表的授权，请由顾问联系商务以及研发人员进行解封操作！";
//			 MessageDialog.showErrorDlg(getParent(),"错误：",errorMsg);
//			 throw new BusinessRuntimeException(errorMsg);
//		}
		super.initUI(); 
		getBillListPanel().getHeadItem(HBSchemeVO.CODE).setListHyperlink(true);
	}
	
	@Override
	public void handleEvent(AppEvent event) {
		super.handleEvent(event);
	}

	
	public void addTabbedPaneAwareComponentListener(ITabbedPaneAwareComponentListener l) {
		tabbedPaneAwareComponent.addTabbedPaneAwareComponentListener(l);
	}

	public boolean canBeHidden() {
		return tabbedPaneAwareComponent.canBeHidden();
	}

	public boolean isComponentVisible() {
		return tabbedPaneAwareComponent.isComponentVisible();
	}

	public void setComponentVisible(boolean visible) {
		tabbedPaneAwareComponent.setComponentVisible(visible);

	}

	public void setAutoShowUpEventListener(IAutoShowUpEventListener l) {
		autoShowUpComponent.setAutoShowUpEventListener(l);
	}

	public void showMeUp() {
		autoShowUpComponent.showMeUp();

	}

	@Override
	public String getHeadHyperLinkItem() {
		return HBSchemeVO.CODE;
	}

	
	

}
