Class DocumentWidgetManager

A class that maintains the lifecycle of file-backed widgets.

Hierarchy

  • DocumentWidgetManager

Implements

Constructors

Properties

_activateRequested: any
_confirmClosingTab: any
_initializeWidget: any

When a new widget is created, we need to hook it up with some signals, update the widget extensions (for this kind of widget) in the docregistry, among other things.

_isDisposed: any
_maybeClose: any

Ask the user whether to close an unsaved file.

_onFileChanged: any

Handle a file changed signal for a context.

_onPathChanged: any

Handle a path changed signal for a context.

_onWidgetDisposed: any

Handle the disposal of a widget.

_registry: any
_stateChanged: any
_widgetDisposed: any

Handle the disposal of a widget.

translator: ITranslator

Accessors

  • get activateRequested(): ISignal<this, string>
  • A signal emitted when one of the documents is activated.

    Returns ISignal<this, string>

  • get confirmClosingDocument(): boolean
  • Whether to ask confirmation to close a tab or not.

    Returns boolean

  • set confirmClosingDocument(v): void
  • Parameters

    • v: boolean

    Returns void

  • get isDisposed(): boolean
  • Test whether the document widget manager is disposed.

    Returns boolean

Methods

  • Install the message hook for the widget and add to list of known widgets.

    Parameters

    Returns void

  • Close the widgets associated with a given context.

    Parameters

    Returns Promise<void>

  • Get the document context for a widget.

    Parameters

    • widget: Widget

      The widget of interest.

    Returns DocumentRegistry.Context

    The context associated with the widget, or undefined.

  • Dispose of the widgets associated with a given context regardless of the widget's dirty state.

    Parameters

    Returns Promise<void>

  • Dispose of the resources used by the widget manager.

    Returns void

  • Filter a message sent to a message handler.

    Parameters

    • handler: IMessageHandler

      The target handler of the message.

    • msg: Message

      The message dispatched to the handler.

    Returns boolean

    false if the message should be filtered, of true if the message should be dispatched to the handler as normal.

  • Handle 'close-request' messages.

    Parameters

    • widget: Widget

      The target widget.

    Returns Promise<boolean>

    A promise that resolves with whether the widget was closed.

  • Dispose of widget regardless of widget's dirty state.

    Parameters

    • widget: Widget

      The target widget.

    Returns Promise<void>

  • Set the caption for widget title.

    Parameters

    • widget: Widget

      The target widget.

    Returns Promise<void>

Generated using TypeDoc