Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to dispose a view programmatically?(When my cloned perspective gets deleted, I want its views to be disposed.)
How to dispose a view programmatically? [message #536133] Thu, 27 May 2010 08:30 Go to next message
Marton Sigmond is currently offline Marton Sigmond
Messages: 71
Registered: July 2009
Location: Hungary
Member
Hi,

I use views associated with a particular perspective (i.e. allowMultiple=true; secondaryId=perspectiveId).
I clone a perspective when I need it, and delete it when I do not need it anymore.

However, the views associated with the deleted perspective do not get disposed.
How could I achieve, that those views get disposed (programmatically, declaratively, etc.)?

Thank you for your help.
Marton


Best Regards,
Marton Sigmond
Software Design Engineer
Re: How to dispose a view programmatically? [message #536281 is a reply to message #536133] Thu, 27 May 2010 14:35 Go to previous messageGo to next message
Marton Sigmond is currently offline Marton Sigmond
Messages: 71
Registered: July 2009
Location: Hungary
Member
I guess this is what I was looking for:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closePerspective(perspDesc, true, false);
Could anyone please confirm that this is a legal way to dispose a perspective and all associated views?

Also since I found the above solution, I do not invoke the IPerspectiveRegistry.deletePerspective() method anymore.
Is this correct so?

Thanks,
Marton


Best Regards,
Marton Sigmond
Software Design Engineer
Re: How to dispose a view programmatically? [message #536296 is a reply to message #536281] Thu, 27 May 2010 14:52 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Marton Sigmond wrote:
> I guess this is what I was looking for:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().closePerspective(perspDesc,
> true, false);

This is API (good), and will close the perspective and hide all of its
views.

>
> Also since I found the above solution, I do not invoke the
> IPerspectiveRegistry.deletePerspective() method anymore.

Delete perspective should delete the perspective descriptor from the
registry.

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:Feature Export in 3.5 not creating feature jnlp file
Next Topic:How to get the application id?
Goto Forum:
  


Current Time: Sat Oct 25 03:04:00 GMT 2014

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

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