I have a view in Eclipse (implemented by a class which extends org.eclipse.ui.part.ViewPart
) which I need to close. I mean completely close, not just hide. I want a new ViewPart instance to be created when the user (or my code) asks to open the view again.
The only method I found was IWorkbenchPage.hideView
which hides the view, but does not completely dispose of it. Invoking dispose
on the view has no affect, either.
BTW, my view is defined as allowMultiple="false"
but I tried with true
and that didn't make any difference.
Any help will be appreciated.
I found the problem eventually. If the view is open on more than one perspective, hiding it on one perspective will not close it. It is possible to iterate over all the open perspective and look for the view. Hiding it on all perspectives will close it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With