public CarouselIndicatorContainer(CarouselCss css, int numberOfPages) {
if (numberOfPages < 0) {
throw new IllegalArgumentException();
}
this.css = css;
main = new FlexPanel();
initWidget(main);
main.setOrientation(Orientation.HORIZONTAL);
main.setJustification(Justification.CENTER);
main.addStyleName(this.css.indicatorMain());
FlexPanel container = new FlexPanel();
container.addStyleName(this.css.indicatorContainer());
container.setOrientation(Orientation.HORIZONTAL);
main.add(container);
indicators = new ArrayList<Carousel.CarouselIndicator>(numberOfPages);
selectedIndex = 0;
for (int i = 0; i < numberOfPages; i++) {
CarouselIndicator indicator = new CarouselIndicator(css);
indicators.add(indicator);
container.add(indicator);
}
setSelectedIndex(selectedIndex);
}