*/
@SuppressWarnings("serial")
private void init(IDataProvider provider, final int cols, final int rows)
{
add(HeaderContributor.forCss(AnimatedThumbnailGallery.class, "AnimatedThumbnailGallery.css"));
GridView view;
add(view = new GridView("rows", dataProvider)
{
@Override
protected void populateEmptyItem(Item item)
{
item.add(new Label("animatedThumbnail", "--"));
}
@Override
protected void populateItem(Item item)
{
int index = item.getIndex();
AnimatedThumbnailSettings settings = (AnimatedThumbnailSettings)item.getModelObject();
settings.setThumbnailDimension(thumbnailWidth, thumbnailHeight);
settings.setPictureDimension(pictureWidth, pictureHeight);
settings.setPicturePosition(getPositionLeft(index, cols), getPositionTop(index, cols));
item.add(new AnimatedThumbnail("animatedThumbnail", settings)
.add(new AttributeAppender("style", true,
new Model("width:"+thumbnailWidth+";height:"+thumbnailHeight+";"),"")));
}
});
view.setColumns(cols);
view.setRows(rows);
}