The document manager.

The document manager is used to register model and widget creators, and the file browser uses the document manager to create widgets. The document manager maintains a context for each path and model type that is open, and a list of widgets for each context. The document manager is in control of the proper closing and disposal of the widgets and contexts.

Implements

Constructors

Properties

The registry used by the manager.

The service manager used by the manager.

translator: ITranslator

Accessors

Methods

  • Create a new file and return the widget used to view it.

    Parameters

    • path: string

      The file path to create.

    • widgetName: string = 'default'

      The name of the widget factory to use. 'default' will use the default widget.

    • Optionalkernel: Partial<Kernel.IModel>

      An optional kernel name/id to override the default.

    Returns undefined | Widget

    The created widget, or undefined.

    This function will return undefined if a valid widget factory cannot be found.

  • Delete a file.

    Parameters

    • path: string

      The full path to the file to be deleted.

    Returns Promise<void>

    A promise which resolves when the file is deleted.

    If there is a running session associated with the file and no other sessions are using the kernel, the session will be shut down.