### Eclipse Workspace Patch 1.0 #P org.eclipse.jst.j2ee.ui Index: j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java =================================================================== RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java,v retrieving revision 1.5 diff -u -r1.5 CommonEditorUtility.java --- j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java 4 Sep 2007 17:59:39 -0000 1.5 +++ j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java 12 Aug 2010 04:40:11 -0000 @@ -25,7 +25,6 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.internal.EditorManager; @@ -93,13 +92,30 @@ } public static boolean promptToSaveAllDirtyEditors() { - return promptToSaveDirtyEditors(Arrays.asList(getDirtyEditors())); + boolean retVal = true; + IWorkbench workbench = J2EEUIPlugin.getPluginWorkbench(); + IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); + for (int i = 0; retVal && i < windows.length; i++) { + IWorkbenchPage[] pages = windows[i].getPages(); + for (int x = 0; retVal && x < pages.length; x++) { + retVal = pages[x].saveAllEditors(true); + } + } + return retVal; } + /** + * + * This method used to save only the editors specified. It now saves all dirty editors + * due to changes in the Eclipse platform + * @param dirtyEditors + * @return true if it succeeds, false if the user cancels + * @deprecated due to changes in the Eclipse platform + */ public static boolean promptToSaveDirtyEditors(List dirtyEditors) { if (dirtyEditors.isEmpty()) return true; - return EditorManager.saveAll(dirtyEditors, true, true,false, J2EEUIPlugin.getActiveWorkbenchWindow()); + return promptToSaveAllDirtyEditors(); } /**