Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » close and reopen a view
close and reopen a view [message #1817206] Mon, 18 November 2019 14:30 Go to next message
Emmanuel SEMO is currently offline Emmanuel SEMOFriend
Messages: 7
Registered: October 2019
Junior Member
Hello everybody,

I'm currently lock on a specific point I have a view called "view1" which is link to a perspective called "perspective1". This view appear just after the tab properties
I have a diagram too with some elements.

I would like to know how to close this view and open it on a clic on a specific element of the diagram?

I tried this to close the window :
public void closeAlertView() { 
		getSite().getPage().hideView(this); 
	} 

And this part is working but when I'm trying to reopen the window with this code :
public void showAlertView() { 
		IWorkbench workbench = PlatformUI.getWorkbench();
		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
		IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
		
		IViewPart view = null;
		try {
			view = workbenchPage.showView("org.polarsys.capella.vp.avionique.vpdsl.view1",null,IWorkbenchPage.VIEW_CREATE);
		} catch (PartInitException e) {
			e.printStackTrace();
		}
	} 

The windows does not appear and I have a Widget is disposed exception. Maybe the call of the "showAlertView" is not done at the right place? I'm really lost at this point.

Thanks for your help.

Regards,

Emmanuel

[Updated on: Mon, 18 November 2019 14:40]

Report message to a moderator

Re: close and reopen a view [message #1817351 is a reply to message #1817206] Wed, 20 November 2019 20:13 Go to previous message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
Without any stack trace where your widget disposed exception occurs it is very hard to guess what is wrong.

I expect that you incorrectly keep references in your view to widgets that are disposed, as a result of the hide view action.
Previous Topic:Create Java Editor Using Eclipse RCP
Next Topic:Eclipse 4 RCP Plugin. Programmatically import projects
Goto Forum:
  


Current Time: Tue Oct 15 16:08:01 GMT 2024

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

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

Back to the top