I'm using eclipse RCP with a view and I want to print something on the console when the application is closed.
This is what I have done, but It's not working;
public void createPartControl(final Composite parent){
parent.getShell().addListener(SWT.CLOSE, new Listener() {
@Override
public void handleEvent(Event event) {
System.out.println("NOW !");
}
});
}
EDIT: I found a solution, I needed to add a DisposeListener:
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
// TODO Auto-generated method stub
}
});