package com.gx.obe.management.composite;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.eclipse.swt.SWT;
import org.eclipse.swt.core.MessageDialog;
import org.eclipse.swt.core.listener.LoadingAdatper;
import org.eclipse.swt.core.utils.WidgetUtils;
import org.eclipse.swt.core.widgets.EMenu;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;

import com.gx.obe.ColorConstants;
import com.gx.obe.action.bean.Action;
import com.gx.obe.action.listener.ActionListener;
import com.gx.obe.business.entity.MenuFunction;
import com.gx.obe.business.enumeration.ExpertEnum;
import com.gx.obe.business.enumeration.MenuFunctionEnum;
import com.gx.obe.business.enumeration.UserEnum;
import com.gx.obe.common.composite.BrowseBidFileComposite;
import com.gx.obe.common.composite.ExpertEvlauationProgressComposite;
import com.gx.obe.common.file.dialog.DownloadDecBidFileDialog;
import com.gx.obe.common.file.entity.BidFile;
import com.gx.obe.common.icons.IconsActivator;
import com.gx.obe.common.shell.MeetingRoomOpenShell;
import com.gx.obe.common.widget.button.RoomOperatorButton;
import com.gx.obe.common.widget.listener.SelectionTenderPackListener;
import com.gx.obe.common.widget.shell.ProgressMessageDialog;
import com.gx.obe.common.widget.utils.MenuFunctionUtils;
import com.gx.obe.components.core.Constants;
import com.gx.obe.components.core.I18NEnum;
import com.gx.obe.components.core.enumeration.CommonEnum;
import com.gx.obe.listener.EvaluationRoomListener;
import com.gx.obe.management.Lisener.MeetingRoomListener;
import com.gx.obe.meeting.utils.VideoMeetingUtils;
import com.gx.obe.message.Messages;
import com.gx.obe.util.utils.LogUtils;
import com.gx.obe.web.entity.auth.AuthUser;
import com.gx.obe.web.entity.auth.Menu;
import com.gx.obe.web.entity.expert.Expert;
import com.gx.obe.web.entity.tender.TenderProjectEntity;
import com.gx.obe.web.service.MenuService;
import com.gx.obe.web.service.TenderProjectService;
import com.gx.obe.web.service.UserService;
import com.gx.obe.web.service.expert.ExpertService;
import com.gx.tools.ole.signature.CircleSignatureDialog;
import com.gx.tools.utils.SignaturePdfUtils;
import com.swtdesigner.ResourceManager;
import com.swtdesigner.SWTResourceManager;

/**
 * @Description: 
 * @author guoyr
 */
public class EvaluationRoomHomeComposite extends Composite implements ActionListener{
	
	private UserService userService;
	private ExpertService expertService ;
	private MenuService menuService;
	private TenderProjectService tenderProjectService ;
	private TenderProjectEntity tenderProjectEntity;
	private SelectionTenderPackListener selectionTenderPackListener;
	private MeetingRoomListener meetingRoomListener;
	private Composite myTenderPackComposite;
	private Composite progressComposite;
	private Composite myEvaluationComposite;
	private StackLayout stackLayout = new StackLayout();
	private boolean isRefreshExpert = false;
	private Composite loadComposite;
	private EvaluationRoomListener myTenderPackPage;
	private EvaluationRoomListener progressPage;
	private EvaluationRoomListener curPageListener;
	private Composite packageComposite;
	private StyledText packName;
	private Composite topLoadComposite;
	private Menu menu;
	private MenuFunctionUtils menuFunctionUtils = new  MenuFunctionUtils();
	private RoomOperatorButton signature_btn;
	
	{
		LogUtils.logClass(EvaluationRoomHomeComposite.class);
	}
	
	/**
	 * Create the progressComposite.
	 * @param parent
	 * @param style
	 */
	public EvaluationRoomHomeComposite(Composite parent, int style) {
		super(parent, SWT.NONE);
		this.tenderProjectEntity = (TenderProjectEntity)parent.getData("tenderProjectEntity");
		this.meetingRoomListener = (MeetingRoomListener)parent.getData("meetingRoomListener");
		this.menu = (Menu)parent.getData("menu");
		GridLayout gridLayout = new GridLayout(1, false);
		gridLayout.horizontalSpacing = 0;
		gridLayout.verticalSpacing = 0;
		gridLayout.marginHeight = 0;
		gridLayout.marginWidth = 0;
		setLayout(gridLayout);
		
		packageComposite = new Composite(this, SWT.NONE);
		packageComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		GridLayout gl_packageComposite = new GridLayout(1, false);
		gl_packageComposite.marginHeight = 0;
		gl_packageComposite.marginWidth = 0;
		packageComposite.setLayout(gl_packageComposite);
		
		Composite composite = new Composite(packageComposite, SWT.NONE);
		composite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true, 1, 1));
		GridLayout gl_composite = new GridLayout(1, false);
		gl_composite.marginTop = 5;
		gl_composite.marginHeight = 0;
		composite.setLayout(gl_composite);
		
		packName = new StyledText(composite, SWT.READ_ONLY | SWT.CENTER);
		packName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		packName.setAlignment(SWT.CENTER);
		packName.setFont(SWTResourceManager.getFont("微软雅黑", 12, SWT.BOLD));
		packName.setForeground(SWTResourceManager.getColor(100, 100, 100));
		packName.setText("包件名称");
		
		topLoadComposite = new Composite(this, SWT.NONE);
		topLoadComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		topLoadComposite.setLayout(stackLayout);
		
		myTenderPackComposite = new Composite(topLoadComposite, SWT.NONE);
		myTenderPackComposite.setLayout(new FillLayout());
		
		progressComposite = new Composite(topLoadComposite, SWT.NONE);
		progressComposite.setLayout(new FillLayout());
		
		myEvaluationComposite = new Composite(topLoadComposite, SWT.NONE);
		myEvaluationComposite.setLayout(new FillLayout());
		
		loadComposite = new Composite(topLoadComposite, SWT.NONE);
		loadComposite.setLayout(new FillLayout());
		init();
	}
	
	/**
	 * @Description: 初始化
	 * @author guoyr
	 */
	private void init(){
		menuService = new MenuService();
		expertService = new ExpertService();
		
		tenderProjectService = new TenderProjectService();
		((GridData)packageComposite.getLayoutData()).exclude = true;
		packageComposite.setVisible(false);
		selectionTenderPackListener = new SelectionTenderPackListener(){
			public void selectPack(TenderProjectEntity tenderPack) {
				// 选择后重新查询一次
				tenderPack = tenderProjectService.getById(tenderPack.getId());
				loadCurTenderProject(tenderPack);
			}
		};
		
		new Thread(new Runnable(){
			public void run(){
				Display.getDefault().syncExec(new Runnable(){
					public void run(){
						if(!loadComposite.isDisposed()){
							if(CommonEnum.YES.equals(tenderProjectEntity.getIsPack())){
								loadMyTenderPack();
								((GridData)packageComposite.getLayoutData()).exclude = true;
								packageComposite.setVisible(false);
								layout();
							}else {
								tenderProjectEntity = tenderProjectService.getById(tenderProjectEntity.getId());
								loadCurTenderProject(tenderProjectEntity);
							}
						}
					}
				});
			};
		}).start();
		if(null != tenderProjectEntity.getIsPack() && tenderProjectEntity.getIsPack().equals(CommonEnum.YES)){
			meetingRoomListener.refreshMeetingTitle(tenderProjectEntity.getTenderName());
		}else if(null != tenderProjectEntity.getParentId()){
			TenderProjectEntity parentProject = tenderProjectService.getById(tenderProjectEntity.getParentId());
			meetingRoomListener.refreshMeetingTitle(parentProject.getTenderName());
		}else {
			meetingRoomListener.refreshMeetingTitle(tenderProjectEntity.getTenderName());
		}
		layout();
		
	}
	
	/**
	 * @Description: 刷新项目
	 * @author guoyr
	 * @param tenderProjectEntity 
	 */
	public void loadCurTenderProject(TenderProjectEntity tenderProjectEntity){
		this.tenderProjectEntity = tenderProjectEntity;
		loadAllProgress();
		if(null != tenderProjectEntity.getParentId()){
			packName.setText("["+tenderProjectEntity.getTenderNo() + "]" + tenderProjectEntity.getTenderName());
			if(!packageComposite.getVisible()){
				((GridData)packageComposite.getLayoutData()).exclude = false;
				packageComposite.setVisible(true);
				layout();
			}
		}
		
		progressPage = null;
		addOperatorBtn(false);
		refreshExpert();
	}
	
	public void refreshAction(){
		if(null != curPageListener){
			curPageListener.refresh(tenderProjectEntity);
		}
	}
	
	/**
	 * @Description: 加载包件
	 * @author guoyr 
	 */
	public void loadMyTenderPack(){
		isRefreshExpert = false;
		addOperatorBtn(true);
		if(null == myTenderPackPage){
			TenderProjectEntity parentProject = tenderProjectEntity;
			for(Control control : myTenderPackComposite.getChildren()){
				control.dispose();
			}
			myTenderPackComposite.setData("tenderProjectEntity", tenderProjectEntity);
			myTenderPackComposite.setData("meetingRoomListener", meetingRoomListener);
			if(null != tenderProjectEntity.getParentId()){
				parentProject = tenderProjectService.getById(tenderProjectEntity.getParentId());
			}
			MyTenderPackageListComposite myTenderPackageListComposite = new MyTenderPackageListComposite(myTenderPackComposite, parentProject, selectionTenderPackListener, SWT.NONE);
			myTenderPackPage = myTenderPackageListComposite;
			myTenderPackComposite.layout();
		}
		curPageListener = myTenderPackPage;
		stackLayout.topControl = myTenderPackComposite;
		topLoadComposite.layout();
		((GridData)packageComposite.getLayoutData()).exclude = true;
		packageComposite.setVisible(false);
		layout();
		meetingRoomListener.refreshChairsCount(7, null, false, false);
	}
	
	/**
	 * @Description: 加载所有的进度
	 * @author guoyr
	 * @param tenderProjectEntity 
	 */
	private void loadAllProgress(){
		if(null == progressPage){
			for(Control control : progressComposite.getChildren()){
				control.dispose();
			}
			progressComposite.setData("tenderProjectEntity", tenderProjectEntity);
			progressComposite.setData("meetingRoomListener", meetingRoomListener);
			progressPage = new ExpertEvlauationProgressComposite(progressComposite, SWT.NONE);
			progressComposite.layout();
		}else {
			progressPage.refresh(tenderProjectEntity);
		}
		curPageListener = progressPage;
		stackLayout.topControl = progressComposite;
		topLoadComposite.layout();
	}
	
	
	public void refreshExpert(){
		isRefreshExpert = false;
		if(stackLayout.topControl == myTenderPackComposite){
			meetingRoomListener.refreshChairsCount(7, null, false, false);
		}else {
			new Thread(new Runnable(){
				public void run(){
					if(null == userService){
						userService = new UserService();
					}
					AuthUser managerUser = userService.findById(tenderProjectEntity.getUserId());
					final boolean managerIsFemale = null != managerUser && UserEnum.FEMALE.equals(managerUser.getGender());
					List<Expert> expertList = expertService.getExpertList(tenderProjectEntity.getId(), null);
					isRefreshExpert = true;
					while(isRefreshExpert){
						if(null != expertList && expertList.size() > 0){
							meetingRoomListener.refreshChairsCount(expertList.size(), tenderProjectEntity.getManagerName(), managerIsFemale, false);
							List<Expert> tempExpertList = new ArrayList<Expert>();
							int signExpertCount = 0;
							for(Expert expert : expertList){
								if(null != expert.getSignType() && expert.getSignType().equals(ExpertEnum.SIGN)){
									tempExpertList.add(expert);
									signExpertCount ++;
								}else {
									tempExpertList.add(null);
								}
							}
							meetingRoomListener.refreshExpert(tempExpertList);
							if(signExpertCount == expertList.size()){
								isRefreshExpert = false;
							}
						}else {
							meetingRoomListener.refreshChairsCount(7, tenderProjectEntity.getManagerName(), managerIsFemale, false);
						}
						try {
							Thread.sleep(3000);
						} catch (InterruptedException e) {
						}
						expertList = expertService.getExpertList(tenderProjectEntity.getId(), null);
					}
				
				}
			}).start();
			
		}
	}
	
	/**
	 * @Description: 添加操作按钮
	 * @author guoyr 
	 */
	private void addOperatorBtn(boolean myPacks){
		Composite operatorParent = meetingRoomListener.getOperatorParent();
		
		for (Control control : operatorParent.getChildren()) {
			control.dispose();
		}
		
		Composite operatorComposite = new Composite(operatorParent, SWT.NONE);
		operatorComposite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true, 1, 1));
		RowLayout gl_composite = new RowLayout();
		gl_composite.marginHeight = 0;
		gl_composite.marginWidth = 0;
//			gl_composite.marginTop = 10;
		gl_composite.fill = true;
		operatorComposite.setLayout(gl_composite);
		operatorComposite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 1, 1));
		if(myPacks){
			RoomOperatorButton actionBtn = new RoomOperatorButton(operatorComposite, SWT.NONE);
			actionBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/switch.png"));
			actionBtn.setText(MessageFormat.format(Messages.Button_changeFormat, com.gx.obe.components.core.I18N.getString(I18NEnum.SUBPACKAGE, tenderProjectEntity.getTenderType())));
			actionBtn.addMouseListener(new MouseAdapter() {
				public void mouseUp(MouseEvent e) {
					loadMyTenderPack();
				}
			});
		}else {
			if(null != tenderProjectEntity.getParentId()){
				RoomOperatorButton actionBtn = new RoomOperatorButton(operatorComposite, SWT.NONE);
				actionBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/switch.png"));
				actionBtn.setText(MessageFormat.format(Messages.Button_changeFormat, com.gx.obe.components.core.I18N.getString(I18NEnum.SUBPACKAGE, tenderProjectEntity.getTenderType())));
				actionBtn.addMouseListener(new MouseAdapter() {
					public void mouseUp(MouseEvent e) {
						loadMyTenderPack();
					}
				});
				
			}
			{
				RoomOperatorButton actionBtn = new RoomOperatorButton(operatorComposite, SWT.NONE);
				actionBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/hourglass.png"));
				actionBtn.setText(Messages.Button_viewProgress);
				actionBtn.addMouseListener(new MouseAdapter() {
					public void mouseUp(MouseEvent e) {
						loadAllProgress();
					}
				});
			}
			
			signature_btn = new RoomOperatorButton(operatorComposite, SWT.NONE);
			signature_btn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/signature.png"));
			signature_btn.setText(Messages.Button_elecSignature);
			menuFunctionUtils.addFunction(signature_btn, "SIGNATURE");
			
			{
				final RoomOperatorButton downloadBidFileBtn = new RoomOperatorButton(operatorComposite, SWT.NONE);
				downloadBidFileBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/download.png"));
//				actionBtn.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
				downloadBidFileBtn.setText(Messages.Button_downloadBidFile);
				downloadBidFileBtn.addMouseListener(new MouseAdapter() {
					public void mouseUp(MouseEvent e) {
						if(!MenuFunction.HIDE.equals(menuFunctionUtils.getAuthority("CLEAR_FILE"))) {
							if(tenderProjectService.isEvaluationComplate(tenderProjectEntity.getId())) {
								MessageDialog.openWarning(getShell(), Messages.Tips_evaluationCompleted);
								return;
							}
						}
						DownloadDecBidFileDialog dialog = new DownloadDecBidFileDialog(getShell(), tenderProjectEntity, false);
						dialog.open();
						
					}
				});
			}
			{
				RoomOperatorButton veiwBidFileBtn = new RoomOperatorButton(operatorComposite, SWT.NONE);
				veiwBidFileBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/pdf.png"));
				veiwBidFileBtn.setText(Messages.Button_veiwBidFile);
				veiwBidFileBtn.addMouseListener(new MouseAdapter() {
					public void mouseUp(MouseEvent e) {
						viewBidFile(veiwBidFileBtn);
					}
				});
				menuFunctionUtils.addFunction(veiwBidFileBtn, "VIEW_BID_FILE");
			}
			{
				RoomOperatorButton meeting_btn = new RoomOperatorButton(operatorComposite, SWT.NONE);
				meeting_btn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/video.png"));
				meeting_btn.setText(Messages.VideoMeeting);
				meeting_btn.addMouseListener(new MouseAdapter() {
					public void mouseUp(MouseEvent e) {
						videoMeetingAction(meeting_btn);
					}
				});
				menuFunctionUtils.addFunction(meeting_btn, MenuFunctionEnum.SHOW_MEETING_VIDEO);
			}
		}
		
		{
			RoomOperatorButton actionBtn = new RoomOperatorButton(operatorComposite, SWT.NONE);
			actionBtn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/white/refresh.png"));
			actionBtn.setText(Messages.Button_refresh);
			actionBtn.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseUp(MouseEvent e) {
					refreshAction();
				}
			});
		}
		
		if(null!= menu) {
			menuFunctionUtils.initFunctionAuthority(menu);
		}
		refreshSignatureBtn();
		meetingRoomListener.refreshOperator();
	}
	
	/**
     * @Description: 
     * @author chenxw
     * @param signaturePdfKey
     * @param signaturePdfvalue 
     */
    private void initSignature_btn(final String signaturePdfKey, final String signaturePdfvalue) {
        if (SignaturePdfUtils.CA.equals(signaturePdfKey)) {
            signature_btn.setText(Messages.Button_caSignature);
            signature_btn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/signature.png"));
        } else if (SignaturePdfUtils.HAND.equals(signaturePdfKey)) {
            signature_btn.setText(Messages.Button_handSignature);
            signature_btn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/pen.png"));
        } else if (SignaturePdfUtils.SAOMA.equals(signaturePdfKey)) {
            signature_btn.setText(Messages.Button_scanSignatrue);
            signature_btn.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/sweepCode.png"));
        }
        MouseAdapter mouseAdapter = new MouseAdapter() {
            public void mouseUp(MouseEvent e) {
            	openSignatureDialog(signature_btn.getText(), signaturePdfKey, signaturePdfvalue);
            }
        };
        signature_btn.addMouseListener(mouseAdapter);
    }
    
    /**
	 * @Description: 刷新签章按钮
	 * @author chenxw 
	 */
	private void refreshSignatureBtn() {
		final Map<String, String> signaturePdfMap = SignaturePdfUtils.getSignaturePdfMap();
		
		if (signaturePdfMap.isEmpty()) {
			WidgetUtils.setControlVisible(signature_btn, false);
			return;
		}
		if (signaturePdfMap.size() == 1) {
			final String signaturePdfKey = signaturePdfMap.keySet().iterator().next();
			initSignature_btn(signaturePdfKey, signaturePdfMap.get(signaturePdfKey));
			return;
		}
		
		signature_btn.addMouseListener(new MouseAdapter() {
			public void mouseUp(MouseEvent e) {
				
				EMenu supplierOp = new EMenu(getShell());
				supplierOp.setForeground(ColorConstants.FONT_BLACK_COLOR);
				supplierOp.setAlpha(220);
				supplierOp.setAutoClickOnlyOneItem(true);
				supplierOp.setFont(SWTResourceManager.getFont("微软雅黑", 12, SWT.NORMAL));
				
				for (String signaturePdfKey : signaturePdfMap.keySet()) {
					if (SignaturePdfUtils.CA.equals(signaturePdfKey)) {
						supplierOp.addMenuItem(Messages.Button_caSignature, ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/signature.png"), true, new EMenu.ClickListener() {
							public void click() {
								openSignatureDialog(Messages.Button_caSignature, signaturePdfKey, signaturePdfMap.get(signaturePdfKey));
							}
						});
					} else if (SignaturePdfUtils.HAND.equals(signaturePdfKey)) {
						supplierOp.addMenuItem(Messages.Button_handSignature, ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/pen.png"), true, new EMenu.ClickListener() {
							public void click() {
								openSignatureDialog(Messages.Button_handSignature, signaturePdfKey, signaturePdfMap.get(signaturePdfKey));
							}
						});
					} else if (SignaturePdfUtils.SAOMA.equals(signaturePdfKey)) {
						supplierOp.addMenuItem(Messages.Button_scanSignatrue, ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/sweepCode.png"), true, new EMenu.ClickListener() {
							public void click() {
								openSignatureDialog(Messages.Button_scanSignatrue, signaturePdfKey, signaturePdfMap.get(signaturePdfKey));
							}
						});
					}
				}
				supplierOp.open(signature_btn);
			}
		});
	
	}
    
	private void openSignatureDialog(String title, String signaturePdfKey, String signaturePdfType) {
		CircleSignatureDialog signatureDialog = new CircleSignatureDialog(getShell(), tenderProjectEntity, Constants.USER, signaturePdfKey, signaturePdfType);
		signatureDialog.setTitle(title);
    	signatureDialog.open();
	}
    
	/**
	 * 启动视频会议
	 */
	private void videoMeetingAction(RoomOperatorButton startMeetingBtn){
		final ProgressMessageDialog messageProgress = new ProgressMessageDialog(getShell(), false, -1, new LoadingAdatper() {
			public void finish(boolean flag) {
				Display.getDefault().syncExec(new Runnable() {
					public void run() {
						if(!startMeetingBtn.isDisposed()) {
							startMeetingBtn.setEnabled(true);
						}
					}
				});
			}
			
		});
		new Thread(new Runnable(){
			public void run() {
				VideoMeetingUtils.enterMeeting(tenderProjectEntity, Constants.USER, VideoMeetingUtils.ROLE_MANAGER, false, messageProgress);
			}
		}).start();
		messageProgress.setTitle("正在启动视频会议");
		messageProgress.open();
	}
	
	/**
	 * @Description: 查看投标文件
	 * @author guoyr
	 * @param actionBtn 
	 * @param curTender 
	 */
	private void viewBidFile(RoomOperatorButton actionBtn) {
		openBrowseBidFileAction(BidFile.PUBLIC_BID_FILE);
	}
	
	public void openBrowseBidFileAction(String bidFileType) {
		MeetingRoomOpenShell myEvaluationShell = new MeetingRoomOpenShell(getShell(), tenderProjectEntity);
		Composite parent = myEvaluationShell.getParentComposite();
		parent.setData("tenderProjectEntity", tenderProjectEntity);
		parent.setData("bidFileType", bidFileType);
		parent.setData("menu", menu);
		new BrowseBidFileComposite(parent, SWT.NONE);
		parent.layout();
//		myEvaluationShell.setMaximized(true);
		myEvaluationShell.open();
	}
	
	public void onLoad(Action action) {
		for(Control control : loadComposite.getChildren()){
			control.dispose();
		}
		loadComposite.layout();
		stackLayout.topControl = loadComposite;
		layout();
	}
	public void loadComposite(Action action, Composite content) {
		
		loadComposite.layout();
	}
	public Composite getParentComposite() {
		return loadComposite;
	}
	
	/**
	 * @Description: 回退评标专家的评标步骤操作
	 * @author guoyr
	 */

	protected void checkSubclass() {
	}

}
