package com.gx.obe.management.action;

import java.text.MessageFormat;

import com.gx.obe.action.bean.EAction;
import com.gx.obe.business.entity.ExpertLibrary;
import com.gx.obe.common.widget.dialog.MessageViewDialog;
import com.gx.obe.management.thread.DownloadExpertThread;
import com.gx.obe.message.Messages;
import com.gx.obe.web.entity.tender.TenderProjectEntity;

/**
 * @Description: 下载专家
 * @author guoyr
 */
public class DownloadExpertAction extends EAction {
	public void run(){
		if(null != getCallBack() ){
			TenderProjectEntity tenderProjectEntity = this.getTenderProject();
			ExpertLibrary expertLibrary = (ExpertLibrary)this.getData("expertLibrary");
			
			MessageViewDialog dialog = new MessageViewDialog(getParent().getShell(), -1);
			new DownloadExpertThread(tenderProjectEntity, expertLibrary.getExpertLibAddress(), dialog.getCallBack()).start();
			dialog.setTitle(Messages.Button_download + Messages.Expert);
			dialog.open();
			dialog.showMessage(MessageFormat.format(Messages.Button_downloadFormat, Messages.EvalExpert));
			getCallBack().after();
		}
	}
}
