*/
protected void createFileFromDocument(IProgressMonitor monitor, IFile file, IDocument document) throws CoreException {
try {
monitor.beginTask(TextEditorMessages.TextFileDocumentProvider_beginTask_saving, 2000);
ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
manager.connect(file.getFullPath(), LocationKind.IFILE, monitor);
ITextFileBuffer buffer= ITextFileBufferManager.DEFAULT.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE);
buffer.getDocument().set(document.get());
buffer.commit(monitor, true);
manager.disconnect(file.getFullPath(), LocationKind.IFILE, monitor);
} finally {