Código a ejecutar cuando un View se cierra


Cuando en tu Vista RCP, necesites realizar alguna acción, debes agregar un "disposeListener" 

public class View extends ViewPart {

public void createPartControl(Composite parent) {



// Method to listen when the View is Disposed and finishes the job
// as well as unsubscribe to EventBroker
// In this case I did not use ViewContentProvider.dispose() method
// because the code is taking care of the whole View Object
// instead the ContentProvider
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
// Canceling the current job
job.cancel();

// Unsubscribe from the event otherwise this view will
// still be listening to the event the next time it is opened
IEventBroker eventBroker = EventBroker.getInstance();
eventBroker.unsubscribe(eventHandler);

}
});

}
}

Saludos

Comentarios