Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to close a view?
How to close a view? [message #505014] Thu, 24 December 2009 07:16 Go to next message
Eclipse UserFriend
Hi,
Can you tell me how to close a view passing viewID as parameter?
I want that a view was closed by pressing a button of another view.
Thanks a lot.

[Updated on: Thu, 24 December 2009 07:17] by Moderator

Re: How to close a view? [message #505044 is a reply to message #505014] Fri, 25 December 2009 04:20 Go to previous messageGo to next message
Eclipse UserFriend
Hide view
IViewPart viewRef = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("your view ID");
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(viewRef);

[Updated on: Fri, 25 December 2009 04:22] by Moderator

Re: How to close a view? [message #505938 is a reply to message #505044] Tue, 05 January 2010 10:27 Go to previous message
Eclipse UserFriend
Michael Golovanov wrote:
> Hide view IViewPart viewRef =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().findView( "your
> view ID");
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().hideView(viewRef);

Just a note: If you are already in a view, simply use
getSite().getPage() to get your IWorkbenchPage. Don't go to PlatformUI
if you can help it.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Previous Topic:Problem using activeEditorInput with Commands
Next Topic:how to enable a menuitem by default
Goto Forum:
  


Current Time: Sun Jul 13 17:12:49 EDT 2025

Powered by FUDForum. Page generated in 0.05549 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top