Options
All
  • Public
  • Public/Protected
  • All
Menu

An implementation of a document context. A namespace for Context statics.

This class is typically instantiated by the document manager.

Type parameters

Hierarchy

  • Context

Implements

Index

Constructors

constructor

Properties

Private _contentsModel

_contentsModel: IModel | null = null

Private _dialogs

_dialogs: IDialogs

Private _disposed

_disposed: Signal<this, void> = new Signal<this, void>(this)

Private _factory

_factory: IModelFactory<T>

Private _fileChanged

_fileChanged: Signal<this, IModel> = new Signal<this, Contents.IModel>(this)

Private _isDisposed

_isDisposed: boolean = false

Private _isPopulated

_isPopulated: boolean = false

Private _isReady

_isReady: boolean = false

Private _manager

_manager: IManager

Private _model

_model: T

Private _modelDB

_modelDB: IModelDB

Private _opener

_opener: (widget: Widget, options?: IOpenOptions) => void

Type declaration

Private _path

_path: string = ""

Private _pathChanged

_pathChanged: Signal<this, string> = new Signal<this, string>(this)

Private _populatedPromise

_populatedPromise: PromiseDelegate<void> = new PromiseDelegate<void>()

Private _readyPromise

_readyPromise: Promise<void>

Private _saveState

_saveState: Signal<this, "started" | "completed" | "failed"> = new Signal<this, DocumentRegistry.SaveState>(this)

Private _useCRLF

_useCRLF: boolean = false

sessionContext

sessionContext: SessionContext

The client session object associated with the context.

urlResolver

urlResolver: IResolver

The url resolver for the context.

Accessors

contentsModel

  • get contentsModel(): IModel | null

disposed

  • get disposed(): ISignal<this, void>

factoryName

  • get factoryName(): string

fileChanged

  • get fileChanged(): ISignal<this, IModel>

isDisposed

  • get isDisposed(): boolean

isReady

  • get isReady(): boolean

localPath

  • get localPath(): string
  • The current local path associated with the document. If the document is in the default notebook file browser, this is the same as the path.

    Returns string

model

  • get model(): T

path

  • get path(): string

pathChanged

  • get pathChanged(): ISignal<this, string>

ready

  • get ready(): Promise<void>

saveState

Methods

Private _finishSaveAs

  • _finishSaveAs(newPath: string): Promise<void>

Private _handleError

Private _maybeCheckpoint

  • _maybeCheckpoint(force: boolean): Promise<void>

Private _maybeOverWrite

  • _maybeOverWrite(path: string): Promise<void>

Private _maybeSave

Private _onFileChanged

Private _onSessionChanged

Private _populate

  • _populate(): Promise<void>

Private _revert

  • _revert(initializeModel?: boolean): Promise<void>
  • Revert the document contents to disk contents.

    Parameters

    • Default value initializeModel: boolean = false

      call the model's initialization function after deserializing the content.

    Returns Promise<void>

Private _save

  • _save(): Promise<void>

Private _timeConflict

Private _updateContentsModel

  • _updateContentsModel(model: IModel): void

addSibling

  • addSibling(widget: Widget, options?: IOpenOptions): IDisposable
  • Add a sibling widget to the document manager.

    Parameters

    • widget: Widget

      The widget to add to the document manager.

    • Default value options: IOpenOptions = {}

      The desired options for adding the sibling.

    Returns IDisposable

    A disposable used to remove the sibling if desired.

    Notes

    It is assumed that the widget has the same model and context as the original widget.

createCheckpoint

deleteCheckpoint

  • deleteCheckpoint(checkpointId: string): Promise<void>

dispose

  • dispose(): void

download

  • download(): Promise<void>

initialize

  • initialize(isNew: boolean): Promise<void>
  • Initialize the context.

    Parameters

    • isNew: boolean

      Whether it is a new file.

    Returns Promise<void>

    a promise that resolves upon initialization.

listCheckpoints

restoreCheckpoint

  • restoreCheckpoint(checkpointId?: undefined | string): Promise<void>

revert

  • revert(): Promise<void>

save

  • save(): Promise<void>

saveAs

  • saveAs(): Promise<void>

Generated using TypeDoc