Sometimes it’s very necessary to notify/show confirmation the user before exiting the whole application.
So, for displaying the confirmation in RCP application we need to either override
boolean org.eclipse.ui.application.WorkbenchWindowAdvisor.preWindowShellClose() OR boolean org.eclipse.ui.application.WorkbenchAdvisor.preShutdown()
The return value of the above functions determines wheather to close the application or not, which is in default true.
Example:
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { ..................... ..................... @Override public boolean preWindowShellClose() { boolean result = false; // custom dialog code goes here. // And the variable result is updated by the choice of the dialog. return result; } .................. .................. }