/** * Gets the property Id collection from the container. * * @return the Collection of property ids. */ @Override public Collection<?> getContainerPropertyIds() { return items.getContainerPropertyIds(); }
@Override public Collection<?> getContainerPropertyIds() { return container.getContainerPropertyIds(); }
@Override public Collection<?> getContainerPropertyIds() { return container.getContainerPropertyIds(); }
/** * Removes a generated column previously added with addGeneratedColumn. * * @param columnId * id of the generated column to remove * @return true if the column could be removed (existed in the Table) */ public boolean removeGeneratedColumn(Object columnId) { if (columnGenerators.containsKey(columnId)) { columnGenerators.remove(columnId); // remove column from visibleColumns list unless it exists in // container (generator previously overrode this column) if (!items.getContainerPropertyIds().contains(columnId)) { visibleColumns.remove(columnId); } refreshRowCache(); return true; } else { return false; } }
visibleIds.addAll(newDataSource.getContainerPropertyIds()); } else { for (Object id : newDataSource.getContainerPropertyIds()) {
@Override public void containerPropertySetChange(PropertySetChangeEvent event) { Collection<?> properties = new HashSet<Object>( event.getContainer().getContainerPropertyIds());
.getContainerPropertyIds(); LinkedList<Object> retainableValueConverters = new LinkedList<Object>(); for (Object propertyId : newPropertyIds) {
@Override public void setEditable(boolean editable) { if (this.editable != editable) { this.editable = editable; component.disableContentBufferRefreshing(); EntityTableItems<E> entityTableSource = (EntityTableItems<E>) getItems(); if (entityTableSource != null) { com.vaadin.v7.data.Container ds = component.getContainerDataSource(); @SuppressWarnings("unchecked") Collection<MetaPropertyPath> propertyIds = (Collection<MetaPropertyPath>) ds.getContainerPropertyIds(); if (editable) { enableEditableColumns(entityTableSource, propertyIds); } else { disableEditableColumns(entityTableSource, propertyIds); } } component.setEditable(editable); component.enableContentBufferRefreshing(true); } }
protected void createColumns(com.vaadin.v7.data.Container ds) { @SuppressWarnings("unchecked") Collection<MetaPropertyPath> properties = (Collection<MetaPropertyPath>) ds.getContainerPropertyIds(); Window window = ComponentsHelper.getWindow(this); boolean isLookup = window != null && window.getFrameOwner() instanceof LookupScreen; for (MetaPropertyPath propertyPath : properties) { Table.Column column = columns.get(propertyPath); if (column != null && !(editable && column.isEditable())) { String isLink = column.getXmlDescriptor() == null ? null : column.getXmlDescriptor().attributeValue("link"); if (propertyPath.getRange().isClass()) { if (!isLookup && StringUtils.isNotEmpty(isLink)) { setClickListener(propertyPath.toString(), new LinkCellClickListener(this, applicationContext)); } } else if (propertyPath.getRange().isDatatype()) { if (!isLookup && !StringUtils.isEmpty(isLink)) { setClickListener(propertyPath.toString(), new LinkCellClickListener(this, applicationContext)); } else { if (column.getMaxTextLength() != null) { addGeneratedColumnInternal(propertyPath, new AbbreviatedColumnGenerator(column, dynamicAttributesTools)); setClickListener(propertyPath.toString(), new AbbreviatedCellClickListener(this, dynamicAttributesTools)); } } } else if (!propertyPath.getRange().isEnum()) { throw new UnsupportedOperationException(); } } } }
@Override public void setLookupSelectHandler(Consumer<Collection<E>> selectHandler) { Consumer<Action.ActionPerformedEvent> actionHandler = event -> { Set<E> selected = getSelected(); selectHandler.accept(selected); }; setEnterPressAction( new BaseAction(Window.Lookup.LOOKUP_ENTER_PRESSED_ACTION_ID) .withHandler(actionHandler) ); setItemClickAction( new BaseAction(Window.Lookup.LOOKUP_ITEM_CLICK_ACTION_ID) .withHandler(actionHandler) ); if (isEditable()) { EntityTableItems<E> entityTableSource = (EntityTableItems<E>) getItems(); com.vaadin.v7.data.Container ds = component.getContainerDataSource(); @SuppressWarnings("unchecked") Collection<MetaPropertyPath> propertyIds = (Collection<MetaPropertyPath>) ds.getContainerPropertyIds(); disableEditableColumns(entityTableSource, propertyIds); } if (buttonsPanel != null && !buttonsPanel.isAlwaysVisible()) { buttonsPanel.setVisible(false); } }