/** * Sets the {@link Comparator} to use with in-memory sorting. * * @param comparator * comparator used to sort data */ public void setInMemorySorting(Comparator<T> comparator) { inMemorySorting = comparator; reset(); }
/** * Sets the {@link QuerySortOrder}s to use with backend sorting. * * @param sortOrder * list of sort order information to pass to a query */ public void setBackEndSorting(List<QuerySortOrder> sortOrder) { backEndSorting.clear(); backEndSorting.addAll(sortOrder); reset(); }
/** * Adds a data generator to this data communicator. Data generators can be * used to insert custom data to the rows sent to the client. If the data * generator is already added, does nothing. * * @param generator * the data generator to add, not null */ public void addDataGenerator(DataGenerator<T> generator) { Objects.requireNonNull(generator, "generator cannot be null"); generators.add(generator); // Make sure data gets generated when adding data generators. reset(); }
/** * Sets the item caption generator that is used to produce the strings shown * in the combo box for each item. By default, * {@link String#valueOf(Object)} is used. * * @param itemCaptionGenerator * the item caption provider to use, not null */ protected void setItemCaptionGenerator( ItemCaptionGenerator<T> itemCaptionGenerator) { Objects.requireNonNull(itemCaptionGenerator, "Item caption generators must not be null"); this.itemCaptionGenerator = itemCaptionGenerator; getDataCommunicator().reset(); }
/** * Sets the style generator that is used to produce custom class names for * items visible in the popup. The CSS class name that will be added to the * item is <tt>v-filterselect-item-[style name]</tt>. Returning null from * the generator results in no custom style name being set. * * @see StyleGenerator * * @param itemStyleGenerator * the item style generator to set, not null * @throws NullPointerException * if {@code itemStyleGenerator} is {@code null} * @since 8.0 */ public void setStyleGenerator(StyleGenerator<T> itemStyleGenerator) { Objects.requireNonNull(itemStyleGenerator, "Item style generator must not be null"); this.itemStyleGenerator = itemStyleGenerator; getDataCommunicator().reset(); }
/** * Sets the item icon generator that is used to produce custom icons for * shown items. The generator can return null for items with no icon. * <p> * Implementations that support item icons make this method public. * * @see IconGenerator * * @param itemIconGenerator * the item icon generator to set, not null * @throws NullPointerException * if {@code itemIconGenerator} is {@code null} */ protected void setItemIconGenerator(IconGenerator<T> itemIconGenerator) { Objects.requireNonNull(itemIconGenerator, "Item icon generator must not be null"); this.itemIconGenerator = itemIconGenerator; getDataCommunicator().reset(); }
/** * Sets the style generator that is used for generating class names for rows * in this grid. Returning null from the generator results in no custom * style name being set. * * Note: The style generator is applied only to the body cells, not to the * Editor. * * @see StyleGenerator * * @param styleGenerator * the row style generator to set, not null * @throws NullPointerException * if {@code styleGenerator} is {@code null} */ public void setStyleGenerator(StyleGenerator<T> styleGenerator) { Objects.requireNonNull(styleGenerator, "Style generator must not be null"); this.styleGenerator = styleGenerator; getDataCommunicator().reset(); }
/** * Sets the description generator that is used for generating descriptions * for rows. This method uses the given content mode. * * @see #setDescriptionGenerator(DescriptionGenerator) * * @param descriptionGenerator * the row description generator to set, or {@code null} to * remove a previously set generator * @param contentMode * the content mode for row tooltips * * @since 8.2 */ public void setDescriptionGenerator( DescriptionGenerator<T> descriptionGenerator, ContentMode contentMode) { Objects.requireNonNull(contentMode, "contentMode cannot be null"); this.descriptionGenerator = descriptionGenerator; getState().rowDescriptionContentMode = contentMode; getDataCommunicator().reset(); }
/** * Sets the style generator that is used for generating class names for * cells in this column. Returning null from the generator results in no * custom style name being set. * * Note: The style generator is applied only to the body cells, not to * the Editor. * * @param cellStyleGenerator * the cell style generator to set, not null * @return this column * @throws NullPointerException * if {@code cellStyleGenerator} is {@code null} */ public Column<T, V> setStyleGenerator( StyleGenerator<T> cellStyleGenerator) { Objects.requireNonNull(cellStyleGenerator, "Cell style generator must not be null"); this.styleGenerator = cellStyleGenerator; getGrid().getDataCommunicator().reset(); return this; }
private void updateSelection(SerializableConsumer<Collection<T>> handler, boolean userOriginated) { LinkedHashSet<T> oldSelection = new LinkedHashSet<>(selection); handler.accept(selection); fireEvent(new MultiSelectionEvent<>(AbstractMultiSelect.this, oldSelection, userOriginated)); getDataCommunicator().reset(); }
/** * Sets the description generator that is used for generating * descriptions for cells in this column. This method uses the given * content mode. * * @see #setDescriptionGenerator(DescriptionGenerator) * * @param cellDescriptionGenerator * the cell description generator to set, or {@code null} to * remove a previously set generator * @param tooltipContentMode * the content mode for tooltips * @return this column * * @since 8.2 */ public Column<T, V> setDescriptionGenerator( DescriptionGenerator<T> cellDescriptionGenerator, ContentMode tooltipContentMode) { this.descriptionGenerator = cellDescriptionGenerator; getState().tooltipContentMode = tooltipContentMode; getGrid().getDataCommunicator().reset(); return this; }
getGrid().getDataCommunicator().reset();
@Override public void repaint() { markAsDirtyRecursive(); getDataCommunicator().reset(); }