Bug 34769 [Navigator] F2/F5 actions not enabled/disabled properly when closing/opening project
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/navigator/WorkspaceActionGroup.java
* </p>
	 * <p>
	 * Both the open project and close project action may be on the menu
	 * at the same time.
	 * </p>
	 * <p>
	 * No disabled action should be on the context menu.
	 * </p>
	 * 
	 * @param menu context menu to add actions to
	 */
	public void fillContextMenu(IMenuManager menu) {
		IStructuredSelection selection =
			(IStructuredSelection) getContext().getSelection();
		boolean isProjectSelection = true; 
		boolean hasOpenProjects = false;
		boolean hasClosedProjects = false;
		boolean hasBuilder = true;	 
		Iterator resources = selection.iterator();
		while (resources.hasNext() &&
				(!hasOpenProjects || !hasClosedProjects || 
				 hasBuilder || isProjectSelection)) {
			Object next = resources.next();
			IProject project = null;
			
			if (next instanceof IProject)
				project = (IProject) next;
			else if (next instanceof IAdaptable)
				project = (IProject) ((IAdaptable) next).getAdapter(IProject.class);