Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsolePanel

A panel which contains a toolbar and a console.

Hierarchy

  • Panel

Implements

  • IDisposable
  • IMessageHandler

Index

Constructors

constructor

  • new ConsolePanel(session: INotebookSession, rendermime: RenderMime<Widget>): ConsolePanel
  • Construct a console panel.

    Parameters

    • session: INotebookSession
    • rendermime: RenderMime<Widget>

    Returns ConsolePanel

Properties

Private _console

_console: ConsoleWidget

disposed

disposed: ISignal<Widget, void>

A signal emitted when the widget is disposed.

See also: dispose, disposed

id

id: string

Set the id of the wrapper's DOM node.

isAttached

isAttached: boolean

Test whether the widget's node is attached to the DOM.

Notes

This is a read-only property.

See also: attach, detach

isDisposed

isDisposed: boolean

Test whether the widget has been disposed.

Notes

This is a read-only property.

See also: dispose, disposed

isHidden

isHidden: boolean

Test whether the widget is explicitly hidden.

Notes

This is a read-only property.

See also: isVisible, hide, show

isVisible

isVisible: boolean

Test whether the widget is visible.

Notes

A widget is visible when it is attached to the DOM, is not explicitly hidden, and has no explicitly hidden ancestors.

This is a read-only property.

See also: isHidden, hide, show

layout

layout: Layout

Set the layout for the widget.

Notes

The layout is single-use only. It cannot be set to null and it cannot be changed after the first assignment.

The layout is disposed automatically when the widget is disposed.

node

node: HTMLElement

Get the DOM node managed by the wrapper.

Notes

This property is read-only.

parent

parent: Widget

Set the parent of the widget.

Notes

The widget will be automatically removed from its current parent.

This is a no-op if there is no effective parent change.

title

title: Title

Get the title data object for the widget.

Notes

The title data is used by some container widgets when displaying the widget along with a title, such as a tab panel or dock panel.

Not all widgets will make use of the title data, so it is created on-demand the first time it is accessed.

Accessors

content

Methods

addChild

  • addChild(child: Widget): void
  • Add a child widget to the end of the panel.

    Parameters

    • child: Widget

      The child widget to add to the panel.

      Notes

      If the child is already contained in the panel, it will be moved.

    Returns void

addClass

  • addClass(name: string): void
  • Add a class name to the wrapper's DOM node.

    Parameters

    • name: string

      The class name to add to the node.

      Notes

      If the class name is already added to the node, this is a no-op.

    Returns void

attach

  • attach(host: HTMLElement): void
  • Attach the widget to a host DOM node.

    throws

    An error if the widget is not a root widget, if the widget is already attached, or if the host is not attached to the DOM.

    Parameters

    • host: HTMLElement

      The DOM node to use as the widget's host.

    Returns void

childAt

  • childAt(index: number): Widget
  • Get the child widget at the specified index.

    Parameters

    • index: number

      The index of the child widget of interest.

    Returns Widget

    The child at the specified index, or undefined.

childCount

  • childCount(): number
  • Get the number of child widgets in the panel.

    Returns number

    The number of child widgets in the panel.

childIndex

  • childIndex(child: Widget): number
  • Get the index of the specified child widget.

    Parameters

    • child: Widget

      The child widget of interest.

    Returns number

    The index of the specified child, or -1.

clearFlag

  • clearFlag(flag: WidgetFlag): void
  • Clear the given widget flag.

    Notes

    This will not typically be consumed directly by user code.

    Parameters

    • flag: WidgetFlag

    Returns void

close

  • close(): void
  • Send a 'close-request' message to the widget.

    See also: [[MsgCloseRequest]]

    Returns void

compressMessage

  • compressMessage(msg: Message, pending: Queue<Message>): boolean
  • Compress a message posted to the widget.

    Parameters

    • msg: Message

      The message posted to the widget.

    • pending: Queue<Message>

      The queue of pending messages for the widget.

    Returns boolean

    true if the message should be ignored, or false if the message should be enqueued for delivery as normal.

    Notes

    Subclasses may reimplement this method as needed.

contains

  • contains(widget: Widget): boolean
  • Test whether a widget is a descendant of this widget.

    Parameters

    • widget: Widget

      The widget of interest.

    Returns boolean

    true if the widget is a descendant, false otherwise.

detach

  • detach(): void
  • Detach the widget from its host DOM node.

    throws

    An error if the widget is not a root widget, or if the widget is not attached.

    Returns void

dispose

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

    Returns void

fit

  • fit(): void
  • Post a 'fit-request' message to the widget.

    See also: [[MsgFitRequest]]

    Returns void

handleEvent

  • handleEvent(event: Event): void
  • Handle the DOM events for the widget.

    Parameters

    • event: Event

      The DOM event sent to the widget.

      Notes

      This method implements the DOM EventListener interface and is called in response to events on the dock panel's node. It should not be called directly by user code.

    Returns void

hasClass

  • hasClass(name: string): boolean
  • Test whether the wrapper's DOM node has the given class name.

    Parameters

    • name: string

      The class name of interest.

    Returns boolean

    true if the node has the class, false otherwise.

hide

  • hide(): void
  • Hide the widget and make it hidden to its parent widget.

    Notes

    This causes the isHidden property to be true.

    Returns void

insertChild

  • insertChild(index: number, child: Widget): void
  • Insert a child widget at the specified index.

    Parameters

    • index: number

      The index at which to insert the child.

    • child: Widget

      The child widget to insert into to the panel.

      Notes

      If the child is already contained in the panel, it will be moved.

    Returns void

Protected notifyLayout

  • notifyLayout(msg: Message): void
  • Invoke the message processing routine of the widget's layout.

    Parameters

    • msg: Message

      The message to dispatch to the layout.

      Notes

      This is a no-op if the widget does not have a layout.

    Returns void

Protected onAfterAttach

  • onAfterAttach(msg: Message): void
  • Handle after_attach messages for the widget.

    Parameters

    • msg: Message

    Returns void

Protected onAfterShow

  • onAfterShow(msg: Message): void
  • A message handler invoked on an 'after-show' message.

    The default implementation of this handler is a no-op.

    See also: [[MsgAfterShow]]

    Parameters

    • msg: Message

    Returns void

Protected onBeforeDetach

  • onBeforeDetach(msg: Message): void
  • Handle before_detach messages for the widget.

    Parameters

    • msg: Message

    Returns void

Protected onBeforeHide

  • onBeforeHide(msg: Message): void
  • A message handler invoked on a 'before-hide' message.

    The default implementation of this handler is a no-op.

    See also: [[MsgBeforeHide]]

    Parameters

    • msg: Message

    Returns void

Protected onChildAdded

  • onChildAdded(msg: ChildMessage): void
  • A message handler invoked on a 'child-added' message.

    The default implementation of this handler is a no-op.

    See also: [[ChildMessage]]

    Parameters

    • msg: ChildMessage

    Returns void

Protected onChildRemoved

  • onChildRemoved(msg: ChildMessage): void
  • A message handler invoked on a 'child-removed' message.

    The default implementation of this handler is a no-op.

    See also: [[ChildMessage]]

    Parameters

    • msg: ChildMessage

    Returns void

Protected onCloseRequest

  • onCloseRequest(msg: Message): void
  • Handle 'close-request' messages.

    Parameters

    • msg: Message

    Returns void

Protected onResize

  • onResize(msg: ResizeMessage): void
  • A message handler invoked on a 'resize' message.

    The default implementation of this handler is a no-op.

    See also: [[ResizeMessage]]

    Parameters

    • msg: ResizeMessage

    Returns void

Protected onUpdateRequest

  • onUpdateRequest(msg: Message): void
  • A message handler invoked on an 'update-request' message.

    The default implementation of this handler is a no-op.

    See also: update, [[MsgUpdateRequest]]

    Parameters

    • msg: Message

    Returns void

processMessage

  • processMessage(msg: Message): void
  • Process a message sent to the widget.

    Parameters

    • msg: Message

      The message sent to the widget.

      Notes

      Subclasses may reimplement this method as needed.

    Returns void

removeClass

  • removeClass(name: string): void
  • Remove a class name from the wrapper's DOM node.

    Parameters

    • name: string

      The class name to remove from the node.

      Notes

      If the class name is not yet added to the node, this is a no-op.

    Returns void

setFlag

  • setFlag(flag: WidgetFlag): void
  • Set the given widget flag.

    Notes

    This will not typically be consumed directly by user code.

    Parameters

    • flag: WidgetFlag

    Returns void

setHidden

  • setHidden(hidden: boolean): void
  • Set whether the widget is hidden.

    Parameters

    • hidden: boolean

      true to hide the widget, or false to show it.

      Notes

      widget.setHidden(true) is equivalent to widget.hide(), and widget.setHidden(false) is equivalent to widget.show().

    Returns void

show

  • show(): void
  • Show the widget and make it visible to its parent widget.

    Notes

    This causes the isHidden property to be false.

    Returns void

testFlag

  • testFlag(flag: WidgetFlag): boolean
  • Test whether the given widget flag is set.

    Notes

    This will not typically be consumed directly by user code.

    Parameters

    • flag: WidgetFlag

    Returns boolean

toggleClass

  • toggleClass(name: string, force?: boolean): boolean
  • Toggle a class name on the wrapper's DOM node.

    Parameters

    • name: string

      The class name to toggle on the node.

    • Optional force: boolean

      Whether to force add the class (true) or force remove the class (false). If not provided, the presence of the class will be toggled from its current state.

    Returns boolean

    true if the class is now present, false otherwise.

update

  • update(): void
  • Post an 'update-request' message to the widget.

    See also: [[MsgUpdateRequest]]

    Returns void

Static createConsole

  • createConsole(session: INotebookSession, rendermime: RenderMime<Widget>): ConsoleWidget
  • Create a new console widget for the panel.

    Parameters

    • session: INotebookSession
    • rendermime: RenderMime<Widget>

    Returns ConsoleWidget

Static createLayout

  • createLayout(): PanelLayout
  • Create a panel layout to use with a panel.

    Returns PanelLayout

    A new panel layout to use with a panel.

    Notes

    This may be reimplemented by a subclass to create custom layouts.

Static createNode

  • createNode(): HTMLElement
  • Create the DOM node for a new node wrapper instance.

    Returns HTMLElement

    The DOM node to use with the node wrapper instance.

    Notes

    The default implementation creates an empty <div>.

    This may be reimplemented by a subclass to create a custom node.

Generated using TypeDoc