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.
67 lines
2.1 KiB
67 lines
2.1 KiB
package com.langtech.plm.tqsx;
|
|
|
|
import java.io.File;
|
|
|
|
import com.teamcenter.rac.aif.AIFDesktop;
|
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
|
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
|
import com.teamcenter.rac.kernel.TCComponent;
|
|
import com.teamcenter.rac.kernel.TCComponentDataset;
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
|
|
|
|
public class PropertyToWordOrExcelCommand extends KCommand{
|
|
|
|
final String preName = "Connor_LY6_WordExcel_Report_ItemType";
|
|
|
|
public PropertyToWordOrExcelCommand(AbstractAIFApplication app, String commandId, String actionInfo) {
|
|
super(app, commandId, actionInfo);
|
|
TCSession session = (TCSession) app.getSession();
|
|
this.setRunnable(new PropertyToWordOrExcelOperation(app, "提取对象版本属性到Word Excel"));
|
|
// InterfaceAIFComponent targetComponent = app.getTargetComponent();
|
|
// TCComponentItemRevision revision = (TCComponentItemRevision) targetComponent;
|
|
// try {
|
|
// String[] prefVals = KUtil.getPrefVals(session, preName);
|
|
// if(prefVals == null || prefVals.length == 0) {
|
|
// KUtil.info(AIFDesktop.getActiveDesktop(), preName + "该首选项未配置,请联系管理员!");
|
|
// return ;
|
|
// }
|
|
// String relatioin = prefVals[0];
|
|
// TCComponent[] relatedComponents = revision.getRelatedComponents(relatioin);
|
|
// if(relatedComponents == null || relatedComponents.length == 0) {
|
|
// KUtil.info(AIFDesktop.getActiveDesktop(), "选中对象的 " + relatioin + " 关系下没有数据集");
|
|
// return ;
|
|
// }
|
|
// for (TCComponent tcComponent : relatedComponents) {
|
|
// if (tcComponent instanceof TCComponentDataset) {
|
|
// TCComponentDataset dataset = (TCComponentDataset) tcComponent;
|
|
// File datasetFile = KUtil.getDatasetFile(dataset);
|
|
// System.out.println();
|
|
// String type = tcComponent.getType();
|
|
// switch (type) {
|
|
// case "MSExcel":
|
|
//
|
|
// break;
|
|
// case "MSExcelX":
|
|
//
|
|
// break;
|
|
// case "MSWord":
|
|
//
|
|
// break;
|
|
// case "MSWordX":
|
|
//
|
|
// break;
|
|
// }
|
|
// }
|
|
// }
|
|
// } catch (Exception e) {
|
|
// // TODO Auto-generated catch block
|
|
// e.printStackTrace();
|
|
// }
|
|
|
|
}
|
|
|
|
}
|