Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WidgetLayoutRegion

A layout region that contains a single PhosphorJS Widget. This is used for final layout, and wraps the widgets they contain. Note that the Panel that owns the DashboardLayout should still have full control over the widget's lifecycle.

Hierarchy

Implements

  • IMessageHandler
  • IObservableDisposable
  • IDisposable
  • IStaleable

Index

Constructors

constructor

Properties

Private _didUpdate

_didUpdate: boolean = false

Private flag that is set to true after an update-request.

This is used by the layout algorithm to ensure that all subtrees updated properly, since some Phosphor containers will skip updating in certain cases.

calculatedSize

calculatedSize: object | undefined

The absolute size of this region. May be pre-defined, or calculated. May be undefined until the first call to DashboardLayoutRegion#sizeContentToFit()

see

sizeContentToFit

deprecated

Layout algorithms should use top-down styling

content

content: Widget

dataset

dataset: DOMStringMap

The dataset for the widget's DOM node.

disposed

disposed: ISignal<this, void>

A signal emitted when the widget is disposed.

guid

guid: string

id

id: string

An immutable ID assigned to this layout region that is unique within it's dashboard

isAttached

isAttached: boolean

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

isDisposed

isDisposed: boolean

Test whether the widget has been disposed.

isHidden

isHidden: boolean

Test whether the widget is explicitly hidden.

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.

layout

Protected metadata

node

node: HTMLElement

Get the DOM node owned by the widget.

parent

parent: Widget | null

Set the parent of the widget.

Notes

Children are typically added to a widget by using a layout, which means user code will not normally set the parent widget directly.

The widget will be automatically removed from its old parent.

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

title

title: Title<Widget>

The title object for the widget.

Notes

The title object is used by some container widgets when displaying the widget alongside some title, such as a tab panel or side bar.

Since not all widgets will use the title, it is created on demand.

The owner property of the title is set to this widget.

titlebar

titlebar: WidgetWrapper

The titlebar for this region.

see

TitleBar

typeName

typeName: LayoutTypes = LayoutTypes.WidgetLayoutRegion

Accessors

OnStale

  • get OnStale(): Observable<void>

isFocused

  • get isFocused(): boolean

isStale

  • get isStale(): boolean

Protected owner

parentRegion

properties

uuid

  • get uuid(): string

Methods

activate

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

    Notes

    This is a simple convenience method for posting the message.

    Returns void

addClass

  • addClass(name: string): void
  • Add a class name to the widget'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.

      The class name must not contain whitespace.

    Returns void

attachChrome

  • attachChrome(chromeElement: Widget): void
  • Attach a new element to this region's chrome.

    Region chroming is a way of attaching transient or parent-specific elements to the DOM, without interfering with the base class or the implementation of the region children.

    To remove the chrome, simply #dispose() it.

    Region chroming is automatically cleared whenever the parentRegion changes.

    Parameters

    • chromeElement: Widget

    Returns void

children

  • children(): IIterator<Widget>
  • Create an iterator over the widget's children.

    Returns IIterator<Widget>

    A new iterator over the children of the widget.

    Notes

    The widget must have a populated layout in order to have children.

    If a layout is not installed, the returned iterator will be empty.

clearFlag

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

    Notes

    This will not typically be called directly by user code.

    Parameters

    • flag: Flag

    Returns void

close

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

    Notes

    This is a simple convenience method for sending the message.

    Returns void

contains

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

    Parameters

    • widget: Widget

      The descendant widget of interest.

    Returns boolean

    true if the widget is a descendant, false otherwise.

dispose

  • dispose(): void

fit

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

    Notes

    This is a simple convenience method for posting the message.

    Returns void

focus

  • focus(): void

getChild

  • getChild(): Widget

Protected getDefault

  • getDefault(propertyName: string): unknown

getLayoutProperty

  • getLayoutProperty<K>(propertyName: K): LayoutProps[K]
  • Return the value of a layout region property.

    This should fall back to default values if the property is undefined, and respect per-property logic (such as flexSize/fixedSize precedence)

    Type parameters

    • K: keyof ILayoutProps

    Parameters

    • propertyName: K

      The name of the layout property to retrieve

    Returns LayoutProps[K]

handleEvent

  • handleEvent(ev: IDragEvent): void

hasClass

  • hasClass(name: string): boolean
  • Test whether the widget'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.

    If the widget is explicitly hidden, this is a no-op.

    Returns void

hideOverlay

  • hideOverlay(): void

hideRootOverlay

  • hideRootOverlay(): 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.

      This will not typically be called directly by user code.

    Returns void

Protected onActivateRequest

  • onActivateRequest(): void

Protected onAfterAttach

  • onAfterAttach(): void

Protected onAfterBlur

  • onAfterBlur(msg: Message): void

Protected onAfterDetach

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

    Notes

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

    Parameters

    • msg: Message

    Returns void

Protected onAfterFocus

  • onAfterFocus(msg: Message): void

Protected onAfterHide

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

    Notes

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

    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 handler is a no-op.

    Parameters

    • msg: Message

    Returns void

Protected onBeforeAttach

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

    Notes

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

    Parameters

    • msg: Message

    Returns void

Protected onBeforeBlur

  • onBeforeBlur(msg: Message): void

Protected onBeforeDetach

  • onBeforeDetach(): void

Protected onBeforeFocus

  • onBeforeFocus(msg: Message): void

Protected onBeforeHide

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

    Notes

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

    Parameters

    • msg: Message

    Returns void

Protected onBeforeShow

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

    Notes

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

    Parameters

    • msg: Message

    Returns void

Protected onChildAdded

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

    Notes

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

    Parameters

    • msg: ChildMessage

    Returns void

Protected onChildRemoved

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

    Notes

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

    Parameters

    • msg: ChildMessage

    Returns void

Protected onCloseRequest

  • onCloseRequest(): void

Protected onDragEnter

  • onDragEnter(ev: IDragEvent): void

Protected onDragLeave

  • onDragLeave(ev: IDragEvent): void

Protected onDragOver

  • onDragOver(ev: IDragEvent): void

Protected onDrop

  • onDrop(ev: IDragEvent): void

Protected onFitRequest

  • onFitRequest(msg: Message): void
  • A message handler invoked on a 'fit-request' message.

    Notes

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

    Parameters

    • msg: Message

    Returns void

Protected onResize

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

    Notes

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

    Parameters

    • msg: ResizeMessage

    Returns void

Protected onUpdateRequest

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

    Notes

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

    Parameters

    • msg: Message

    Returns void

processMessage

  • processMessage(msg: Message): void

removeClass

  • removeClass(name: string): void
  • Remove a class name from the widget'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.

      The class name must not contain whitespace.

    Returns void

setFlag

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

    Notes

    This will not typically be called directly by user code.

    Parameters

    • flag: Flag

    Returns void

setFresh

  • setFresh(): void

setHidden

  • setHidden(hidden: boolean): void
  • Show or hide the widget according to a boolean value.

    Parameters

    • hidden: boolean

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

      Notes

      This is a convenience method for hide() and show().

    Returns void

setLayoutProperty

  • setLayoutProperty<K>(propertyName: K, value: LayoutProps[K]): void

setStale

  • setStale(): void
  • Mark this region as having changes that need to be synced with something

    Notes

    Examples of this include layout properties, which need to be saved to a model, and added/removed children, which need the dashboard to issue update requests.

    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.

    If the widget is not explicitly hidden, this is a no-op.

    Returns void

showOverlay

  • showOverlay(): void

showRootOverlay

  • showRootOverlay(): void

sizeContentToFit

  • sizeContentToFit(bounds: object): void
  • Size the content of the layout region to fit within the given bounds

    This is normally called by the dashboarding framework, or by layout regions with children after they have fit themselves.

    Subclassers may implement additional logic that is relevant to how they should be displayed, such as background color.

    deprecated

    A later commit will move this to top-down styling, as practiced by Phosphor

    Parameters

    • bounds: object

      The width and height that the layout region should fit into.

    Returns void

startDrag

  • startDrag(clientX: number, clientY: number): void

testFlag

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

    Notes

    This will not typically be called directly by user code.

    Parameters

    • flag: Flag

    Returns boolean

toggleClass

  • toggleClass(name: string, force?: undefined | false | true): boolean
  • Toggle a class name on the widget's DOM node.

    Parameters

    • name: string

      The class name to toggle on the node.

    • Optional force: undefined | false | true

      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.

    Notes

    The class name must not contain whitespace.

update

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

    Notes

    This is a simple convenience method for posting the message.

    Returns void

updateFromProperties

  • updateFromProperties(): void

Static GetMetadata

Generated using TypeDoc