Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NotebookTracker

Hierarchy

Implements

Index

Constructors

constructor

  • Create a new widget tracker.

    Parameters

    • options: IOptions

      The instantiation options for a widget tracker.

    Returns NotebookTracker

Properties

Private _activeCell

_activeCell: Cell | null = null

Private _activeCellChanged

_activeCellChanged: Signal<this, Cell> = new Signal<this, Cell>(this)

Private _selectionChanged

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

currentChanged

currentChanged: ISignal<this, NotebookPanel | null>

A signal emitted when the current widget changes.

currentWidget

currentWidget: NotebookPanel | null

The current widget is the most recently focused or added widget.

Notes

It is the most recently focused widget, or the most recently added widget if no widget has taken focus.

isDisposed

isDisposed: boolean

Test whether the tracker is disposed.

namespace

namespace: string

A namespace for all tracked widgets, (e.g., notebook).

restored

restored: Promise<void>

A promise resolved when the tracker has been restored.

size

size: number

The number of widgets held by the tracker.

widgetAdded

widgetAdded: ISignal<this, NotebookPanel>

A signal emitted when a widget is added.

Notes

This signal will only fire when a widget is added to the tracker. It will not fire if a widget is injected into the tracker.

widgetUpdated

widgetUpdated: ISignal<this, NotebookPanel>

A signal emitted when a widget is updated.

Accessors

activeCell

  • get activeCell(): Cell
  • The currently focused cell.

    Notes

    This is a read-only property. If there is no cell with the focus, then this value is null.

    Returns Cell

activeCellChanged

  • get activeCellChanged(): ISignal<this, Cell>
  • A signal emitted when the current active cell changes.

    Notes

    If there is no cell with the focus, then null will be emitted.

    Returns ISignal<this, Cell>

selectionChanged

  • get selectionChanged(): ISignal<this, void>
  • A signal emitted when the selection state changes.

    Returns ISignal<this, void>

Methods

Private _onActiveCellChanged

  • _onActiveCellChanged(sender: Notebook, cell: Cell): void

Private _onSelectionChanged

  • _onSelectionChanged(sender: Notebook): void

add

  • Add a new notebook panel to the tracker.

    Parameters

    Returns Promise<void>

dispose

  • dispose(): void

filter

  • Filter the widgets in the tracker based on a predicate.

    Parameters

    Returns NotebookPanel[]

find

  • Find the first widget in the tracker that satisfies a filter function.

    Parameters

    Returns NotebookPanel | undefined

forEach

  • forEach(fn: function): void
  • Iterate through each widget in the tracker.

    Parameters

    Returns void

has

  • has(widget: Widget): boolean
  • Check if this tracker has the specified widget.

    Parameters

    • widget: Widget

      The widget whose existence is being checked.

    Returns boolean

inject

  • Inject a foreign widget into the widget tracker.

    Parameters

    • widget: NotebookPanel

      The widget to inject into the tracker.

      Notes

      Injected widgets will not have their state saved by the tracker.

      The primary use case for widget injection is for a plugin that offers a sub-class of an extant plugin to have its instances share the same commands as the parent plugin (since most relevant commands will use the currentWidget of the parent plugin's widget tracker). In this situation, the sub-class plugin may well have its own widget tracker for layout and state restoration in addition to injecting its widgets into the parent plugin's widget tracker.

    Returns Promise<void>

Protected onCurrentChanged

  • Handle the current change event.

    Parameters

    Returns void

restore

  • Restore the widgets in this tracker's namespace.

    Parameters

    • options: IOptions<NotebookPanel>

      The configuration options that describe restoration.

    Returns Promise<any>

    A promise that resolves when restoration has completed.

    Notes

    This function should not typically be invoked by client code. Its primary use case is to be invoked by a restorer.

save

  • Save the restore data for a given widget.

    Parameters

    Returns Promise<void>

Generated using TypeDoc