Source:
<code>public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) { if (event.getResource() instanceof IProject) { IProject project = (IProject) event.getResource(); try { <START> if (project.hasNature(TmfProjectNature.ID)) { <END> TmfProjectElement tmfProjectElement = registry.get(project); if (tmfProjectElement == null) { return; } final List<TmfTraceElement> traces = tmfProjectElement.getTracesFolder().getTraces(); if (!traces.isEmpty()) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { for (TmfTraceElement traceElement : traces) { traceElement.closeEditors(); } } }); } } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) { for (IResourceDelta delta : event.getDelta().getAffectedChildren()) { if (delta.getResource() instanceof IProject) { IProject project = (IProject) delta.getResource(); try { if (delta.getKind() == IResourceDelta.CHANGED && project.isOpen() && project.hasNature(TmfProjectNature.ID)) { TmfProjectElement projectElement = getProject(project, true); projectElement.refresh(); } else if (delta.getKind() == IResourceDelta.REMOVED) { registry.remove(project); } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } } }</code><technical_language>I get this if closed. fix time org.eclipse.core.internal.resources.ResourceException: Resource '/delete-me' is open. org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:150) org.eclipse.core.internal.resources.Project.hasNature(Project.java:584) org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectRegistry.resourceChanged(TmfProjectRegistry.java:163)</technical_language>

Target:
public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) { if (event.getResource() instanceof IProject) { IProject project = (IProject) event.getResource(); try { if (project.isAccessible() && project.hasNature(TmfProjectNature.ID)) { TmfProjectElement tmfProjectElement = registry.get(project); if (tmfProjectElement == null) { return; } final List<TmfTraceElement> traces = tmfProjectElement.getTracesFolder().getTraces(); if (!traces.isEmpty()) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { for (TmfTraceElement traceElement : traces) { traceElement.closeEditors(); } } }); } } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) { for (IResourceDelta delta : event.getDelta().getAffectedChildren()) { if (delta.getResource() instanceof IProject) { IProject project = (IProject) delta.getResource(); try { if (delta.getKind() == IResourceDelta.CHANGED && project.isOpen() && project.hasNature(TmfProjectNature.ID)) { TmfProjectElement projectElement = getProject(project, true); projectElement.refresh(); } else if (delta.getKind() == IResourceDelta.REMOVED) { registry.remove(project); } } catch (CoreException e) { Activator.getDefault().logError("Error handling resource change event for " + project.getName(), e); } } } } }