public static synchronized void closeEditorIfRequired(IResourceChangeEvent event, final IFile file, final IEditorPart editor) {
if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
IResourceDelta delta = event.getDelta().findMember(file.getFullPath());
if (delta != null) {
IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {
public boolean visit(IResourceDelta delta) {
if (delta.getKind() == IResourceDelta.REMOVED) {
if (file.equals(delta.getResource())) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {