Close Part Listener [message #847713] |
Tue, 17 April 2012 11:25  |
Eclipse User |
|
|
|
Hi,
Can you tell me the best practice to be informed when user close a Part ? I thought add a PartListener on a EPartService, but I don't know where is the best place to do that. I tried to add and Addon to my E4 application model but the EPartService injected is an AplicationPartServiceImpl (not a PartServiceImpl), and the add of a PartListener throws new UnsupportedOperationException("Listeners should only be attached/removed from a window's part service");
Futhermore I would like to be notified when user close a certain kind of part (of type CompatibilityEditor)
I cannot annotate a method in my view with @PreDestroy (and do my stuff in this method) because I have not write the view's code myself is't a org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor
Because I use compatibility layer my views are opened like that :
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.openEditor(..., DiagramEditor.DIAGRAM_EDITOR_ID);
Thanks a lot
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05762 seconds