예제 #1
0
  /**
   * Sets filtering time. If the time is set to <code>-1</code> then filtering is off. Otherwise it
   * shows the time after which all items are allowed.
   *
   * @param aLimitTime the time used for limiting.
   */
  public void setLimitTime(long aLimitTime) {
    limitTime = aLimitTime;

    int shown = 0;
    int hidden = 0;
    for (ResultItemPanel item : items) {
      item.setFiltered(isFiltered(item));
      item.setVisibility(!item.isFiltered() && shown < itemLimit);

      if (item.isVisible()) shown++;
      else if (!item.isFiltered()) hidden++;
    }

    setVisible(shown > 0);
    moreItem.setCount(hidden);
  }