package com.gx.obe.management.composite;

import org.eclipse.swt.SWT;
import org.eclipse.swt.core.listener.ChangeTextListener;
import org.eclipse.swt.core.utils.WidgetUtils;
import org.eclipse.swt.core.widgets.ELink;
import org.eclipse.swt.core.widgets.ImageButton;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;

import com.gx.obe.ColorConstants;
import com.gx.obe.common.icons.IconsActivator;
import com.gx.obe.common.widget.utils.MenuFunctionUtils;
import com.gx.obe.components.core.I18NEnum;
import com.gx.obe.components.core.enumeration.CommonEnum;
import com.gx.obe.components.core.enumeration.TenderProjectEnum;
import com.gx.obe.listener.ProjectItemMouseEnterListener;
import com.gx.obe.management.composite.SubPackageListComposite.PackageOpListener;
import com.gx.obe.message.Messages;
import com.gx.obe.util.utils.DateUtils;
import com.gx.obe.util.utils.ObjectUtils;
import com.gx.obe.web.entity.tender.TenderProjectEntity;
import com.gx.obe.web.vo.TenderProjectVo;
import com.gx.security.NowTimeUtils;
import com.swtdesigner.ResourceManager;
import com.swtdesigner.SWTResourceManager;

public class SubPackageItemComposite extends Composite {

	private Label indexLabel;
	private Label tenderNoLabel;
	private ELink tenderNameLabel;
	private CLabel phaseTypeLabel;
	private Label countTitle_label;
	private Label countValue_label;
	private Label tenderTypeValueLabel;
	private Label tenderMethodValueLabel;
	private Label bidOpeningTimeValueLabel;
//	private Label evalTimeValueLabel;
	private ELink deleteBtn;
	public static final String  FORMAT = "yyyy-MM-dd HH:mm";
	private PackageOpListener listener;
// 	private TenderProjectEntity tenderProjectEntity;
	private ELink goto_btn;
//	private Composite topComposite;
//	private TenderPcakVo tenderPcakVo;
	private TenderProjectEntity tenderProject;
	private CLabel label_7;
	private Label openingStatusLabel;
	private ImageButton openingUploadStatusLabel;
	private Composite evalResultComposite;
	private Label evalStatusLabel;
	private ImageButton evalUploadStatusLabel;
	private MenuFunctionUtils menuFunctions;
	private Composite openingStatusComposite;
	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public SubPackageItemComposite(Composite parent, MenuFunctionUtils menuFunctions, int style) {
		super(parent, style);
		this.menuFunctions = menuFunctions;
		setBackgroundMode(SWT.INHERIT_FORCE);
		setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		GridLayout gridLayout = new GridLayout(1, false);
		gridLayout.marginHeight = 2;
		gridLayout.marginWidth = 2;
		gridLayout.horizontalSpacing = 0;
		gridLayout.verticalSpacing = 0;
		setLayout(gridLayout);
		
		Composite composite = new Composite(this, SWT.NONE);
		composite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		composite.setLayout(new GridLayout(5, false));
		GridData gd_composite = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
		gd_composite.widthHint = 700;
		composite.setLayoutData(gd_composite);
		
		Composite composite_2 = new Composite(composite, SWT.NONE);
		composite_2.setBackgroundMode(SWT.INHERIT_FORCE);
		composite_2.setBackground(SWTResourceManager.getColor(255, 153, 51));
		composite_2.setLayout(new GridLayout(1, false));
		
		indexLabel = new Label(composite_2, SWT.NONE);
		indexLabel.setAlignment(SWT.CENTER);
		indexLabel.setFont(SWTResourceManager.getFont("微软雅黑", 12, SWT.BOLD));
		indexLabel.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		indexLabel.setText("01");
		
		tenderNoLabel = new Label(composite, SWT.NONE);
		tenderNoLabel.setFont(SWTResourceManager.getFont("微软雅黑", 11, SWT.NORMAL));
		tenderNoLabel.setForeground(ColorConstants.FONT_BLACK_COLOR);
		tenderNoLabel.setText("");
		
		tenderNameLabel = new ELink(composite, SWT.NONE);
		tenderNameLabel.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
		tenderNameLabel.setFont(SWTResourceManager.getFont("微软雅黑", 11, SWT.NORMAL));
		tenderNameLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		goto_btn = new ELink(composite, SWT.NONE);
		goto_btn.setActiveColor(SWTResourceManager.getColor(255, 153, 0));
		goto_btn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/goto.png"));
		goto_btn.setText(Messages.Enter);
		
		
		deleteBtn = new ELink(composite, SWT.NONE);
		deleteBtn.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseUp(MouseEvent e) {
				deleteProjectAction();
			}
		});
		deleteBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/delete.png"));
		deleteBtn.setText(Messages.Button_delete);
		menuFunctions.addFunction(deleteBtn, "DELETE_PACKAGE");
		
		Label label = new Label(this, SWT.NONE);
		label.setBackground(SWTResourceManager.getColor(240, 240, 240));
		GridData gd_label = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
		gd_label.heightHint = 1;
		label.setLayoutData(gd_label);
		
		Composite composite_1 = new Composite(this, SWT.NONE);
		composite_1.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
		GridLayout gl_composite_1 = new GridLayout(3, false);
		gl_composite_1.horizontalSpacing = 0;
		gl_composite_1.marginWidth = 0;
		gl_composite_1.marginHeight = 0;
		composite_1.setLayout(gl_composite_1);
		composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		menuFunctions.addFunction(composite_1, "PHASE_TYPE");
		
		phaseTypeLabel = new CLabel(composite_1, SWT.NONE);
		phaseTypeLabel.setAlignment(SWT.CENTER);
		GridData gd_phaseTypeLabel = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
		gd_phaseTypeLabel.widthHint = 32;
		phaseTypeLabel.setLayoutData(gd_phaseTypeLabel);
		phaseTypeLabel.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/phase_type.png"));
		
		CLabel label_4 = new CLabel(composite_1, SWT.NONE);
		label_4.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/gv.png"));
		menuFunctions.addFunction(label_4, "COUNT");
		
		Composite infoComposite = new Composite(composite_1, SWT.NONE);
		GridLayout gl_infoComposite = new GridLayout(11, false);
		gl_infoComposite.marginWidth = 0;
		gl_infoComposite.marginHeight = 0;
		infoComposite.setLayout(gl_infoComposite);
		infoComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Composite subPackCountComposite = new Composite(infoComposite, SWT.NONE);
		subPackCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		GridLayout gl_subPackCountComposite = new GridLayout(2, false);
		gl_subPackCountComposite.horizontalSpacing = 0;
		gl_subPackCountComposite.marginWidth = 0;
		gl_subPackCountComposite.marginHeight = 0;
		subPackCountComposite.setLayout(gl_subPackCountComposite);
		menuFunctions.addFunction(subPackCountComposite, "COUNT");
		
		countTitle_label = new Label(subPackCountComposite, SWT.NONE);
		countTitle_label.setText(Messages.Supplier +"：");
		countTitle_label.setForeground(ColorConstants.FONT_BLACK_COLOR);
		
		countValue_label = new Label(subPackCountComposite, SWT.NONE);
		countValue_label.setForeground(SWTResourceManager.getColor(72, 152, 21));
		
		CLabel lab_5 = new CLabel(infoComposite, SWT.NONE);
		lab_5.setAlignment(SWT.CENTER);
		GridData gd_lab_5 = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
		gd_lab_5.widthHint = 20;
		lab_5.setLayoutData(gd_lab_5);
		lab_5.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/v_gray.png"));
		menuFunctions.addFunction(lab_5, "TENDER_TYPE");
		
		Composite tenderTypeComposite = new Composite(infoComposite, SWT.NONE);
		subPackCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		GridLayout gl_tenderTypeComposite = new GridLayout(2, false);
		gl_tenderTypeComposite.horizontalSpacing = 0;
		gl_tenderTypeComposite.marginWidth = 0;
		gl_tenderTypeComposite.marginHeight = 0;
		tenderTypeComposite.setLayout(gl_tenderTypeComposite);
		menuFunctions.addFunction(tenderTypeComposite, "TENDER_TYPE");
		
		Label tenderTypeLabel = new Label(tenderTypeComposite, SWT.NONE);
		tenderTypeLabel.setText(Messages.TenderType + "：");
		tenderTypeLabel.setForeground(ColorConstants.FONT_BLACK_COLOR);
		
		tenderTypeValueLabel = new Label(tenderTypeComposite, SWT.NONE);
		tenderTypeValueLabel.setForeground(SWTResourceManager.getColor(72, 152, 21));
		
		CLabel label_5 = new CLabel(infoComposite, SWT.NONE);
		label_5.setAlignment(SWT.CENTER);
		GridData gd_label_5 = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
		gd_label_5.widthHint = 20;
		label_5.setLayoutData(gd_label_5);
		label_5.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/v_gray.png"));
		menuFunctions.addFunction(label_5, "TENDER_METHOD");
		
		Composite tenderMethodComposite = new Composite(infoComposite, SWT.NONE);
		subPackCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		GridLayout gl_tenderMethodComposite = new GridLayout(2, false);
		gl_tenderMethodComposite.horizontalSpacing = 0;
		gl_tenderMethodComposite.marginWidth = 0;
		gl_tenderMethodComposite.marginHeight = 0;
		tenderMethodComposite.setLayout(gl_tenderMethodComposite);
		menuFunctions.addFunction(tenderMethodComposite, "TENDER_METHOD");
		
		Label tenderMethodLabel = new Label(tenderMethodComposite, SWT.NONE);
		tenderMethodLabel.setText(Messages.TenderMethod+"：");
		tenderMethodLabel.setForeground(ColorConstants.FONT_BLACK_COLOR);
		
		tenderMethodValueLabel = new Label(tenderMethodComposite, SWT.NONE);
		tenderMethodValueLabel.setForeground(SWTResourceManager.getColor(72, 152, 21));
		
		CLabel label_6 = new CLabel(infoComposite, SWT.NONE);
		label_6.setAlignment(SWT.CENTER);
		GridData gd_label_6 = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
		gd_label_6.widthHint = 20;
		label_6.setLayoutData(gd_label_6);
		label_6.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/v_gray.png"));
		menuFunctions.addFunction(label_6, "OPENING_TIME");
		
		Composite bidOpeningTimeComposite = new Composite(infoComposite, SWT.NONE);
		subPackCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		GridLayout gl_bidOpeningTimeComposite = new GridLayout(2, false);
		gl_bidOpeningTimeComposite.horizontalSpacing = 0;
		gl_bidOpeningTimeComposite.marginWidth = 0;
		gl_bidOpeningTimeComposite.marginHeight = 0;
		bidOpeningTimeComposite.setLayout(gl_bidOpeningTimeComposite);
		menuFunctions.addFunction(bidOpeningTimeComposite, "OPENING_TIME");
		
		Label bidOpeningTimeLabel = new Label(bidOpeningTimeComposite, SWT.NONE);
		bidOpeningTimeLabel.setText(Messages.BidOpeningTime+"：");
		bidOpeningTimeLabel.setForeground(ColorConstants.FONT_BLACK_COLOR);
		
		bidOpeningTimeValueLabel = new Label(bidOpeningTimeComposite, SWT.NONE);
		bidOpeningTimeValueLabel.setForeground(SWTResourceManager.getColor(72, 152, 21));
		
		label_7 = new CLabel(infoComposite, SWT.NONE);
		label_7.setAlignment(SWT.CENTER);
		GridData gd_label_7 = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
		gd_label_7.widthHint = 20;
		label_7.setLayoutData(gd_label_7);
		label_7.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/v_gray.png"));
		menuFunctions.addFunction(label_7, "OPENING_STATUS");
		
		openingStatusComposite = new Composite(infoComposite, SWT.NONE);
		subPackCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		GridLayout gl_openingStatusComposite = new GridLayout(3, false);
		gl_openingStatusComposite.horizontalSpacing = 0;
		gl_openingStatusComposite.marginWidth = 0;
		gl_openingStatusComposite.marginHeight = 0;
		openingStatusComposite.setLayout(gl_openingStatusComposite);
		menuFunctions.addFunction(openingStatusComposite, "OPENING_STATUS");
		
		Label bidOpeningStatusTitle = new Label(openingStatusComposite, SWT.NONE);
		bidOpeningStatusTitle.setText(Messages.BidOpeningStatus + ": ");
		bidOpeningStatusTitle.setForeground(ColorConstants.FONT_BLACK_COLOR);
		
		openingStatusLabel = new Label(openingStatusComposite, SWT.NONE);
		openingStatusLabel.setForeground(SWTResourceManager.getColor(100, 100, 100));
		
		openingUploadStatusLabel = new ImageButton(openingStatusComposite, SWT.NONE);
		openingUploadStatusLabel.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/update.png"));
		
		
		CLabel lab_6 = new CLabel(infoComposite, SWT.NONE);
		lab_6.setAlignment(SWT.CENTER);
		GridData gd_lab_6 = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
		gd_lab_6.widthHint = 20;
		lab_6.setLayoutData(gd_lab_6);
		lab_6.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/v_gray.png"));
		
		evalResultComposite = new Composite(infoComposite, SWT.NONE);
		subPackCountComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		GridLayout gl_evalResultComposite = new GridLayout(3, false);
		gl_evalResultComposite.horizontalSpacing = 0;
		gl_evalResultComposite.marginWidth = 0;
		gl_evalResultComposite.marginHeight = 0;
		evalResultComposite.setLayout(gl_evalResultComposite);
		menuFunctions.addFunction(openingStatusComposite, "EVAL_TIME");
		
		Label evalResultLabel = new Label(evalResultComposite, SWT.NONE);
		evalResultLabel.setText(Messages.EvaluationStatus + "：");
		evalResultLabel.setForeground(ColorConstants.FONT_BLACK_COLOR);
		
		evalStatusLabel = new Label(evalResultComposite, SWT.NONE);
		evalStatusLabel.setForeground(SWTResourceManager.getColor(100, 100, 100));
		
		evalUploadStatusLabel = new ImageButton(evalResultComposite, SWT.NONE);
		evalUploadStatusLabel.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/update.png"));
		
		init();
	}

	/**
	 * @Description: 初始化
	 * @author guoyr
	 */
	public void init(){
		ProjectItemMouseEnterListener myMouseTrackListener = new ProjectItemMouseEnterListener(this);
		setBackgroundColor(this, myMouseTrackListener);
		EnterListener enterListener = new EnterListener();
		tenderNameLabel.addMouseListener(enterListener);
		tenderNoLabel.addMouseListener(new ChangeTextListener());
		goto_btn.addMouseListener(enterListener);
		menuFunctions.refreshFunctionAuthority();
		
	}
	/**
	 * @Description: 递归设置当前面板的鼠标进入时整个面板的背景颜色
	 * @author guoyr
	 * @param targetComposite
	 * @param myMouseTrackListener 
	 */
	private void setBackgroundColor(Composite targetComposite, ProjectItemMouseEnterListener myMouseTrackListener){
		targetComposite.addMouseTrackListener(myMouseTrackListener);
		for(Control contrl : targetComposite.getChildren()){
			if(contrl instanceof Composite){
				setBackgroundColor((Composite)contrl, myMouseTrackListener);
			}else{
				contrl.addMouseTrackListener(myMouseTrackListener);
			}
		}
	}
	class EnterListener extends MouseAdapter{
		@Override
		public void mouseUp(MouseEvent e) {
			listener.enterPackage(tenderProject);
			super.mouseUp(e);
		}
	}
	
	public void addPackageOpListener(PackageOpListener listener){
		this.listener = listener;
	}

	/**
	 * @Description: 
	 * @author guoyr
	 * @param resultMap
	 */
//	public void refresh(int index, TenderProjectEntity parentProject, Map<String, Object> packMap){
//		tenderProjectEntity = new TenderProjectEntity();
//		tenderProjectEntity.setId((String)packMap.get("TENDER_ID"));
//		tenderProjectEntity.setTenderNo((String)packMap.get("TENDER_NO"));
//		tenderProjectEntity.setTenderName((String)packMap.get("TENDER_NAME"));
//		tenderProjectEntity.setTenderType((String)packMap.get("TENDER_TYPE"));
//		tenderProjectEntity.setPhaseType((String)packMap.get("PHASE_TYPE"));
//		tenderProjectEntity.setIsPack((String)packMap.get("IS_PACK"));
//		tenderProjectEntity.setTenderMethod((String)packMap.get("TENDER_METHOD"));
//		tenderProjectEntity.setParentId(parentProject.getId());
//		tenderProjectEntity.setParent(parentProject);
//		if(index < 10){
//			indexLabel.setText("0"+index);
//		}else {
//			indexLabel.setText(""+index);
//		}
//		supplierCount_label.setText(com.gx.obe.components.core.I18N.getString(I18NEnum.SUPPLIERNAME, tenderProjectEntity.getTenderType()) + "数：");
//		int supplierCount  = Integer.parseInt(packMap.get("SUPPLIER_COUNT").toString());
//		if(supplierCount > 0){
//			supplierCountValue.setText(supplierCount+Messages.Number_2);
//		}else {
//			supplierCountValue.setText("无");
//		}
//		tenderProjectEntity.setSupplierCount(supplierCount);
//		if(null != tenderProjectEntity.getPhaseType() && tenderProjectEntity.getPhaseType().equals(TenderProjectEnum.PHASE_TYPE_PRE)){
//			phaseTypeLabel.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/phase_type.png"));
//		}else {
//			phaseTypeLabel.setImage(null);
//		}
//		tenderNoLabel.setText("["+tenderProjectEntity.getTenderNo() + "]");
//		tenderNameLabel.setText(tenderProjectEntity.getTenderName());
//		tenderTypeValueLabel.setText(TenderProjectEnum.getProjectTypeCN(tenderProjectEntity.getTenderType()));
//		tenderMethodValueLabel.setText(TenderProjectEnum.getTenderMethodCN(tenderProjectEntity.getTenderMethod()));
//		bidOpeningTimeValueLabel.setText(ObjectUtils.getObjString(DateUtils.getFormat((Date)packMap.get("BID_OPENING_START_TIME"), FORMAT)));
//		evalTimeValueLabel.setText(ObjectUtils.getObjString(DateUtils.getFormat((Date)packMap.get("BID_EVALUATION_START_TIME"), FORMAT)));
//	
//	}
	/**
	 * @Description: 
	 * @author XiaomaPro
 	 */
	public void refresh(int index, TenderProjectEntity parentProject, TenderProjectVo tenderPcakVo){
		tenderProject = new TenderProjectEntity();
		tenderProject.setId(tenderPcakVo.getTenderId());
 		tenderProject.setParentProjectEntity(parentProject);
		tenderProject.setTenderNo(tenderPcakVo.getTenderNo());
		tenderProject.setTenderName(tenderPcakVo.getTenderName());
		tenderProject.setTenderType(tenderPcakVo.getTenderType());
		tenderProject.setParentId(parentProject.getId());
		tenderProject.setParentProjectEntity(parentProject);
		tenderProject.setPhaseType(tenderPcakVo.getPhaseType());
 		tenderProject.setTenderMethod(tenderPcakVo.getTenderMethod());
 		
		if(index < 10){
			indexLabel.setText("0"+index);
		}else {
			indexLabel.setText(""+index);
		}
		countTitle_label.setText(com.gx.obe.components.core.I18N.getString(I18NEnum.SUPPLIERNAME, tenderPcakVo.getTenderType())+ "：");
//		int supplierCount  = Integer.parseInt(packMap.get("SUPPLIER_COUNT").toString());
		int supplierCount  = tenderPcakVo.getSupplierCount();
		if(supplierCount > 0){
			if(null != tenderPcakVo.getBidOpeningStartTime() && tenderPcakVo.getBidOpeningStartTime().after(NowTimeUtils.getNowDate())) {
				countValue_label.setText("*"+Messages.SupplierCouns);
			}else {
				countValue_label.setText(supplierCount+Messages.SupplierCouns);
			}
		}else {
			countValue_label.setText(Messages.None);
		}
		tenderProject.setSupplierCount(supplierCount);
		if(TenderProjectEnum.PHASE_TYPE_PRE.equals(tenderPcakVo.getPhaseType())){
			phaseTypeLabel.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/phase_type.png"));
		}else {
			phaseTypeLabel.setImage(null);
		}
		if(TenderProjectEnum.LOCAL.equals(tenderPcakVo.getRemoteStatus())){
			WidgetUtils.setControlVisible(deleteBtn, true);
		}
		if(CommonEnum.COMPLETE.equals(tenderPcakVo.getBidOpeningStatus())){
			WidgetUtils.setControlVisible(deleteBtn, false);
		}
		tenderNoLabel.setText("["+tenderPcakVo.getTenderNo() + "]");
		tenderNameLabel.setText(tenderPcakVo.getTenderName());
		tenderTypeValueLabel.setText(TenderProjectEnum.getProjectTypeCN(tenderPcakVo.getTenderType()));
		tenderMethodValueLabel.setText(TenderProjectEnum.getTenderMethodCN(tenderPcakVo.getTenderMethod()));
		bidOpeningTimeValueLabel.setText(ObjectUtils.getObjString(DateUtils.getFormat(tenderPcakVo.getBidOpeningStartTime(), FORMAT)));
		if(CommonEnum.COMPLETE.equals(tenderPcakVo.getBidOpeningStatus())){
			openingStatusLabel.setForeground(SWTResourceManager.getColor(72, 152, 21));
			openingStatusLabel.setText(Messages.OpeningStatus_opend);
		}else if(CommonEnum.IN_PROGRESS.equals(tenderPcakVo.getBidOpeningStatus())){
			openingStatusLabel.setText(Messages.OpeningStatus_opening);
		}else {
			openingStatusLabel.setText(Messages.OpeningStatus_none);
		}
		
//		if(!CommonEnum.COMPLETE.equals((String)projectMap.get("UPLOAD_OPENING_RESULT_STATUS"))){
		if(CommonEnum.COMPLETE.equals(tenderPcakVo.getUploadOpeningResultStatus())){
			openingUploadStatusLabel.setEnabled(true);
		}else {
			openingUploadStatusLabel.setEnabled(false);
		}
		
		if(CommonEnum.COMPLETE.equals(tenderPcakVo.getComplateStatus())){
			evalStatusLabel.setText(Messages.Progress_complate);
			evalStatusLabel.setForeground(SWTResourceManager.getColor(72, 152, 21));
		}else if(CommonEnum.NOT_START.equals(tenderPcakVo.getComplateStatus())){
			evalStatusLabel.setText(Messages.Progress_noStart);
		}else {
			evalStatusLabel.setText(Messages.Progress_noComplate);
		}
//		if(TenderProjectEnum.EFFECTIVE_NO.equals((String)projectMap.get("EFFECTIVE_TYPE"))){
		if(TenderProjectEnum.EFFECTIVE_NO.equals(tenderPcakVo.getEffectiveType())){
			evalStatusLabel.setText(Messages.RevokeStatus_yes);
		}

//		if(!CommonEnum.COMPLETE.equals((String)projectMap.get("UPLOAD_EVALUATION_RESULT_STATUS"))){
		if(!CommonEnum.COMPLETE.equals(tenderPcakVo.getUploadEvaluationResultStatus())){
			evalUploadStatusLabel.setEnabled(false);
		}
	
		WidgetUtils.setControlVisible(deleteBtn, false);
		deleteBtn.setEnabled(false);
		
	}
	/**
	 * @Description: 删除包件
	 * @author guoyr 
	 */
	private void deleteProjectAction(){
		if(deleteBtn.getVisible() && deleteBtn.getEnabled()) {
//			listener.deletePackage(tenderProject);
		}
	}
	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}
