Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IWidgetFactory<T, U>

The interface for a widget factory.

Type parameters

Hierarchy

Implemented by

Index

Properties

Optional Readonly canStartKernel

canStartKernel: boolean

Whether the widgets can start a kernel when opened.

Optional Readonly defaultFor

defaultFor: ReadonlyArray<string>

The file types for which the factory should be the default.

Optional Readonly defaultRendered

defaultRendered: ReadonlyArray<string>

The file types for which the factory should be the default for rendering, if that is different than the default factory (which may be for editing). If undefined, then it will fall back on the default file type.

Readonly fileTypes

fileTypes: ReadonlyArray<string>

The file types the widget can view.

Readonly isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Optional Readonly modelName

modelName: string

The registered name of the model type used to create the widgets.

Readonly name

name: string

The name of the widget to display in dialogs.

Optional Readonly preferKernel

preferKernel: boolean

Whether the widgets prefer having a kernel started.

Optional Readonly readOnly

readOnly: boolean

Whether the widget factory is read only.

Optional Readonly shutdownOnClose

shutdownOnClose: boolean

Whether the kernel should be shutdown when the widget is closed.

Optional Readonly toolbarFactory

toolbarFactory: (widget: T) => IToolbarItem[]

A function producing toolbar widgets, overriding the default toolbar widgets.

Type declaration

Optional Readonly translator

translator: ITranslator

The application language translator.

widgetCreated

widgetCreated: ISignal<IWidgetFactory<T, U>, T>

A signal emitted when a new widget is created.

Methods

createNew

  • createNew(context: IContext<U>, source?: T): T
  • Create a new widget given a context.

    Parameters

    • context: IContext<U>
    • Optional source: T

      A widget to clone

      Notes

      It should emit the [widgetCreated] signal with the new widget.

    Returns T

dispose

  • dispose(): void
  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

Generated using TypeDoc