public void commit(IDocument document) throws CoreException { updateMarkers(document); }
@Override public void commit(IDocument document) throws CoreException { updateMarkers(document); }
/** * Commits the given file info's file buffer by changing the contents * of the underlying file to the contents of this file buffer. After that * call, <code>isDirty</code> returns <code>false</code> and <code>isSynchronized</code> * returns <code>true</code>. * * @param monitor the progress monitor * @param info the element's file info object * @param overwrite indicates whether the underlying file should be overwritten if it is not synchronized with the file system * @throws CoreException if writing or accessing the underlying file fails */ protected void commitFileBuffer(IProgressMonitor monitor, FileInfo info, boolean overwrite) throws CoreException { Assert.isNotNull(info); /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=98327 * Make sure file gets save in commit() if the underlying file has been deleted */ if (info.fElement instanceof IFileEditorInput) { IFileEditorInput input= (IFileEditorInput) info.fElement; IResource resource= input.getFile(); if (!resource.isSynchronized(IResource.DEPTH_ZERO) && isDeleted(input)) info.fTextFileBuffer.setDirty(true); } info.fTextFileBuffer.commit(monitor, overwrite); if (info.fModel instanceof AbstractMarkerAnnotationModel) { AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel; model.updateMarkers(info.fTextFileBuffer.getDocument()); } }
/** * Commits the given file info's file buffer by changing the contents * of the underlying file to the contents of this file buffer. After that * call, <code>isDirty</code> returns <code>false</code> and <code>isSynchronized</code> * returns <code>true</code>. * * @param monitor the progress monitor * @param info the element's file info object * @param overwrite indicates whether the underlying file should be overwritten if it is not synchronized with the file system * @throws CoreException if writing or accessing the underlying file fails */ protected void commitFileBuffer(IProgressMonitor monitor, FileInfo info, boolean overwrite) throws CoreException { Assert.isNotNull(info); /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=98327 * Make sure file gets saved in commit() if the underlying file has been deleted */ if (info.fElement instanceof IFileEditorInput) { IFileEditorInput input= (IFileEditorInput) info.fElement; IResource resource= input.getFile(); if (!resource.isSynchronized(IResource.DEPTH_ZERO) && isDeleted(input)) info.fTextFileBuffer.setDirty(true); } info.fTextFileBuffer.commit(monitor, overwrite); if (info.fModel instanceof AbstractMarkerAnnotationModel) { AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel; model.updateMarkers(info.fTextFileBuffer.getDocument()); } }
model.updateMarkers(document);
model.updateMarkers(document);
model.updateMarkers(document);