/** * Returns the selected {@link Project}. <code>null</code> if no {@link Project} is found. */ 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; }
@Override public boolean isEnabled(UIContext context) { return ((isProjectRequired() && containsProject(context) && constraintsSatisfied(context)) && super.isEnabled(context)) || (!isProjectRequired() && super.isEnabled(context)); }