以编程方式显示来自 Eclipse 插件的视图 [英] Programmatically showing a View from an Eclipse Plug-in

查看:34
本文介绍了以编程方式显示来自 Eclipse 插件的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有视图的 Eclipse RCP 应用程序的插件.在 RCP 应用程序中发生事件后,插件被实例化,调用其方法来填充插件的模型,但我无法找到如何在不转到显示视图..."菜单的情况下显示视图.

I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.

我认为工作台单例中会有一些东西可以处理这个问题,但我还没有在任何地方找到方法.

I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere.

推荐答案

您可能正在寻找这个:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId");

这篇关于以编程方式显示来自 Eclipse 插件的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆