@Override public void refreshAll() { fireEvent(new DataChangeEvent<>(this)); }
protected void datasourceItemSetChanged(TreeItems.ItemSetChangeEvent<T> event) { fireEvent(new DataChangeEvent<>(this)); eventsDelegate.treeSourceItemSetChanged(event); }
protected void datasourceItemSetChanged(DataGridItems.ItemSetChangeEvent<T> event) { fireEvent(new DataChangeEvent<>(this)); dataEventsDelegate.dataGridSourceItemSetChanged(event); }
@Override @Synchronized protected int sizeInBackEnd(Query<CardSummary, Void> query) { if (countQueryResult != null) { countQueryResult.cancel(); countQueryResult = null; } CountCardSummariesQuery countCardSummariesQuery = new CountCardSummariesQuery(filter); log.trace("submitting {}", countCardSummariesQuery); countQueryResult = queryGateway.subscriptionQuery(countCardSummariesQuery, ResponseTypes.instanceOf(CountCardSummariesResponse.class), ResponseTypes.instanceOf(CountChangedUpdate.class)); /* When the count changes (new giftcards issued), the UI has to do an entirely new query (this is * how the Vaadin grid works). When we're bulk issuing, it doesn't make sense to do that on every single * issue event. Therefore, we buffer the updates for 250 milliseconds using reactor, and do the new * query at most once per 250ms. */ countQueryResult.updates().buffer(Duration.ofMillis(250)).subscribe( countChanged -> { log.trace("processing query update for {}: {}", countCardSummariesQuery, countChanged); /* This won't do, would lead to immediate new queries, looping a few times. */ // fireEvent(new DataChangeEvent(this)); executorService.execute(() -> fireEvent(new DataChangeEvent<>(this))); }); return countQueryResult.initialResult().block().getCount(); }