/** * Returns <code>true</code> if a {@link Project} exists in the current {@link UISelection}. */ protected boolean containsProject(UIContext context) { return Projects.containsProject(getProjectFactory(), context); }
/** * 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; }