Bug 91409 Project Open/Close items are disabled when Package Explorer active
Project Open/Close option in the Project menu is disabled in Plugin prespective.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/OpenCloseWorkingSetAction.java
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
public abstract class OpenCloseWorkingSetAction extends SelectionDispatchAction implements IResourceChangeListener {
	private OpenCloseWorkingSetAction(IWorkbenchSite site, String label) {
		super(site);
		setText(label);
		ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
	}
	
	public static OpenCloseWorkingSetAction createCloseAction(IWorkbenchSite site) {
		return new OpenCloseWorkingSetAction(site, WorkingSetMessages.OpenCloseWorkingSetAction_close_label) { 
			protected boolean validate(IProject project) {
				return project.isOpen();
			}
 			protected void performOperation(IProject project, IProgressMonitor monitor) throws CoreException {
				project.close(monitor);
			}