if (provider.isDeleted(input)) { if (isSaveAsAllowed()) {
/** * The <code>AbstractTextEditor</code> implementation of this * <code>IEditorPart</code> method may be extended by subclasses. * * @param progressMonitor the progress monitor for communicating result state or <code>null</code> */ public void doSave(IProgressMonitor progressMonitor) { IDocumentProvider p= getDocumentProvider(); if (p == null) return; if (p.isDeleted(getEditorInput())) { if (isSaveAsAllowed()) { /* * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. * Changed Behavior to make sure that if called inside a regular save (because * of deletion of input element) there is a way to report back to the caller. */ performSaveAs(progressMonitor); } else { Shell shell= getSite().getShell(); String title= EditorMessages.Editor_error_save_deleted_title; String msg= EditorMessages.Editor_error_save_deleted_message; MessageDialog.openError(shell, title, msg); } } else { updateState(getEditorInput()); validateState(getEditorInput()); performSave(false, progressMonitor); } }