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.
68 lines
1.8 KiB
68 lines
1.8 KiB
package com.langtech.plm.mpart;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import org.eclipse.core.commands.AbstractHandler;
|
|
import org.eclipse.core.commands.ExecutionEvent;
|
|
import org.eclipse.core.commands.ExecutionException;
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
|
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
|
import com.teamcenter.rac.aifrcp.AIFUtility;
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
import com.teamcenter.rac.kernel.TCComponentSchedule;
|
|
import com.teamcenter.rac.kernel.TCComponentScheduleTask;
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
public class MpartHandler extends AbstractHandler{
|
|
|
|
|
|
@Override
|
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
|
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
|
TCSession session = (TCSession) app.getSession();
|
|
try {
|
|
|
|
new Thread() {
|
|
@Override
|
|
public void run() {
|
|
InterfaceAIFComponent[] targetComponent = app.getTargetComponents();
|
|
ArrayList<TCComponentItemRevision> arrayList = new ArrayList<TCComponentItemRevision>();
|
|
|
|
for (int i = 0; i < targetComponent.length; i++) {
|
|
InterfaceAIFComponent component = targetComponent[i];
|
|
if(component instanceof TCComponentItemRevision) {
|
|
arrayList.add((TCComponentItemRevision)component);
|
|
}
|
|
}
|
|
|
|
System.out.println("arrayList.size()==========="+arrayList.size());
|
|
|
|
if(arrayList.size() > 0) {
|
|
try {
|
|
new MpartDialog(session,arrayList);
|
|
} catch (TCException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}.start();
|
|
|
|
} catch (Exception e) {
|
|
// TODO: handle exception
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
|
|
}
|