use of org.activiti.explorer.ui.content.AttachmentRenderer in project Activiti by Activiti.
the class TaskRelatedContentComponent method addAttachmentsToTable.
protected void addAttachmentsToTable(List<Attachment> attachments) {
for (Attachment attachment : attachments) {
AttachmentRenderer renderer = attachmentRendererManager.getRenderer(attachment);
Item attachmentItem = table.addItem(attachment.getId());
attachmentItem.getItemProperty("name").setValue(renderer.getOverviewComponent(attachment, this));
attachmentItem.getItemProperty("type").setValue(new Embedded(null, renderer.getImage(attachment)));
Embedded deleteButton = new Embedded(null, Images.DELETE);
deleteButton.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
deleteButton.addListener((ClickListener) new DeleteClickedListener(attachment));
attachmentItem.getItemProperty("delete").setValue(deleteButton);
}
if (!table.getItemIds().isEmpty()) {
table.setVisible(true);
}
table.setPageLength(table.size());
}
use of org.activiti.explorer.ui.content.AttachmentRenderer in project Activiti by Activiti.
the class HistoricTaskDetailPanel method populateRelatedContent.
protected void populateRelatedContent(Table table, List<Attachment> attachments) {
if (!attachments.isEmpty()) {
table.setVisible(true);
}
for (Attachment attachment : attachments) {
AttachmentRenderer renderer = attachmentRendererManager.getRenderer(attachment);
Item attachmentItem = table.addItem(attachment.getId());
// Simple renderer that just shows a popup window with the attachment
RelatedContentComponent relatedContentComponent = new RelatedContentComponent() {
public void showAttachmentDetail(Attachment attachment) {
AttachmentDetailPopupWindow popup = new AttachmentDetailPopupWindow(attachment);
ExplorerApp.get().getViewManager().showPopupWindow(popup);
}
};
attachmentItem.getItemProperty("name").setValue(renderer.getOverviewComponent(attachment, relatedContentComponent));
attachmentItem.getItemProperty("type").setValue(new Embedded(null, renderer.getImage(attachment)));
}
table.setPageLength(table.size());
}
Aggregations