IRunnableWithProgress r= createSaveEditorOperation(dialog.getResult(), elements, unsavedEditors);
IEditorPart[] unsavedEditorArray= (IEditorPart[]) unsavedEditors.toArray(new IEditorPart[unsavedEditors.size()]); IRunnableWithProgress r= createSaveEditorOperation(dialog.getResult(), unsavedEditorArray);
	private static boolean ensureSaved(List elements, String actionName) {		List unsavedEditors= new ArrayList();		List unsavedElements= new ArrayList();				collectUnsavedEditors(elements, unsavedEditors, unsavedElements);				if (unsavedEditors.isEmpty())			return true;					ListSelectionDialog dialog = createUnsavedEditorDialog(unsavedElements);		if (dialog.open() != dialog.OK)			return false;				IRunnableWithProgress r= createSaveEditorOperation(dialog.getResult(), elements, unsavedEditors);		try {			new ProgressMonitorDialog(JavaPlugin.getActiveWorkbenchShell()).run(false, false, r);		} catch (InvocationTargetException e) {			ExceptionHandler.handle(e, actionName, ReorgMessages.getString("ReorgAction.exception.saving")); //$NON-NLS-1$			return false;		} catch (InterruptedException e) {		}		return true;	}