The document manager.

Notes

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

_activateRequested: Signal<DocumentManager, string> = ...
_autosave: boolean = true
_autosaveInterval: number = 120
_contexts: IContext[] = []
_dialogs: IDialogs
_isConnectedCallback: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

_isDisposed: boolean = false
_lastModifiedCheckMargin: number = 500
_renameUntitledFileOnSave: boolean = true
_setBusy: undefined | (() => IDisposable)

Type declaration

_stateChanged: Signal<DocumentManager, IChangedArgs<any, any, string>> = ...
_when: Promise<void>
_widgetManager: DocumentWidgetManager

The registry used by the manager.

The service manager used by the manager.

translator: ITranslator

Accessors

Methods

  • Get the contexts for a given path.

    Notes

    There may be more than one context for a given path if the path is open with multiple model factories (for example, a notebook can be open with a notebook model factory and a text model factory).

    Parameters

    • path: string

    Returns IContext[]

  • Find a context for a given path and factory name.

    Parameters

    • path: string
    • factoryName: string

    Returns undefined | IContext

  • 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.

    • Optional kernel: Partial<Kernel.IModel>

      An optional kernel name/id to override the default.

    Returns undefined | Widget

    The created widget, or undefined.

    Notes

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