Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to close a view?
How to close a view? [message #505014] Thu, 24 December 2009 12:16 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: December 2009
Junior Member
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 12:17]

Report message to a moderator

Re: How to close a view? [message #505044 is a reply to message #505014] Fri, 25 December 2009 09:20 Go to previous messageGo to next message
Michael Golovanov is currently offline Michael GolovanovFriend
Messages: 37
Registered: October 2009
Member
Hide view
IViewPart viewRef = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("your view ID");
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(viewRef);

[Updated on: Fri, 25 December 2009 09:22]

Report message to a moderator

Re: How to close a view? [message #505938 is a reply to message #505044] Tue, 05 January 2010 15:27 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Tue Mar 19 08:29:58 GMT 2024

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

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

Back to the top