TCRCP开发之如何在自定义视图ViewPart中展示数据集(比如JT数据)

1:主要ViewPart代码

package XXXX;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Panel;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;

import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.aifrcp.AIFUtility;
import com.teamcenter.rac.common.tcviewer.TCViewerPanel;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCException;

public class JTViewPart extends ViewPart {

	private TCViewerPanel tcViewerPanel;
	private AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
	private InterfaceAIFComponent targetComponent=app.getTargetComponent();
	
	
	@Override
	public void createPartControl(Composite paramComposite) {
		// TODO Auto-generated method stub

		tcViewerPanel = new TCViewerPanel();
		IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
		if (page != null) {
			page.getWorkbenchWindow().getShell().setMaximized(true);
		}

		Composite composite = new Composite(paramComposite, SWT.EMBEDDED);

		Frame frame = SWT_AWT.new_Frame(composite);
		Panel contentPane = new Panel(new BorderLayout(0, 0));
		contentPane.setBackground(new Color(212, 208, 200));
		frame.add(contentPane);

		Display display = PlatformUI.getWorkbench().getDisplay();
		display.asyncExec(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					tcViewerPanel.setInput(“数据集”);
				} catch (TCException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});

		contentPane.add(tcViewerPanel);

	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}


}

2:如何在plugin.xml中配置

https://blog.csdn.net/qq_36880602/article/details/105824552

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

叮当LIU

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值