detailsView.addComponent(VaadinUtility.hr());
addComponent(detailsView);
Table taskTable = attachTitledTable(detailsView, "log.details", taskDetailsContainer, new Object[] {"title", "component"},
new HashMap<String, ColumnGenerator>() {{
put("component", new ColumnGenerator() {
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
Item item = logContainer.getItemDirectly(log);
Property property = item.getItemProperty(itemId);
if (property != null && property.getValue() != null) {
String value = (String) property.getValue();
if (Strings.hasText(value) && ("log.substitutedBy".equals(itemId) || "log.author".equals(itemId))) {
return VaadinUtility.labelWithIcon(getImage("/img/user_standard.png"), value, null, getMessagePrefixed(itemId.toString()));
}
return VaadinUtility.boldLabel(value);
}
return null;
}
});
}});
// being stupid is its own reward
taskTable.setHeight(22 * (taskDetailsPropertyNames.length - 2) + 50, Sizeable.UNITS_PIXELS);
Collection<Button> taskButtons = createTaskButtons(log);
HorizontalLayout buttons = VaadinUtility.horizontalLayout(Alignment.MIDDLE_LEFT, taskButtons.toArray(new Component[taskButtons.size()]));
detailsView.addComponent(buttons);
Table processTable = attachTitledTable(detailsView, "pi.details", processDetailsContainer, new Object[] {"title", "component"},
new HashMap<String, ColumnGenerator>() {{
put("component", new ColumnGenerator() {
private DateFormat dateFormat = VaadinUtility.simpleDateFormat();
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {
ProcessInstance pi = log.getProcessInstance();