Bug 81421 Closing a project with open editors leaves stale elements in Package Explorer's working set layout
I20041216-0800 Closing a project with open editors leaves stale elements in Package Explorer's working sets mode. This only affects CUs not normal resources.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/HistoryWorkingSetUpdater.java
public static final String ID= "org.eclipse.jdt.internal.ui.HistoryWorkingSet"; 
	
	private class Tracker extends EditorTracker {
		public void editorOpened(IEditorPart part) {
			IAdaptable file= getInput(part);
			if (file == null)
				return;
			fOpenFiles.add(file);
		}
		public void editorClosed(IEditorPart part) {
			IAdaptable file= getInput(part);
			if (file == null)
				return;
			fOpenFiles.remove(file);
			
		}
		private IAdaptable getInput(IEditorPart part) {
			IEditorInput input= part.getEditorInput();
			if (!(input instanceof IFileEditorInput))
				return null;
			
			if (part instanceof CompilationUnitEditor) {
				return JavaCore.create(((IFileEditorInput)input).getFile());
			}
			return ((IFileEditorInput)input).getFile();
		}
	}
	
	private IWorkingSet fWorkingSet;
	private Set fOpenFiles;