You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

package cn.com.ebewin.ysr.dialog;
import javax.swing.SwingUtilities;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
public class AssignProjectHandler extends AbstractHandler
{
public Object execute(ExecutionEvent arg0) throws ExecutionException
{
AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
try {
final TCSession session = (TCSession) app.getSession();
final InterfaceAIFComponent[] pasteTargets = app.getTargetComponents();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new AssignProjectDialog(session, pasteTargets);
}
});
}
catch (Exception exception)
{
exception.printStackTrace();
MessageBox.post(exception, true);
}
return null;
}
}