如何以编程方式关闭eclipse应用程序中的视图?

Des*_*tor 2 java eclipse eclipse-plugin eclipse-rcp

我想以编程方式关闭eclipse应用程序中的视图.该视图是一个id为的introPart:myProduct.intro我尝试过:

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.hideView(page.findView("myProduct.intro"));
Run Code Online (Sandbox Code Playgroud)

但它不起作用,任何其他方式做到这一点或我做错了什么?

gre*_*449 5

尝试:

IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();

PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
Run Code Online (Sandbox Code Playgroud)