if (!isDirty && resource.isModified()) { // The XMLModel was saved
resource.setModified(false);
long stamp = WorkbenchResourceHelper.computeModificationStamp(resource);
WorkbenchResourceHelper.setSynhronizationStamp(resource, stamp);
IProject proj = WorkbenchResourceHelper.getProject(resource);
ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) WorkbenchResourceHelperBase.getResourceSet(proj)).getSynchronizer();
IFile aFile = WorkbenchResourceHelper.getFile(resource);
synchronizer.preSave(aFile, resource);
}
if (isDirty)
resource.setModified(true);
}