@Override
protected Layout getLayout(Object object, Class type) {
return new Layout() {
private HtmlComponent processUnionGroup(UnionGroup object) {
HtmlContainer container = new HtmlInlineContainer();
container.setIndented(false);
int i = object.getChildren().size();
for (Group child : object.getChildren()) {
if (child instanceof UnionGroup) {
container.addChild(processUnionGroup((UnionGroup) child));
} else {
container.addChild(new HtmlText(child.getPresentationName()));
}
i--;
if (i > 0) {
container.addChild(new HtmlText(", "));
}
}
return container;
}
@Override
public HtmlComponent createComponent(Object object, Class type) {
HtmlInlineContainer container = new HtmlInlineContainer();
if (object instanceof UnionGroup) {
container.addChild(processUnionGroup((UnionGroup) object));
} else {
Group group = (Group) object;
container.addChild(new HtmlText(group.getPresentationName()));
}
return container;
}