container.addContainerProperty(ICON_PROPERTY, Resource.class, null);
container.addContainerProperty(INDEX_PROPERTY, Integer.class, null);
container
.addContainerProperty(DESCRIPTION_PROPERTY, String.class, null);
for (int i = 1; i < size + 1; i++) {
Item item = container.addItem(i);
item.getItemProperty(CAPTION_PROPERTY).setValue(
sg.nextString(true) + " " + sg.nextString(false));
item.getItemProperty(INDEX_PROPERTY).setValue(i);
item.getItemProperty(DESCRIPTION_PROPERTY).setValue(
sg.nextString(true) + " " + sg.nextString(false) + " "
+ sg.nextString(false));
item.getItemProperty(ICON_PROPERTY).setValue(testIcon.get());
}
container.getItem(container.getIdByIndex(0))
.getItemProperty(ICON_PROPERTY).setValue(testIcon.get());
if (hierarchical) {
for (int i = 1; i < size + 1; i++) {
for (int j = 1; j < 5; j++) {
String id = i + " -> " + j;
Item child = container.addItem(id);
child.getItemProperty(CAPTION_PROPERTY).setValue(
sg.nextString(true) + " " + sg.nextString(false));
child.getItemProperty(ICON_PROPERTY).setValue(
testIcon.get());
((Hierarchical) container).setParent(id, i);
for (int k = 1; k < 6; k++) {
String id2 = id + " -> " + k;
child = container.addItem(id2);
child.getItemProperty(CAPTION_PROPERTY).setValue(
sg.nextString(true) + " "
+ sg.nextString(false));
child.getItemProperty(ICON_PROPERTY).setValue(
testIcon.get());
((Hierarchical) container).setParent(id2, id);
for (int l = 1; l < 5; l++) {
String id3 = id2 + " -> " + l;
child = container.addItem(id3);
child.getItemProperty(CAPTION_PROPERTY).setValue(
sg.nextString(true) + " "
+ sg.nextString(false));
child.getItemProperty(ICON_PROPERTY).setValue(
testIcon.get());
((Hierarchical) container).setParent(id3, id2);
}
}
}