I have a eclipse rcp application in which i had created a editor which extends EditorPart.
I want to do some release resource work in its close()
editor action, so i want to override its close action or any method that just came in to action before to close event.
I had tried dispose()
but it to late to work on it.
Or is there any specific listener that listen close event.
i want to have like that:
@override
public void close()
{
//do something resource release related task.
}
Update: basically i want to intercept close event for a editor.
You can use IPartListener
for this purpose:
public class YourEditor extends EditorPart {
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
getSite().getPage().addPartListener(new IPartListener() {
@Override
public void partOpened(IWorkbenchPart part) {
// TODO Auto-generated method stub
}
@Override
public void partDeactivated(IWorkbenchPart part) {
// TODO Auto-generated method stub
}
@Override
public void partClosed(IWorkbenchPart part) {
// TODO Auto-generated method stub
}
@Override
public void partBroughtToTop(IWorkbenchPart part) {
// TODO Auto-generated method stub
}
@Override
public void partActivated(IWorkbenchPart part) {
// TODO Auto-generated method stub
}
});
}
}
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