一、分类
com.teamcenter.rac.classification.icm
- public VPPSAttributeFillingBOMDialog(Frame frame,TCSession session) throws Exception {
- super(frame);
- this.setTitle("选择分类");
- this.setResizable(true);
- this.setLayout(new BorderLayout());
- //框的大小 wide,high
- this.setPreferredSize(new Dimension(400, 750));
- Panel panel = new Panel();
- JButton sureButton=new JButton("确定");
- sureButton.setBounds(110, 210, 100, 40);
- panel.add(sureButton);
- //获取分类界面
- ClassificationService classificationService = new ClassificationService();
- //展示分类主页面
- G4MApplicationPanel mainPanel = classificationService.getMainPanel();
- this.getContentPane().add(mainPanel, BorderLayout.CENTER);
- this.getContentPane().add(panel,BorderLayout.SOUTH);
- this.pack();
- this.setVisible(true);
- }
com.teamcenter.rac.querybuilder
- public CompletedTaskBoxDialog(Frame frame) throws Exception {
- super(frame);
- this.setTitle("创建查询");
- this.setResizable(true);
- this.setLayout(new BorderLayout());
- //框的大小 wide,high
- this.setPreferredSize(new Dimension(750, 750));
- Panel panel = new Panel();
- sureButton=new JButton("确定");
- sureButton.setBounds(110, 210, 100, 40);
- //获取查询构建器界面
- QueryBuilderService classificationService = new QueryBuilderService();
- //展示查询构建器页面
- JPanel mainPanel = classificationService.getMainPanel();
- this.getContentPane().add(mainPanel, BorderLayout.CENTER);
- this.add(sureButton,BorderLayout.SOUTH);
- this.pack();
- this.setVisible(true);
- sureButton.addActionListener(this);
- }
- /**
- * 打开查询结果面板代码
- * 通过条件查询,打开条件相对应的查询结果面板
- * @param findName:查询值,如查询5开头的零组件则findName=5*
- * @param findValue:查询条件真实名称,如object_name
- * @param name:查询名称,如"数据集名称"
- * @author huyanling
- * 2021-10-16
- * */
- public void openSearchResultPage(String[] findName,String[] findValue,String name){
- try {
- if(findName.length>findValue.length){
- MessageBox.post("查询条件与查询值不对应,请检查!", "提示", 2);
- return ;
- }
- TCComponentQueryType typeComponent = (TCComponentQueryType) session.getTypeComponent("ImanQuery");
- TCComponentQuery find = (TCComponentQuery) typeComponent.find(name);
- if(find == null){
- MessageBox.post("TC中没有【" + name + "】这个查询,请定义该查询后使用!", "提示", 2);
- return ;
- }
- TCQueryClause[] describe = find.describe();//获取查询结果集
- String[] strings = new String[findValue.length];
- String[] value = findName;
- for(int v = 0; v < findValue.length; v++){
- for (int i = 0; i < describe.length; i++) {
- String attributeName = describe[i].getAttributeName();
- if(attributeName.equals(findValue[v])){
- //获取用户条目名称
- strings[v] = describe[i].getUserEntryNameDisplay();
- }
- }
- }
- TCComponent[] execute = find.execute(strings, value);
- if(execute.length<=0){
- MessageBox.post("没有查询到值哦,请检查自己的查询条件,或者确定TC中是否有数据!", "提示", 2);
- return ;
- }
- TcSearchUI tcSearchUI = new TcSearchUI();
- //获取查询对象
- TCComponentSearch tcComponentSearch = new TCComponentSearch(find, strings, value,

本文详细介绍了如何调用Teamcenter的分类、查询构建器、查询结果界面及相关TC应用。通过Java代码展示了各个功能的实现,包括分类界面的获取、查询构建器的展示以及查询操作。同时,列出了多个TC应用的ID及其在系统中的定位。

368

被折叠的 条评论
为什么被折叠?



