I’m still working on Bug 227760. As mentioned earlier in the description of the bug, the save dialogue is prompted twice. Once, where mentioned earlier, and the second place I found is, in the “org.eclipse.debug.ui”, in the “org.eclipse.debug.internal.ui”. The file getting called is the “SaveScopeREsourcesHandler.java” and the prompt occurs in the handle status method.
The dialogue gets called in this condition:
if (projects != null) { IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); String save = store.getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH); int ret = showSaveDialog(projects, !save.equals(MessageDialogWithToggle.NEVER), save.equals(MessageDialogWithToggle.PROMPT)); if(ret == IDialogConstants.OK_ID) { doSave(); return Boolean.TRUE; } return Boolean.FALSE; } else { boolean cancel = DebugUIPlugin.preLaunchSave(); return Boolean.valueOf(cancel); }
The DebugUIPlugin.java class is called in the else condition, which invokes the second dialogue.The DebugUIPlugin class has the method that checks and calls the save prompt:
public static boolean preLaunchSave() { String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH); if (saveDirty.equals(MessageDialogWithToggle.NEVER)) { return true; } return saveAllEditors(saveDirty.equals(MessageDialogWithToggle.PROMPT)); }
Playing around with this code, for example disabling the “.PROMPT”, did not display the message. Therefore, we may be dealing with the “saveDirty”. Someone worked on a similar saveDirty dialogue in the class, and I will ask him & look into his blog for help on this. Will update again soon.