public Component create(Map<String, Object> context) {
RepositoryObject object = getRepositoryObjectFromContext(context);
if (object instanceof StatefulTargetObject && !((StatefulTargetObject) object).isRegistered()) {
VerticalLayout result = new VerticalLayout();
result.setCaption(CAPTION);
result.addComponent(new Label("This target is not yet registered, so it has no log."));
return result;
}
Table table = new Table();
table.setWidth(FILL_AREA);
table.setHeight(FILL_AREA);
table.setCaption(CAPTION);
table.addContainerProperty(COL_TIME, Date.class, null);
table.addContainerProperty(COL_TYPE, String.class, null);
table.addContainerProperty(COL_PROPERTIES, TextArea.class, null);
table.setColumnExpandRatio(COL_PROPERTIES, 1);
try {
fillTable(object, table);
}
catch (IOException ex) {
m_logService.log(LogService.LOG_WARNING, "Log viewer failed!", ex);
}
return table;
}