Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AccordionLayout

A layout which arranges its widgets into collapsible resizable sections.

Hierarchy

Implements

  • IIterable<Widget>
  • IDisposable

Index

Type aliases

Static Alignment

Alignment: Alignment

A type alias for a split layout alignment. A type alias for a accordion layout alignment.

Static Orientation

Orientation: Orientation

A type alias for a split layout orientation. A type alias for a accordion layout orientation.

Constructors

constructor

Properties

Private _titles

_titles: HTMLElement[] = []

renderer

renderer: IRenderer

The renderer used by the accordion layout.

Protected widgetOffset

widgetOffset: number = 0

Accessors

alignment

fitPolicy

  • Get the fit policy for the layout.

    Notes

    The fit policy controls the computed size constraints which are applied to the parent widget by the layout.

    Some layout implementations may ignore the fit policy.

    Returns FitPolicy

  • Set the fit policy for the layout.

    Notes

    The fit policy controls the computed size constraints which are applied to the parent widget by the layout.

    Some layout implementations may ignore the fit policy.

    Changing the fit policy will clear the current size constraint for the parent widget and then re-fit the parent.

    Parameters

    Returns void

handles

  • get handles(): ReadonlyArray<HTMLDivElement>

isDisposed

  • get isDisposed(): boolean

orientation

parent

  • get parent(): Widget | null
  • set parent(value: Widget | null): void
  • Get the parent widget of the layout.

    Notes

    This is set automatically when installing the layout on the parent widget. The parent widget should not be set directly by user code.

    Returns Widget | null

  • Set the parent widget of the layout.

    Notes

    This is set automatically when installing the layout on the parent widget. The parent widget should not be set directly by user code.

    Parameters

    Returns void

spacing

  • get spacing(): number
  • set spacing(value: number): void

titleSpace

  • get titleSpace(): number
  • set titleSpace(value: number): void

titles

  • get titles(): ReadonlyArray<HTMLElement>

widgets

  • get widgets(): ReadonlyArray<Widget>

Methods

absoluteSizes

  • absoluteSizes(): number[]

addWidget

  • addWidget(widget: Widget): void

Protected attachWidget

  • attachWidget(index: number, widget: Widget): void

Protected detachWidget

  • detachWidget(index: number, widget: Widget): void

dispose

  • dispose(): void

Protected init

  • init(): void

insertWidget

  • insertWidget(index: number, widget: Widget): void
  • Insert a widget into the layout at the specified index.

    Parameters

    • index: number

      The index at which to insert the widget.

    • widget: Widget

      The widget to insert into the layout.

      Notes

      The index will be clamped to the bounds of the widgets.

      If the widget is already added to the layout, it will be moved.

      Undefined Behavior

      An index which is non-integral.

    Returns void

iter

moveHandle

  • moveHandle(index: number, position: number): void
  • Move the offset position of a split handle.

    Parameters

    • index: number

      The index of the handle of the interest.

    • position: number

      The desired offset position of the handle.

      Notes

      The position is relative to the offset parent.

      This will move the handle as close as possible to the desired position. The sibling widgets will be adjusted as necessary.

    Returns void

Protected moveWidget

  • moveWidget(fromIndex: number, toIndex: number, widget: Widget): void
  • Move a widget in the parent's DOM node.

    Parameters

    • fromIndex: number

      The previous index of the widget in the layout.

    • toIndex: number

      The current index of the widget in the layout.

    • widget: Widget

      The widget to move in the parent.

    Returns void

Protected onAfterAttach

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

    Notes

    The default implementation of this method forwards the message to all widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    • msg: Message

    Returns void

Protected onAfterDetach

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

    Notes

    The default implementation of this method forwards the message to all widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    • msg: Message

    Returns void

Protected onAfterHide

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

    Notes

    The default implementation of this method forwards the message to all non-hidden widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    • msg: Message

    Returns void

Protected onAfterShow

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

    Notes

    The default implementation of this method forwards the message to all non-hidden widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    • msg: Message

    Returns void

Protected onBeforeAttach

  • onBeforeAttach(msg: Message): void

Protected onBeforeDetach

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

    Notes

    The default implementation of this method forwards the message to all widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    • msg: Message

    Returns void

Protected onBeforeHide

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

    Notes

    The default implementation of this method forwards the message to all non-hidden widgets. It assumes all widget nodes are attached to the parent widget node.

    This may be reimplemented by subclasses as needed.

    Parameters

    • msg: Message

    Returns void

Protected onBeforeShow

  • onBeforeShow(msg: Message): void

Protected onChildHidden

Protected onChildRemoved

Protected onChildShown

Protected onFitRequest

  • onFitRequest(msg: Message): void

Protected onResize

Protected onUpdateRequest

  • onUpdateRequest(msg: Message): void

processParentMessage

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

    Parameters

    • msg: Message

      The message sent to the parent widget.

      Notes

      This method is called by the parent widget to process a message.

      Subclasses may reimplement this method as needed.

    Returns void

relativeSizes

  • relativeSizes(): number[]
  • Get the relative sizes of the widgets in the layout.

    Returns number[]

    A new array of the relative sizes of the widgets.

    Notes

    The returned sizes reflect the sizes of the widgets normalized relative to their siblings.

    This method does not measure the DOM nodes.

removeWidget

  • removeWidget(widget: Widget): void
  • Remove a widget from the layout.

    Parameters

    • widget: Widget

      The widget to remove from the layout.

      Notes

      A widget is automatically removed from the layout when its parent is set to null. This method should only be invoked directly when removing a widget from a layout which has yet to be installed on a parent widget.

      This method does not modify the widget's parent.

    Returns void

removeWidgetAt

  • removeWidgetAt(index: number): void
  • Remove the widget at a given index from the layout.

    Parameters

    • index: number

      The index of the widget to remove.

      Notes

      A widget is automatically removed from the layout when its parent is set to null. This method should only be invoked directly when removing a widget from a layout which has yet to be installed on a parent widget.

      This method does not modify the widget's parent.

      Undefined Behavior

      An index which is non-integral.

    Returns void

setRelativeSizes

  • setRelativeSizes(sizes: number[], update?: boolean): void
  • Set the relative sizes for the widgets in the layout.

    Parameters

    • sizes: number[]

      The relative sizes for the widgets in the panel.

    • Default value update: boolean = true

      Update the layout after setting relative sizes. Default is True.

      Notes

      Extra values are ignored, too few will yield an undefined layout.

      The actual geometry of the DOM nodes is updated asynchronously.

    Returns void

Protected updateItemPosition

  • updateItemPosition(i: number, isHorizontal: boolean, left: number, top: number, height: number, width: number, size: number): void
  • Update the item position.

    Parameters

    • i: number

      Item index

    • isHorizontal: boolean

      Whether the layout is horizontal or not

    • left: number

      Left position in pixels

    • top: number

      Top position in pixels

    • height: number

      Item height

    • width: number

      Item width

    • size: number

      Item size

    Returns void

updateTitle

  • updateTitle(index: number, widget: Widget): void

Static getStretch

  • getStretch(widget: Widget): number
  • Get the split layout stretch factor for the given widget.

    Parameters

    • widget: Widget

      The widget of interest.

    Returns number

    The split layout stretch factor for the widget.

Static setStretch

  • setStretch(widget: Widget, value: number): void
  • Set the split layout stretch factor for the given widget.

    Parameters

    • widget: Widget

      The widget of interest.

    • value: number

      The value for the stretch factor.

    Returns void

Generated using TypeDoc