Class TableViewportSubscription
java.lang.Object
io.deephaven.web.client.api.event.HasEventHandling
io.deephaven.web.client.api.subscription.AbstractTableSubscription
io.deephaven.web.client.api.subscription.TableViewportSubscription
This object serves as a "handle" to a subscription, allowing it to be acted on directly or canceled outright. If you
retain an instance of this, you have two choices - either only use it to call `close()` on it to stop the table's
viewport without creating a new one, or listen directly to this object instead of the table for data events, and
always call `close()` when finished. Calling any method on this object other than close() will result in it
continuing to live on after `setViewport` is called on the original table, or after the table is modified.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.web.client.api.subscription.AbstractTableSubscription
AbstractTableSubscription.Status, AbstractTableSubscription.SubscriptionEventData, AbstractTableSubscription.SubscriptionRow, AbstractTableSubscription.UpdateEventData, AbstractTableSubscription.ViewportEventDataNested classes/interfaces inherited from class io.deephaven.web.client.api.event.HasEventHandling
HasEventHandling.EventPair<T> -
Field Summary
Fields inherited from class io.deephaven.web.client.api.subscription.AbstractTableSubscription
barrageSubscription, EVENT_UPDATED, rowStyleColumn, status, viewportRowSetFields inherited from class io.deephaven.web.client.api.event.HasEventHandling
INTERNAL_EVENT_RELEASED -
Constructor Summary
ConstructorsConstructorDescriptionTableViewportSubscription(ClientTableState state, WorkerConnection connection, JsTable existingTable) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops this viewport from running, stopping all events on itself and on the table that created it.<T> voidvoid<T> voidelemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData>elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData>Gets the data currently visible in this viewportbooleanhasListeners(String name) voidInternal API method to indicate that the Table itself has no further use for this.static TableViewportSubscriptionmake(DataOptions.ViewportSubscriptionOptions options, JsTable jsTable) protected voidnotifyUpdate(RangeSet rowsAdded, RangeSet rowsRemoved, RangeSet totalMods, ShiftedRange[] shifted) voidrevive()Creates the connection to the server.protected voidvoidvoidsetInternalViewport(RangeSet rows, Column[] columns, Double updateIntervalMs, Boolean isReverseViewport) voidsetViewport(double firstRow, double lastRow, @JsNullable Column[] columns, @JsNullable Double updateIntervalMs, @JsNullable Boolean isReverseViewport) Deprecated.elemental2.promise.Promise<TableData>snapshot(JsRangeSet rows, Column[] columns) Deprecated.UseJsTable.createSnapshot(Object)insteadvoidupdate(@TsTypeRef(ViewportSubscriptionOptions.class) Object options) Update the options for this viewport subscription.Methods inherited from class io.deephaven.web.client.api.subscription.AbstractTableSubscription
connection, createPreview, getColumns, getPreviewListLengthLimit, hasValidSize, isClosed, isSubscriptionReady, makeColumnBitset, onStreamEnd, sendBarrageSubscriptionRequest, size, state, subscriptionRequestMethods inherited from class io.deephaven.web.client.api.event.HasEventHandling
addEventListener, addEventListenerOneShot, addEventListenerOneShot, failureHandled, fireCriticalEvent, fireCriticalEvent, hasListener, isSuppress, logPrefix, nextEvent, removeEventListener, suppressEvents, unsuppressEvents
-
Constructor Details
-
TableViewportSubscription
public TableViewportSubscription(ClientTableState state, WorkerConnection connection, JsTable existingTable)
-
-
Method Details
-
make
public static TableViewportSubscription make(DataOptions.ViewportSubscriptionOptions options, JsTable jsTable) -
revive
public void revive()Description copied from class:AbstractTableSubscriptionCreates the connection to the server. Used on initial connection, and for viewport reconnects.- Overrides:
revivein classAbstractTableSubscription
-
sendFirstSubscriptionRequest
protected void sendFirstSubscriptionRequest()- Specified by:
sendFirstSubscriptionRequestin classAbstractTableSubscription
-
fireEvent
- Overrides:
fireEventin classHasEventHandling
-
fireEvent
- Overrides:
fireEventin classHasEventHandling
-
fireEvent
- Overrides:
fireEventin classHasEventHandling
-
hasListeners
- Overrides:
hasListenersin classHasEventHandling
-
setViewport
@JsMethod public void setViewport(double firstRow, double lastRow, @JsOptional @JsNullable Column[] columns, @JsOptional @JsNullable Double updateIntervalMs, @JsOptional @JsNullable Boolean isReverseViewport) Deprecated.useupdate(Object)insteadChanges the rows and columns set on this viewport. This cannot be used to change the update interval.- Parameters:
firstRow-lastRow-columns-updateIntervalMs-
-
update
@JsMethod public void update(@TsTypeRef(ViewportSubscriptionOptions.class) @TsTypeRef(ViewportSubscriptionOptions.class) Object options) Update the options for this viewport subscription. This cannot alter the update interval or preview options.- Parameters:
options- the subscription options
-
setInternalViewport
-
close
@JsMethod public void close()Stops this viewport from running, stopping all events on itself and on the table that created it.- Overrides:
closein classAbstractTableSubscription
-
internalClose
public void internalClose()Internal API method to indicate that the Table itself has no further use for this. The subscription should stop forwarding events and optionally close the underlying table/subscription. -
getViewportData
@JsMethod public elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData> getViewportData()Gets the data currently visible in this viewport- Returns:
- Promise of
TableData.
-
getInternalViewportData
public elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData> getInternalViewportData() -
snapshot
@JsMethod @Deprecated public elemental2.promise.Promise<TableData> snapshot(JsRangeSet rows, Column[] columns) Deprecated.UseJsTable.createSnapshot(Object)instead
-
update(Object)instead