/**
 * @author tyl
 * @Action  ini
 * 2011-5-17
 */
package cn.com.origin.autocodemanager.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.TCUserService;

public class ImportCodeNextIdHandler extends AbstractHandler {

	private TCUserService userService;
	private TCSession session = null;

	public ImportCodeNextIdHandler() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
	 * ExecutionEvent)
	 */
	public Object execute(ExecutionEvent e) throws ExecutionException {
		try {
			session = (TCSession) AIFUtility.getCurrentApplication().getSession();
			userService = (TCUserService) session.getUserService();
			 Object[] params = {};
			 userService.call("importHistoryNextID", params);
		} catch (TCException e1) {
			e1.printStackTrace();
		}
		return null;
	}

}
