ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), x.getStatus());
IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL) ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), x.getStatus());
	protected void performSaveAs(IProgressMonitor progressMonitor) {				Shell shell= getSite().getShell();		IEditorInput input = getEditorInput();				SaveAsDialog dialog= new SaveAsDialog(shell);				IFile original= (input instanceof IFileEditorInput) ? ((IFileEditorInput) input).getFile() : null;		if (original != null)			dialog.setOriginalFile(original);					dialog.create();							IDocumentProvider provider= getDocumentProvider();		if (provider == null) {			// editor has been programmatically closed while the dialog was open			return;		}				if (provider.isDeleted(input) && original != null) {			String message= JavaEditorMessages.getFormattedString("CompilationUnitEditor.warning.save.delete", new Object[] { original.getName() }); //$NON-NLS-1$			dialog.setErrorMessage(null);			dialog.setMessage(message, IMessageProvider.WARNING);		}					if (dialog.open() == Window.CANCEL) {			if (progressMonitor != null)				progressMonitor.setCanceled(true);			return;		}					IPath filePath= dialog.getResult();		if (filePath == null) {			if (progressMonitor != null)				progressMonitor.setCanceled(true);			return;		}					IWorkspaceRoot workspaceRoot= ResourcesPlugin.getWorkspace().getRoot();		IFile file= workspaceRoot.getFile(filePath);		final IEditorInput newInput= new FileEditorInput(file);				boolean success= false;		try {						provider.aboutToChange(newInput);			getDocumentProvider().saveDocument(progressMonitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);			success= true;					} catch (CoreException x) {			ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), x.getStatus()); //$NON-NLS-1$ //$NON-NLS-2$		} finally {			provider.changed(newInput);			if (success)				setInput(newInput);		}				if (progressMonitor != null)			progressMonitor.setCanceled(!success);	}