Closing a view programmatically before shutdown [message #541647] |
Mon, 21 June 2010 22:54 |
|
Hello,
I'm writing a plug-in which opens a view programmatically to show some results. Now I want to close this view programmatically when Eclipse shuts down, because Eclipse saves the workbench everytime it exits and I don't want it to save my view.
I found the code to close a view like the following:
final IViewReference[] viewRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getViewReferences();
for (int v = 0; v < viewRefs.length; v++){
final IViewReference viewRef = viewRefs[v];
if(viewRef.getView(false).getTitle().equals(MY_VIEW_TITLE)){
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().hideView(viewRef);
}
}
but I don't know where to put this. I tried putting it in plug-in activator file's stop() method, but didn't work out.
Can anybody help me with this please?
Cheers,
Bahar
[Updated on: Mon, 21 June 2010 22:55] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02288 seconds