}
private static ComponentContainer createContainer(
Class<? extends ComponentContainer> containerClass, Object iconType)
throws InstantiationException, IllegalAccessException {
ComponentContainer container = containerClass.newInstance();
for (String size : sizes) {
Label title = new Label("<h3>" + size + "x" + size + "</h3>",
ContentMode.HTML);
container.addComponent(title);
for (String icon : icons) {
ThemeResource res = new ThemeResource("../runo/icons/" + size
+ "/" + icon);
if (TYPE_CAPTION.equals(iconType)) {
Label name = new Label();
name.setCaption(icon);
name.setIcon(res);
container.addComponent(name);
} else if (TYPE_EMBEDDED.equals(iconType)) {
Embedded e = new Embedded(icon, res);
container.addComponent(e);
}
}
}
return container;