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.ViewportEventData
Nested 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, viewportRowSet
Fields 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 TypeMethodDescriptionvoid
close()
Stops this viewport from running, stopping all events on itself and on the table that created it.<T> void
void
<T> void
elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData>
elemental2.promise.Promise<@TsTypeRef(ViewportData.class) AbstractTableSubscription.UpdateEventData>
Gets the data currently visible in this viewportboolean
hasListeners
(String name) void
Internal API method to indicate that the Table itself has no further use for this.static TableViewportSubscription
make
(double firstRow, double lastRow, Column[] columns, Double updateIntervalMs, JsTable existingTable) protected void
notifyUpdate
(RangeSet rowsAdded, RangeSet rowsRemoved, RangeSet totalMods, ShiftedRange[] shifted) void
revive()
Creates the connection to the server.protected void
void
setInternalViewport
(double firstRow, double lastRow, Column[] columns, Double updateIntervalMs, Boolean isReverseViewport) void
setViewport
(double firstRow, double lastRow, @JsNullable Column[] columns, @JsNullable Double updateIntervalMs, @JsNullable Boolean isReverseViewport) Changes the rows and columns set on this viewport.elemental2.promise.Promise<TableData>
snapshot
(JsRangeSet rows, Column[] columns) Methods inherited from class io.deephaven.web.client.api.subscription.AbstractTableSubscription
connection, getColumns, hasValidSize, isClosed, isSubscriptionReady, makeColumnBitset, onStreamEnd, sendBarrageSubscriptionRequest, size, state, subscriptionRequest
Methods 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(double firstRow, double lastRow, Column[] columns, Double updateIntervalMs, JsTable existingTable) -
revive
public void revive()Description copied from class:AbstractTableSubscription
Creates the connection to the server. Used on initial connection, and for viewport reconnects.- Overrides:
revive
in classAbstractTableSubscription
-
sendFirstSubscriptionRequest
protected void sendFirstSubscriptionRequest()- Specified by:
sendFirstSubscriptionRequest
in classAbstractTableSubscription
-
fireEvent
- Overrides:
fireEvent
in classHasEventHandling
-
fireEvent
- Overrides:
fireEvent
in classHasEventHandling
-
fireEvent
- Overrides:
fireEvent
in classHasEventHandling
-
hasListeners
- Overrides:
hasListeners
in classHasEventHandling
-
setViewport
@JsMethod public void setViewport(double firstRow, double lastRow, @JsOptional @JsNullable Column[] columns, @JsOptional @JsNullable Double updateIntervalMs, @JsOptional @JsNullable Boolean isReverseViewport) Changes the rows and columns set on this viewport. This cannot be used to change the update interval.- Parameters:
firstRow
-lastRow
-columns
-updateIntervalMs
-
-
setInternalViewport
-
close
@JsMethod public void close()Stops this viewport from running, stopping all events on itself and on the table that created it.- Overrides:
close
in 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
-