package cn.com.origin.autocode.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;

import cn.com.origin.autocode.newitem.generatcode.NewCodeItemDialog;
import cn.com.origin.autocode.newitem.system.ORNewItemCommand;
import cn.com.origin.autocodemanager.common.TCPreferenceUitl;

import com.teamcenter.rac.aif.AIFDesktop;
import com.teamcenter.rac.aifrcp.AIFUtility;

public class NewItemTestHandler extends AbstractHandler {
	public Object execute(ExecutionEvent arg0) throws ExecutionException {
		
		new NewCodeItemDialog(AIFDesktop.getActiveDesktop().getShell(),"ExcelTemplate").open();
		
//			new Thread() {
//				public void run() {
//					// ExcelTemplate Item DMTemplate
//					 ORNewItemCommand command = new ORNewItemCommand(AIFDesktop.getActiveDesktop().getFrame(), AIFUtility.getCurrentApplication(),"ExcelTemplate");
//					try {
//						command.executeModal();
//					} catch (Exception e) {
//						e.printStackTrace();
//					}
//				}
//			}.start();
		return null;
	}
}