Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Close Part Listener
Close Part Listener [message #847713] Tue, 17 April 2012 11:25 Go to previous message
Philippe Fry is currently offline Philippe Fry
Messages: 5
Registered: April 2012
Junior Member
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
 
Read Message
Read Message
Read Message
Previous Topic:How do i define and use my own renderer?
Next Topic:eclipse e4 basics - data model
Goto Forum:
  


Current Time: Sat May 25 13:25:27 EDT 2013

Powered by FUDForum. Page generated in 0.01557 seconds