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
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
Hide view
IViewPart viewRef = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("your view ID");

[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.


Paul Webster .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 May 20 21:49:58 GMT 2018

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

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

Back to the top