public Object addTo(Table table) { m_id = table.addItem(new Object[] { m_keyField, m_valueField }, null); return m_id; }
protected final void addItem(Table table, String label, String value) { if (value != null && !"".equals(value)) { table.addItem(new Object[] { label, value }, null); } }
protected final void addItem(Table table, String label, Enum<?> value) { if (value != null) { table.addItem(new Object[] { label, value.name() }, null); } }
protected final void addItem(Table table, String label, Long value) { if (value != null && value.longValue() >= 0) { table.addItem(new Object[] { label, value }, null); } }
private void loadProperties() { try { for (Properties properties : getActiveProperties()) { properties.entrySet().forEach(e -> { // System.out.println(e.getKey() + " | " + e.getValue()); tbl.addItem(new Object[] { e.getKey(), e.getValue() }, e.getKey()); }); } } catch (UnsupportedOperationException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
private void updateRoleChangedEvents() { ArrayList<String> subjects = new ArrayList<String>(); subjects.add(SystemEventConstants.DASHBOARD_USER_ROLE_CHANGED_CONSTANTS); List<SystemEvent> events = this.systemEventService.listSystemEvents(subjects, user.getUsername(), null, null); for(SystemEvent systemEvent: events) { SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy HH:mm:ss"); String date = dateFormat.format(systemEvent.getTimestamp()); this.permissionChangeTable.addItem(new Object[] { systemEvent.getAction(), date}, systemEvent); } }
/** * Inserts inital user data into the user table */ private void populateUserTable() { m_userTable.removeAllItems(); List<UserDTO> data = m_userUtil.getData(); for (UserDTO userDTO : data) { m_userTable.addItem(new Object[] { userDTO }, userDTO); } }
public void uploadSucceeded(SucceededEvent event) { try { URL artifact = m_file.toURI().toURL(); Item item = uploadedArtifacts.addItem(artifact); item.getItemProperty("symbolic name").setValue(m_file.getName()); item.getItemProperty("version").setValue(""); m_uploadedArtifacts.add(m_file); } catch (IOException e) { getMainWindow().showNotification( "Upload artifact processing failed", "<br />Reason: " + e.getMessage(), Notification.TYPE_ERROR_MESSAGE); m_log.log(LogService.LOG_ERROR, "Processing of " + m_file.getAbsolutePath() + " failed.", e); } } });
/** * @param icon The 16x16 icon that will be displayed on the left in the selection table. * @param name The name that will be shown in the selection table * @param component The component that is selected when the item in the selection table is clicked. * @param clickListener The listener that will be attached to the OK button displayed beneath * the component. */ public void addSelectionItem(Embedded icon, String name, Component component, ClickListener clickListener) { Item item = selectionTable.addItem(name); item.getItemProperty("type").setValue(icon); item.getItemProperty("name").setValue(name); components.put(name, component); listeners.put(name, clickListener); }
protected void addMatchingUser(String userId, String name) { if (!matchingUsersTable.containsId(userId)) { Item item = matchingUsersTable.addItem(userId); item.getItemProperty("userName").setValue(name); } }
protected void populateTableList() { TreeMap<String, Long> tables = new TreeMap<String, Long>(managementService.getTableCount()); // treemap because we want to sort it on name for (String tableName : tables.keySet()) { Item item = table.addItem(tableName); item.getItemProperty("icon").setValue(determineTableIcon(tableName)); item.getItemProperty("tableName").setValue(tableName + " (" + tables.get(tableName) + ")"); } }
public void buttonClick(ClickEvent event) { List<BusinessStream> businessStreams = topologyService.getAllBusinessStreams(); resultsTable.removeAllItems(); for(BusinessStream businessStream: businessStreams) { resultsTable.addItem(new Object[]{businessStream.getName(), businessStream.getDescription()}, businessStream); } } });
protected void refreshInstancesTable() { instancesTable.removeAllItems(); for (HistoricProcessInstance instance : selectedManagementDefinition.runningInstances) { instancesTable.addItem(new String[]{instance.getId(), instance.getBusinessKey(), instance.getStartUserId(), instance.getStartActivityId(), instance.getStartTime().toString()}, instance.getId()); } }
protected void refreshInstancesTable() { instancesTable.removeAllItems(); for (HistoricProcessInstance instance : selectedManagementDefinition.runningInstances) { instancesTable.addItem(new String[]{instance.getId(), instance.getBusinessKey(), instance.getStartUserId(), instance.getStartActivityId(), instance.getStartTime().toString(), instance.getEndTime() != null ? instance.getEndTime().toString() : "", instance.getDurationInMillis() != null ? instance.getDurationInMillis().toString() : ""}, instance.getId()); } }
protected void fillInstanceValues() { for (HistoricProcessInstance processInstance : instanceList) { ProcessDefinition definition = definitionMap.get(processInstance.getProcessDefinitionId()); String definitionName = ""; if (definition != null) { if (definition.getName() != null) { definitionName = definition.getName(); } else { definitionName = definition.getId(); } definitionName += " (v" + definition.getVersion() + ")"; } instanceTable.addItem(new String[]{ processInstance.getId(), definitionName, processInstance.getStartTime().toString(), processInstance.getEndTime() != null ? processInstance.getEndTime().toString() : ""}, processInstance.getId()); } }
protected void addComponent(final Component component) { Button deleteButton = new Button(); deleteButton.setIcon(VaadinIcons.TRASH); deleteButton.addStyleName(ValoTheme.BUTTON_BORDERLESS); deleteButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY); // Add the delete functionality to each role that is added deleteButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { components.removeItem(component); } }); components.addItem(new Object[]{component.getName(), deleteButton}, component); }
public void click(com.vaadin.event.MouseEvents.ClickEvent event) { Object itemId = ((Embedded) event.getSource()).getData(); // Add to left table (if possible) String searchFieldValue = (String) searchField.getValue(); if (searchFieldValue != null && searchFieldValue.length() >= 2) { String userName = (String) selectedUsersTable.getItem(itemId).getItemProperty("userName").getValue(); if (matchesSearchField(userName)) { Item item = matchingUsersTable.addItem(itemId); item.getItemProperty("userName").setValue(userName); } } // Delete from right table selectedUsersTable.removeItem(itemId); } }));
protected void selectUser(String userId, String userName) { if (!selectedUsersTable.containsId(userId)) { Item item = selectedUsersTable.addItem(userId); item.getItemProperty("userName").setValue(userName); if (showRoles) { ComboBox comboBox = new ComboBox(null, Arrays.asList( i18nManager.getMessage(Messages.TASK_ROLE_CONTRIBUTOR), i18nManager.getMessage(Messages.TASK_ROLE_IMPLEMENTER), i18nManager.getMessage(Messages.TASK_ROLE_MANAGER), i18nManager.getMessage(Messages.TASK_ROLE_SPONSOR))); comboBox.select(i18nManager.getMessage(Messages.TASK_ROLE_CONTRIBUTOR)); comboBox.setNewItemsAllowed(true); item.getItemProperty("role").setValue(comboBox); } } }
private void populateArtifactTable(Table artifactsTable) { for (ArtifactObject rp : getArtifactRepository().getResourceProcessors()) { String bsn = rp.getAttribute(Constants.BUNDLE_SYMBOLICNAME); Item item = artifactsTable.addItem(rp.getDefinition()); item.getItemProperty(PROPERTY_SYMBOLIC_NAME).setValue(bsn); item.getItemProperty(PROPERTY_VERSION).setValue(rp.getAttribute(Constants.BUNDLE_VERSION)); item.getItemProperty(PROPERTY_REMOVE).setValue(createRemoveButton(rp)); } }
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()); }