Ejemplo n.º 1
0
  /** Does the actual addition of {@link UserItem}s to the top of the list. */
  private void addHead() {
    List<UserItem> l = head;
    if (l.size() > 0) {
      head = new ArrayList<UserItem>();
      headKeys = new HashSet<Key>();

      int offsetHeight = flowPanel.getOffsetHeight();
      for (int i = l.size() - 1; i >= 0; i--) {
        UserItem e = l.get(i);
        RowWidget row = createRow(e);
        flowPanel.insert(row, 0);
        rows.put(row.getKey(), row);
      }

      int deltaHeight = flowPanel.getOffsetHeight() - offsetHeight;
      scrollPanel.setVerticalScrollPosition(scrollPanel.getVerticalScrollPosition() + deltaHeight);

      rowsAdded();
      NewDataEvent.fire(this, NewDataType.NEW_DATA_SHOWN);
    }
  }