Bug 269844 [GlobalActions] "Close Unrelated Projects" is dangerous and needs confirmation
I20090317-1745 "Close Unrelated Projects" is a dangerous operation with and hence needs a confirmation dialog (with a "don't nag me again" checkbox, if you want). I just inadvertently executed this action from the context menu, and now I have to manually restore my workspace state. Even if Undo would work, that would still cause a full build of all closed projects.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CloseUnrelatedProjectsAction.java
selectionDirty = false;
		}
		return projectsToClose;
	}
	/**
	 * Handles a resource changed event by updating the enablement
	 * when projects change.
	 * <p>
	 * This method overrides the super-type implementation to update
	 * the selection when the open state or description of any project changes.
	 */
	public void resourceChanged(IResourceChangeEvent event) {
		
		if (selectionIsOfType(IResource.PROJECT)) {
			IResourceDelta delta = event.getDelta();
			if (delta != null) {
				IResourceDelta[] projDeltas = delta.getAffectedChildren(IResourceDelta.CHANGED);
				for (int i = 0; i < projDeltas.length; ++i) {
					IResourceDelta projDelta = projDeltas[i];
					
					if ((projDelta.getFlags() & (IResourceDelta.OPEN | IResourceDelta.DESCRIPTION)) != 0) {
						selectionChanged(getStructuredSelection());
						return;
					}
				}
			}
		}
	}
}