@Override public Hierarchical getContainerDataSource() { return (Hierarchical) super.getContainerDataSource(); }
public SelectableBeanItemContainer<T> getContainerDataSource() { return (SelectableBeanItemContainer<T>) super.getContainerDataSource(); }
private boolean isContainerInitialized() { return table.getContainerDataSource() instanceof ListContainer; }
/** * Gets the container property IDs, which can be used to sort the item. * <p> * Note that the {@link #isSortEnabled()} state affects what this method * returns. Disabling sorting causes this method to always return an empty * collection. * </p> * * @see Container.Sortable#getSortableContainerPropertyIds() */ @Override public Collection<?> getSortableContainerPropertyIds() { final Container c = getContainerDataSource(); if (c instanceof Container.Sortable && isSortEnabled()) { return ((Container.Sortable) c).getSortableContainerPropertyIds(); } else { return Collections.EMPTY_LIST; } }
private void paintSorting(PaintTarget target) throws PaintException { // Sorting if (getContainerDataSource() instanceof Container.Sortable) { target.addVariable(this, "sortcolumn", columnIdMap.key(sortContainerPropertyId)); target.addVariable(this, "sortascending", sortAscending); } }
Collection<?> containerPropertyIds = getContainerDataSource() .getContainerPropertyIds();
@Override public void removeColumn(Table.Column column) { if (column == null) { return; } component.removeContainerProperty(column.getId()); columns.remove(column.getId()); columnsOrder.remove(column); // vaadin8 it seems that it is not required if (!(component.getContainerDataSource() instanceof com.vaadin.v7.data.Container.ItemSetChangeNotifier)) { component.refreshRowCache(); } column.setOwner(null); }
if (isEditable() && fieldFactory != null) { final Field<?> f = fieldFactory .createField(getContainerDataSource(), rowId, colId, this); if (f != null) {
@Override public void textChange(FieldEvents.TextChangeEvent event) { Container.Filterable f = (Container.Filterable) table.getContainerDataSource(); if (filter != null) { f.removeContainerFilter(filter); } filter = new SimpleStringFilter(i18n.translate("activationMonitor.activationLog.user.label"), event.getText(), true, false); f.addContainerFilter(filter); } });
public void sort(Object[] propertyId, boolean[] ascending) throws UnsupportedOperationException { final Container c = getContainerDataSource(); if (c instanceof Container.Sortable) { final int pageIndex = getCurrentPageFirstItemIndex();
@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); } }
@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); } }
createColumns(component.getContainerDataSource());