Construct a new document manager.
The registry used by the manager.
The service manager used by the manager.
A signal emitted when one of the documents is activated.
Whether to autosave documents.
Whether to autosave documents.
Determines the time interval for autosave in seconds.
Determines the time interval for autosave in seconds.
Get whether the document manager has been disposed.
Get the contexts for a given path.
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).
Create a context from a path and a model factory.
Creates a new document, or loads one from disk, depending on the which
argument.
If which==='create'
, then it creates a new document. If which==='open'
,
then it loads the document from disk.
The two cases differ in how the document context is handled, but the creation of the widget and launching of the kernel are identical.
Find a context for a given path and factory name.
Handle an activateRequested signal from the widget manager.
Handle a context disposal.
Get the widget factory for a given widget name.
Clone a widget.
The source widget.
A new widget or undefined
.
Uses the same widget factory and context as the source, or returns
undefined
if the source widget is not managed by this manager.
Close all of the open documents.
A promise resolving when the widgets are closed.
Close the widgets associated with a given path.
The target path.
A promise resolving when the widgets are closed.
Get the document context for a widget.
The widget of interest.
The context associated with the widget, or undefined
if no such
context exists.
Copy a file.
The full path of the original file.
The full path to the target directory.
A promise which resolves to the contents of the file.
Create a new file and return the widget used to view it.
The file path to create.
The name of the widget factory to use. 'default' will use the default widget.
An optional kernel name/id to override the default.
The created widget, or undefined
.
This function will return undefined
if a valid widget factory
cannot be found.
Delete a file.
The full path to the file to be deleted.
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.
Dispose of the resources held by the document manager.
See if a widget already exists for the given path and widget name.
The file path to use.
The name of the widget factory to use. 'default' will use the default widget.
The found widget, or undefined
.
This can be used to find an existing widget instead of opening a new widget.
Create a new untitled file.
The file content creation options.
Open a file and return the widget used to view it.
The file path to open.
The name of the widget factory to use. 'default' will use the default widget.
An optional kernel name/id to override the default.
The created widget, or undefined
.
This function will return undefined
if a valid widget factory
cannot be found.
Open a file and return the widget used to view it. Reveals an already existing editor.
The file path to open.
The name of the widget factory to use. 'default' will use the default widget.
An optional kernel name/id to override the default.
The created widget, or undefined
.
This function will return undefined
if a valid widget factory
cannot be found.
Overwrite a file.
The full path to the original file.
The full path to the new file.
A promise containing the new file contents model.
Rename a file or directory.
The full path to the original file.
The full path to the new file.
A promise containing the new file contents model. The promise will reject if the newPath already exists. Use overwrite to overwrite a file.
Generated using TypeDoc
The document manager. A namespace for document manager statics.
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.