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

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

问题描述

我有一个Eclipse RCP应用程序的插件,它具有一个视图。在RCP应用程序发生事件之后,插件被实例化,其方法被调用来填充插件的模型,但是我无法找到如何使视图显示,而不进入显示视图...菜单



我会认为工作单位可能会处理这件事情,但我还没有找到任何地方。

解决方案

您可能正在寻找:

  PlatformUI。 getWorkbench()getActiveWorkbenchWindow()getActivePage()showView( viewId)。。。; 


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.

解决方案

You are probably looking for this:

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

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

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