/** * Refresh the items in the view. Delegates the creation of items to the selected item reuse * strategy */ @Override protected final void onPopulate() { Iterator<IModel<T>> models = getItemModels(); Iterator<Item<T>> items = getItemReuseStrategy().getItems(newItemFactory(), models, getItems()); removeAll(); addItems(items); }
/** * Refresh the items in the view. Delegates the creation of items to the selected item reuse * strategy */ @Override protected final void onPopulate() { Iterator<IModel<T>> models = getItemModels(); Iterator<Item<T>> items = getItemReuseStrategy().getItems(newItemFactory(), models, getItems()); removeAll(); addItems(items); }
/** * Refresh the items in the view. Delegates the creation of items to the selected item reuse * strategy */ @Override protected final void onPopulate() { Iterator<IModel<T>> models = getItemModels(); Iterator<Item<T>> items = getItemReuseStrategy().getItems(newItemFactory(), models, getItems()); removeAll(); addItems(items); }
/** * Refresh the items in the view. Delegates the creation of items to the selected item reuse * strategy */ protected final void onPopulate() { IItemFactory itemFactory = new IItemFactory() { public Item newItem(int index, IModel model) { String id = RefreshingView.this.newChildId(); Item item = RefreshingView.this.newItem(id, index, model); RefreshingView.this.populateItem(item); return item; } }; Iterator models = getItemModels(); Iterator items = getItemReuseStrategy().getItems(itemFactory, models, getItems()); removeAll(); addItems(items); }