Project: Eclipse_Platform_UI
Bug 360513 [Preferences] IPreferencePage.performCancel() does not stop PreferenceDialog.cancelPressed() if it returns false
Reported: 2011-10-11 04:30:00 | Status: resolved fixed

Build Identifier: 20110916-0149 The code of PreferenceDialog.cancelPressed() is the following: protected void cancelPressed() { // Inform all pages that we are cancelling Iterator nodes = preferenceManager.getElements(PreferenceManager.PRE_ORDER).iterator(); while (nodes.hasNext()) { final IPreferenceNode node = (IPreferenceNode) nodes.next(); if (getPage(node) != null) { SafeRunnable.run(new SafeRunnable() { public void run() { if (!getPage(node).performCancel()) { return; } } }); } } // Give subclasses the choice to save the state of the preference pages if needed handleSave(); setReturnCode(CANCEL); close(); } Notice that if getPage(node).performCancel() nothing will happen, and it will continue with handleSave(), setReturnCode(CANCEL) and close() the dialog. My question is: If the page returns false in performCancel(), should the dialog not close? because it closes anyway. Reproducible: Always

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java