Class IdeSession


@JsType(namespace="dh") public class IdeSession extends HasEventHandling
  • Field Details

  • Constructor Details

  • Method Details

    • getTable

      public elemental2.promise.Promise<JsTable> getTable(String name, @JsOptional Boolean applyPreviewColumns)
      Load the named table, with columns and size information already fully populated.
      Parameters:
      name -
      applyPreviewColumns - optional boolean
      Returns:
      Promise of JsTable
    • getFigure

      public elemental2.promise.Promise<JsFigure> getFigure(String name)
      Load the named Figure, including its tables and tablemaps as needed.
      Parameters:
      name -
      Returns:
      promise of dh.plot.Figure
    • getTreeTable

      public elemental2.promise.Promise<JsTreeTable> getTreeTable(String name)
      Loads the named tree table or roll-up table, with column data populated. All nodes are collapsed by default, and size is presently not available until the viewport is first set.
      Parameters:
      name -
      Returns:
      Promise of JsTreeTable
    • getHierarchicalTable

      public elemental2.promise.Promise<JsTreeTable> getHierarchicalTable(String name)
    • getPartitionedTable

      public elemental2.promise.Promise<JsPartitionedTable> getPartitionedTable(String name)
    • getObject

      public elemental2.promise.Promise<?> getObject(@TsTypeRef(JsVariableDescriptor.class) @TsTypeRef(JsVariableDescriptor.class) jsinterop.base.JsPropertyMap<Object> definitionObject)
    • newTable

      public elemental2.promise.Promise<JsTable> newTable(String[] columnNames, String[] types, String[][] data, String userTimeZone)
    • mergeTables

      public elemental2.promise.Promise<JsTable> mergeTables(JsTable[] tables)
      Merges the given tables into a single table. Assumes all tables have the same structure.
      Parameters:
      tables -
      Returns:
      Promise of JsTable
    • bindTableToVariable

      public elemental2.promise.Promise<Void> bindTableToVariable(JsTable table, String name)
    • shareObject

      public elemental2.promise.Promise<SharedExportBytesUnion> shareObject(ServerObject.Union object, SharedExportBytesUnion sharedTicketBytes)
      Makes the object available to another user or another client on this same server which knows the value of the sharedTicketBytes. Use that sharedTicketBytes value like a one-time use password - any other client which knows this value can read the same object.

      Shared objects will remain available using the sharedTicketBytes until the client that first shared them releases/closes their copy of the object. Whatever side-channel is used to share the bytes, be sure to wait until the remote end has signaled that it has successfully fetched the object before releasing it from this client.

      Be sure to use an unpredictable value for the shared ticket bytes, like a UUID or other large, random value to prevent access by unauthorized clients.

      Parameters:
      object - the object to share with another client/user
      sharedTicketBytes - the value which another client/user must know to obtain the object. It may be a unicode string (will be encoded as utf8 bytes), or a Uint8Array value.
      Returns:
      A promise that will resolve to the value passed as sharedTicketBytes when the object is ready to be read by another client, or will reject if an error occurs.
    • getSharedObject

      public elemental2.promise.Promise<?> getSharedObject(SharedExportBytesUnion sharedTicketBytes, String type)
      Reads an object shared by another client to this server with the sharedTicketBytes. Until the other client releases this object (or their session ends), the object will be available on the server.

      The type of the object must be passed so that the object can be read from the server correct - the other client should provide this information.

      Parameters:
      sharedTicketBytes - the value provided by another client/user to obtain the object. It may be a unicode string (will be encoded as utf8 bytes), or a Uint8Array value.
      type - The type of the object, so it can be correctly read from the server
      Returns:
      A promise that will resolve to the shared object, or will reject with an error if it cannot be read.
    • subscribeToFieldUpdates

      public JsRunnable subscribeToFieldUpdates(JsConsumer<JsVariableChanges> callback)
    • close

      public void close()
    • runCode

      public CancellablePromise<JsCommandResult> runCode(String code)
    • onLogMessage

      public JsRunnable onLogMessage(JsConsumer<LogItem> callback)
    • openDocument

      public void openDocument(Object params)
    • changeDocument

      public void changeDocument(Object params)
    • getCompletionItems

      public elemental2.promise.Promise<elemental2.core.JsArray<CompletionItem>> getCompletionItems(Object params)
    • getSignatureHelp

      public elemental2.promise.Promise<elemental2.core.JsArray<SignatureInformation>> getSignatureHelp(Object params)
    • getHover

      public elemental2.promise.Promise<Hover> getHover(Object params)
    • closeDocument

      public void closeDocument(Object params)
    • emptyTable

      public elemental2.promise.Promise<JsTable> emptyTable(double size)
      Creates an empty table with the specified number of rows. Optionally columns and types may be specified, but all values will be null.
      Parameters:
      size -
      Returns:
      Promise of JsTable
    • timeTable

      public elemental2.promise.Promise<JsTable> timeTable(double periodNanos, @JsOptional DateWrapper startTime)
      Creates a new table that ticks automatically every "periodNanos" nanoseconds. A start time may be provided; if so the table will be populated with the interval from the specified date until now.
      Parameters:
      periodNanos -
      startTime -
      Returns:
      Promise of JsTable