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.
35 lines
1.3 KiB
35 lines
1.3 KiB
package com.connor.zf.createTZ;
|
|
|
|
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.TCComponentItemRevision;
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
public class CreateZCTHandler extends AbstractHandler{
|
|
@Override
|
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
|
AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
|
|
TCSession session = (TCSession) app.getSession();
|
|
InterfaceAIFComponent targetComponent = app.getTargetComponent();
|
|
if(targetComponent instanceof TCComponentItemRevision) {
|
|
TCComponentItemRevision rev = (TCComponentItemRevision)targetComponent;
|
|
String type = rev.getType();
|
|
if(type.equals("ZF6_ZCTRevision")) {
|
|
CreateZCTDialog dialog = new CreateZCTDialog(app, session, rev);
|
|
new Thread(dialog).start();
|
|
}else {
|
|
MessageBox.post("请选择总成图版本!","",MessageBox.INFORMATION);
|
|
}
|
|
}else {
|
|
MessageBox.post("请选择总成图版本!","",MessageBox.INFORMATION);
|
|
}
|
|
return null;
|
|
}
|
|
}
|