1、打包
public void unpackAllCommand(AbstractAIFUIApplication currentApplication,TCComponentBOMLine bomLine) { try { UnpackAllAction allAction = new UnpackAllAction((AbstractBOMLineViewerApplication) currentApplication, "packAllAction"); new Thread(allAction).start(); } catch (Exception e) { e.printStackTrace(); } }
2、解包
public void unpackCommand(TCComponentBOMLine bomLine) { try { UnpackCommand command = new UnpackCommand(bomLine); command.executeModal(); } catch (Exception e) { e.printStackTrace(); } }
解包后要保存BOMWindow,否则程序无法读取到BOM行
AbstractBOMLineViewerApplication appIndex = (AbstractBOMLineViewerApplication) app; TCComponentBOMWindow pseBomWindow = appIndex.getBOMWindow(); pseBomWindow.save(); Thread.sleep(1000);