/** * Toggles the details display.<p> */ void toggleDetails() { if (m_permissions.isVisible()) { m_permissions.setVisible(false); m_details.setIcon(FontAwesome.PLUS_SQUARE_O); } else { m_permissions.setVisible(true); m_details.setIcon(FontAwesome.MINUS_SQUARE_O); } m_changeHandler.onViewChange(); }
protected Table initRelatedContentTable() { Table table = new Table(); table.setWidth(100, UNITS_PERCENTAGE); table.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_LIST); // Invisible by default, only shown when attachments are present table.setVisible(false); table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); table.addContainerProperty("type", Embedded.class, null); table.setColumnWidth("type", 16); table.addContainerProperty("name", Component.class, null); relatedContentLayout.addComponent(table); return table; }
protected void initAttachmentTable() { contentLayout = new VerticalLayout(); addComponent(contentLayout); table = new Table(); table.setWidth(100, UNITS_PERCENTAGE); table.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_LIST); // Invisible by default, only shown when attachments are present table.setVisible(false); table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); addContainerProperties(); // Get the related content for this task refreshTaskAttachments(); contentLayout.addComponent(table); }
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()); }
public void refreshTaskAttachments() { table.removeAllItems(); if (noContentLabel != null) { contentLayout.removeComponent(noContentLabel); } List<Attachment> attachments = null; if (task.getProcessInstanceId() != null){ attachments = (taskService.getProcessInstanceAttachments(task.getProcessInstanceId())); } else { attachments = taskService.getTaskAttachments(task.getId()); } if(!attachments.isEmpty()) { addAttachmentsToTable(attachments); } else { table.setVisible(false); noContentLabel = new Label(i18nManager.getMessage(Messages.TASK_NO_RELATED_CONTENT)); noContentLabel.addStyleName(Reindeer.LABEL_SMALL); contentLayout.addComponent(noContentLabel); } }
protected void initEventsTable() { eventTable = new Table(); eventTable.setVisible(false); eventTable.setWidth(100, UNITS_PERCENTAGE); eventTable.setHeight(250, UNITS_PIXELS); eventTable.setEditable(false); eventTable.setImmediate(true); eventTable.setSelectable(true); eventTable.setSortDisabled(false); eventTable.addContainerProperty("type", String.class, null, i18nManager.getMessage(Messages.CRYSTALBALL_EVENT_TYPE), null, Table.ALIGN_LEFT); eventTable.addContainerProperty("executed", String.class, null, i18nManager.getMessage(Messages.CRYSTALBALL_EVENT_EXECUTED), null, Table.ALIGN_LEFT); eventLayout.addComponent(eventTable); }
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()); }
protected void fillEventValues() { for (SimulationEvent originalEvent : simulationEvents) { boolean executed = true; if (SimulationRunContext.getEventCalendar() != null && SimulationRunContext.getEventCalendar().getEvents() != null) { for (SimulationEvent event : SimulationRunContext.getEventCalendar().getEvents()) { if (originalEvent.equals(event)) { executed = false; stepButton.setEnabled(true); break; } } } Object itemId = eventTable.addItem(); eventTable.getItem(itemId).getItemProperty("type").setValue(originalEvent.getType()); eventTable.getItem(itemId).getItemProperty("executed").setValue(executed); } if (replayHistoricInstance != null && replayHistoricInstance.getId() != null) { ProcessInstance testInstance = runtimeService.createProcessInstanceQuery().processInstanceId(replayHistoricInstance.getId()).singleResult(); if (testInstance != null) { showProcessInstanceButton.setCaption(i18nManager.getMessage( Messages.TASK_PART_OF_PROCESS, definitionMap.get(replayHistoricInstance.getProcessDefinitionId()))); showProcessInstanceButton.setVisible(true); } } eventTable.setVisible(true); }