コード例 #1
0
  /**
   * Refreshes the members, filtered by any fixed criteria, as well as any user-specified filters.
   */
  public void refresh() {
    Criteria criteria = getCurrentCriteria();

    Map<String, Object> criteriaMap =
        (criteria != null) ? criteria.getValues() : Collections.<String, Object>emptyMap();

    try {
      carouselSizeFilter = Integer.valueOf((String) criteriaMap.get(FILTER_CAROUSEL_SIZE));
    } catch (Exception e) {
      carouselSizeFilter = null;
    }

    try {
      carouselStartFilter = (Integer) criteriaMap.get(FILTER_CAROUSEL_START);
    } catch (Exception e) {
      carouselStartFilter = null;
    }

    // on refresh remove any end filter as the criteria may have changed completely
    carouselEndFilter = null;

    // Any change to filters means we have to rebuild the carousel because the set of members may
    // change, because
    // "empty" members (i.e. members whose relevant data has been completely filtered) may be
    // omitted completely
    // from the carousel.
    buildCarousel(true);

    // TODO: it would be best if this was actually called after the async return of the member
    // refreshes
    refreshCarouselInfo();
  }
コード例 #2
0
  private void next() {
    if (null == carouselSizeFilter) {
      carouselSizeFilter = getDefaultCarouselSize();
    }

    if (null != carouselEndFilter) {
      int newStart = carouselEndFilter - 1;
      newStart = (newStart < carouselSizeFilter) ? carouselSizeFilter : newStart;
      setCarouselStartFilter(newStart);
    }

    setCarouselEndFilter(null);

    buildCarousel(true);
  }
コード例 #3
0
  private void previous() {
    if (null == carouselSizeFilter) {
      carouselSizeFilter = getDefaultCarouselSize();
    }

    if (null != carouselStartFilter) {
      int newEnd = carouselStartFilter + 1;
      setCarouselEndFilter(newEnd);

      // it's ok if this is higher than the current max, the actual fetch will make sure the
      // values are sane.
      setCarouselStartFilter(carouselStartFilter + carouselSizeFilter);
    }

    buildCarousel(true);
  }