close and reopen a view [message #1817206] |
Mon, 18 November 2019 14:30 |
Emmanuel SEMO 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03731 seconds