code: protected Project getSelectedProject(UIContext context)
     {
        Project selectedProject = Projects.getSelectedProject(getProjectFactory(), context);
        if (isProjectRequired() && selectedProject == null)
        {
           throw new IllegalStateException("A project is required in the current context");
        }
        return selectedProject;
     }
docs: Returns the selected {@link Project}. <code>null</code> if no {@link Project} is found.