如何在Eclipse应用程序中以编程方式关闭视图? [英] How to programatically close a view in eclipse application?
本文介绍了如何在Eclipse应用程序中以编程方式关闭视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想以编程方式在Eclipse应用程序中关闭视图。
该视图是id的introPart:我尝试过的id:myProduct.intro
:
I want to programatically close a view in eclipse application. The view is a introPart with id: myProduct.intro I tried:
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.hideView(page.findView("myProduct.intro"));
但是它不起作用,有其他方法可以这样做还是我做错了什么?
But it did not work, any other way to do this or what am i doing wrong?
推荐答案
尝试:
IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
这篇关于如何在Eclipse应用程序中以编程方式关闭视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文