Search in sources :

Example 1 with RelatedContentComponent

use of org.activiti.explorer.ui.content.RelatedContentComponent 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());
}
Also used : Item(com.vaadin.data.Item) AttachmentDetailPopupWindow(org.activiti.explorer.ui.content.AttachmentDetailPopupWindow) RelatedContentComponent(org.activiti.explorer.ui.content.RelatedContentComponent) Attachment(org.activiti.engine.task.Attachment) Embedded(com.vaadin.ui.Embedded) AttachmentRenderer(org.activiti.explorer.ui.content.AttachmentRenderer)

Aggregations

Item (com.vaadin.data.Item)1 Embedded (com.vaadin.ui.Embedded)1 Attachment (org.activiti.engine.task.Attachment)1 AttachmentDetailPopupWindow (org.activiti.explorer.ui.content.AttachmentDetailPopupWindow)1 AttachmentRenderer (org.activiti.explorer.ui.content.AttachmentRenderer)1 RelatedContentComponent (org.activiti.explorer.ui.content.RelatedContentComponent)1