Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Close perspective views
Close perspective views [message #464410] Fri, 02 March 2007 08:56
Eclipse UserFriend
When I change a perspective, I need to close all opened views before open
the other perspective to free memory.
I use this code to close views:

Vector<String> perspectiveView = getPerspectiveView();
for (Iterator iter = perspectiveView .iterator(); iter.hasNext();) {
String idView = (String) iter.next();
try {
IViewPart view = page.findView(idView);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().
getActivePage().hideView(view);
} catch (Throwable t) {
System.out.println("view not closed");
}
}

To detect the change of perspective, I add a listener in perspectiveBar.

To close a view, I have to instantiate it. To instantiate a view the
perspective that holds the view has to be activated, so I have to
reactivate the before perspective, hide its views and finally activate the
other perspective to can get my objetive.

Can I add a listener in actual perspective o similar that notify me when a
perspective is going to be hiden?, so I could close all its views and
later activate the other perspective. I have implement
IPerspectiveListener4 but I didn't obtain anything.

Can someone help me? please
Thanks.

Ángel
Previous Topic:Launching a progress Dialog from wizard
Next Topic:Forcing views to construct within a perspective
Goto Forum:
  


Current Time: Sat Mar 15 01:57:23 EDT 2025

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

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

Back to the top