View | Details | Raw Unified | Return to bug 322295
Collapse All | Expand All

(-)j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/CommonEditorUtility.java (-3 / +19 lines)
Lines 25-31 Link Here
25
import org.eclipse.ui.IWorkbenchPage;
25
import org.eclipse.ui.IWorkbenchPage;
26
import org.eclipse.ui.IWorkbenchWindow;
26
import org.eclipse.ui.IWorkbenchWindow;
27
import org.eclipse.ui.PlatformUI;
27
import org.eclipse.ui.PlatformUI;
28
import org.eclipse.ui.internal.EditorManager;
29
28
30
29
31
30
Lines 93-105 Link Here
93
	}
92
	}
94
93
95
	public static boolean promptToSaveAllDirtyEditors() {
94
	public static boolean promptToSaveAllDirtyEditors() {
96
		return promptToSaveDirtyEditors(Arrays.asList(getDirtyEditors()));
95
		boolean retVal = true;
96
		IWorkbench workbench = J2EEUIPlugin.getPluginWorkbench();
97
		IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
98
		for (int i = 0; retVal && i < windows.length; i++) {
99
			IWorkbenchPage[] pages = windows[i].getPages();
100
			for (int x = 0; retVal && x < pages.length; x++) {
101
				retVal = pages[x].saveAllEditors(true);
102
			}
103
		}
104
		return retVal;
97
	}
105
	}
98
106
107
	/**
108
	 * 
109
	 * This method used to save only the editors specified.  It now saves all dirty editors
110
	 * due to changes in the Eclipse platform
111
	 * @param dirtyEditors
112
	 * @return true if it succeeds, false if the user cancels
113
	 * @deprecated due to changes in the Eclipse platform
114
	 */
99
	public static boolean promptToSaveDirtyEditors(List dirtyEditors) {
115
	public static boolean promptToSaveDirtyEditors(List dirtyEditors) {
100
		if (dirtyEditors.isEmpty())
116
		if (dirtyEditors.isEmpty())
101
			return true;
117
			return true;
102
		return EditorManager.saveAll(dirtyEditors, true, true,false, J2EEUIPlugin.getActiveWorkbenchWindow());
118
		return promptToSaveAllDirtyEditors();
103
	}
119
	}
104
	
120
	
105
	/**
121
	/**

Return to bug 322295