/** * Selects all resources.<p> */ public void selectAll() { m_fileTable.setValue(m_fileTable.getItemIds()); }
@SuppressWarnings("unchecked") public Collection<String> getSelectedUserIds() { if (!multiSelect) { throw new ActivitiException("Only use getSelectedUserIds in multiselect mode"); } return (Collection<String>) selectedUsersTable.getItemIds(); }
public Set<Integer> getSelectedIds(Table source) { if (m_selectAll) { Set<Integer> selected = new TreeSet<Integer>(); for (Object eachItemId : source.getItemIds()) { Property<Integer> property = source.getContainerProperty(eachItemId, m_valueProperty); if (property == null) continue; selected.add(property.getValue()); } //remove unselected selected.removeAll(m_notSelectedCheckboxes); return selected; } return Collections.unmodifiableSet(m_selectedCheckboxes); }
@Override public void buttonClick(Button.ClickEvent clickEvent) { getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, rowsTable.getItemIds(), (RowDef) rowsTable.getValue(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() { @Override public void save(Def def) { RowDef rowToBeReplaced = (RowDef) rowsTable.getValue(); int index = rowOrder.get(rowToBeReplaced); rows.removeItem(rowToBeReplaced); rowOrder.remove(rowToBeReplaced); rows.addItem((RowDef) def); rowOrder.put((RowDef) def, index); rows.sort(new Object[]{"label"}, new boolean[]{true}); rowsTable.refreshRowCache(); } })); } });
@Override public void buttonClick(Button.ClickEvent clickEvent) { getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, columnsTable.getItemIds(), (ColumnDef) columnsTable.getValue(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() { @Override public void save(Def def) { ColumnDef columnToBeReplaced = (ColumnDef) columnsTable.getValue(); int index = columnOrder.get(columnToBeReplaced); columns.removeItem(columnToBeReplaced); columnOrder.remove(columnToBeReplaced); columns.addItem((ColumnDef) def); columnOrder.put((ColumnDef) def, index); columns.sort(new Object[]{"label"}, new boolean[]{true}); columnsTable.refreshRowCache(); } })); } });
@Override public void buttonClick(Button.ClickEvent clickEvent) { getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, columnsTable.getItemIds(), new ColumnDef(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() { @Override public void save(Def def) { columns.addItem((ColumnDef) def); columnOrder.put((ColumnDef) def, columnOrder.size()); columns.sort(new Object[]{"label"}, new boolean[]{true}); columnsTable.refreshRowCache(); } })); } });
List<ArtifactObject> added = new ArrayList<ArtifactObject>(); for (Object id : artifacts.getItemIds()) { if (artifacts.isSelected(id)) { for (OBREntry e : m_obrList) {
@Override public void buttonClick(Button.ClickEvent clickEvent) { getUI().addWindow(new SurveillanceViewConfigurationCategoryWindow(surveillanceViewService, rowsTable.getItemIds(), new RowDef(), new SurveillanceViewConfigurationCategoryWindow.SaveActionListener() { @Override public void save(Def def) { rows.addItem((RowDef) def); rowOrder.put((RowDef) def, rowOrder.size()); rows.sort(new Object[]{"label"}, new boolean[]{true}); rowsTable.refreshRowCache(); } })); } });
if(modules.getItemIds().size() > 0) for(Object module: modules.getItemIds()) if(flows.getItemIds().size() > 0) for(Object flow: flows.getItemIds()) if(components.getItemIds().size() > 0 && modules.getItemIds().size() == 0 && flows.getItemIds().size() == 0) for(Object component: components.getItemIds())
@SuppressWarnings("unchecked") private void updateDistributionSetType(final DistributionSetType existingType) { final List<Long> itemIds = (List<Long>) getTwinTables().getSelectedTable().getItemIds(); final DistributionSetTypeUpdate update = getEntityFactory().distributionSetType().update(existingType.getId()) .description(getTagDesc().getValue()) .colour(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())); if (distributionSetManagement.countByTypeId(existingType.getId()) <= 0 && !CollectionUtils.isEmpty(itemIds)) { update.mandatory(itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isMandatoryModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList())) .optional(itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isOptionalModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList())); } final DistributionSetType updateDistSetType = getDistributionSetTypeManagement().update(update); getUiNotification().displaySuccess(getI18n().getMessage("message.update.success", updateDistSetType.getName())); getEventBus().publish(this, new DistributionSetTypeEvent(DistributionSetTypeEnum.UPDATE_DIST_SET_TYPE, updateDistSetType)); }
@SuppressWarnings("unchecked") private void updateDistributionSetType(final DistributionSetType existingType) { final List<Long> itemIds = (List<Long>) getTwinTables().getSelectedTable().getItemIds(); final DistributionSetTypeUpdate update = getEntityFactory().distributionSetType().update(existingType.getId()) .description(getTagDesc().getValue()) .colour(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())); if (distributionSetManagement.countByTypeId(existingType.getId()) <= 0 && !CollectionUtils.isEmpty(itemIds)) { update.mandatory(itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isMandatoryModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList())) .optional(itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isOptionalModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList())); } final DistributionSetType updateDistSetType = getDistributionSetTypeManagement().update(update); getUiNotification().displaySuccess(getI18n().getMessage("message.update.success", updateDistSetType.getName())); getEventBus().publish(this, new DistributionSetTypeEvent(DistributionSetTypeEnum.UPDATE_DIST_SET_TYPE, updateDistSetType)); }
if(modules.getItemIds().size() > 0) for(Object module: modules.getItemIds()) if(flows.getItemIds().size() > 0) for(Object flow: flows.getItemIds())
public void buttonClick(ClickEvent event) { Collection<BusinessStreamFlow> businessStreamFlows = (Collection<BusinessStreamFlow>)businessStreamTable.getItemIds(); for(BusinessStreamFlow businessStreamFlow: businessStreamFlows) { topologyService.deleteBusinessStreamFlow(businessStreamFlow); } BusinessStream businessStream = (BusinessStream)businessStreamCombo.getValue(); topologyService.deleteBusinessStream(businessStream); businessStreamTable.removeAllItems(); List<BusinessStream> businessStreams = topologyService.getAllBusinessStreams(); businessStreamCombo.removeItem(businessStream); descriptionTextArea.setReadOnly(false); descriptionTextArea.setValue(""); descriptionTextArea.setReadOnly(true); } });
@SuppressWarnings("unchecked") private void createNewDistributionSetType() { final String colorPicked = ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview()); final String typeNameValue = getTagName().getValue(); final String typeKeyValue = getTypeKey().getValue(); final String typeDescValue = getTagDesc().getValue(); final List<Long> itemIds = (List<Long>) getTwinTables().getSelectedTable().getItemIds(); if (typeNameValue != null && typeKeyValue != null && !CollectionUtils.isEmpty(itemIds)) { final List<Long> mandatory = itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isMandatoryModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList()); final List<Long> optional = itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isOptionalModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList()); final DistributionSetType newDistType = getDistributionSetTypeManagement() .create(getEntityFactory().distributionSetType().create().key(typeKeyValue).name(typeNameValue) .description(typeDescValue).colour(colorPicked).mandatory(mandatory).optional(optional)); getUiNotification().displaySuccess(getI18n().getMessage("message.save.success", newDistType.getName())); getEventBus().publish(this, new DistributionSetTypeEvent(DistributionSetTypeEnum.ADD_DIST_SET_TYPE, newDistType)); } else { getUiNotification().displayValidationError(getI18n().getMessage("message.error.missing.typenameorkey")); } }
@SuppressWarnings("unchecked") private void createNewDistributionSetType() { final String colorPicked = ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview()); final String typeNameValue = getTagName().getValue(); final String typeKeyValue = getTypeKey().getValue(); final String typeDescValue = getTagDesc().getValue(); final List<Long> itemIds = (List<Long>) getTwinTables().getSelectedTable().getItemIds(); if (typeNameValue != null && typeKeyValue != null && !CollectionUtils.isEmpty(itemIds)) { final List<Long> mandatory = itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isMandatoryModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList()); final List<Long> optional = itemIds.stream() .filter(itemId -> DistributionSetTypeSoftwareModuleSelectLayout .isOptionalModuleType(getTwinTables().getSelectedTable().getItem(itemId))) .collect(Collectors.toList()); final DistributionSetType newDistType = getDistributionSetTypeManagement() .create(getEntityFactory().distributionSetType().create().key(typeKeyValue).name(typeNameValue) .description(typeDescValue).colour(colorPicked).mandatory(mandatory).optional(optional)); getUiNotification().displaySuccess(getI18n().getMessage("message.save.success", newDistType.getName())); getEventBus().publish(this, new DistributionSetTypeEvent(DistributionSetTypeEnum.ADD_DIST_SET_TYPE, newDistType)); } else { getUiNotification().displayValidationError(getI18n().getMessage("message.error.missing.typenameorkey")); } }
if(modules.getItemIds().size() > 0) for(Object module: modules.getItemIds()) if(flows.getItemIds().size() > 0) for(Object flow: flows.getItemIds())
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()); }
if(components.getItemIds().size() > 0) componentSet.addAll((Collection<? extends Component>)components.getItemIds());
layout.addComponent(table); Object first = table.getItemIds().iterator().next(); Item item = table.getItem(first); form.setItemDataSource(item);
final BusinessStreamFlow businessStreamFlow = new BusinessStreamFlow(key); businessStreamFlow.setFlow(flow); businessStreamFlow.setOrder(businessStreamTable.getItemIds().size()); final BusinessStreamFlow businessStreamFlow = new BusinessStreamFlow(key); businessStreamFlow.setFlow(flow); businessStreamFlow.setOrder(businessStreamTable.getItemIds().size());