Theia API Documentation v1.65.0
    Preparing search index...

    Class LayoutAbstract

    An abstract base class for creating lumino layouts.

    A layout is used to add widgets to a parent and to arrange those widgets within the parent's DOM node.

    This class implements the base functionality which is required of nearly all layouts. It must be subclassed in order to be useful.

    Notably, this class does not define a uniform interface for adding widgets to the layout. A subclass should define that API in a way which is meaningful for its intended use.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Construct a new layout.

      Parameters

      • Optionaloptions: Layout.IOptions

        The options for initializing the layout.

      Returns Layout

    Accessors

    • get fitPolicy(): FitPolicy

      Get the fit policy for the layout.

      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 fitPolicy(value: FitPolicy): void

      Set the fit policy for the layout.

      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

    • get isDisposed(): boolean

      Test whether the layout is disposed.

      Returns boolean

    • get parent(): null | Widget

      Get the parent widget of the layout.

      Returns null | Widget

    • set parent(value: null | Widget): void

      Set the parent widget of the layout.

      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

    Methods

    • Create an iterator over the widgets in the layout.

      Returns IterableIterator<Widget>

      A new iterator over the widgets in the layout.

      This abstract method must be implemented by a subclass.

    • Dispose of the resources held by the layout.

      This should be reimplemented to clear and dispose of the widgets.

      All reimplementations should call the superclass method.

      This method is called automatically when the parent is disposed.

      Returns void

    • Perform layout initialization which requires the parent widget.

      This method is invoked immediately after the layout is installed on the parent widget.

      The default implementation reparents all of the widgets to the layout parent widget.

      Subclasses should reimplement this method and attach the child widget nodes to the parent widget's node.

      Returns void

    • A message handler invoked on an 'after-attach' message.

      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

      Returns void

    • A message handler invoked on an 'after-detach' message.

      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

      Returns void

    • A message handler invoked on an 'after-hide' message.

      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

      Returns void

    • A message handler invoked on an 'after-show' message.

      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

      Returns void

    • A message handler invoked on a 'before-attach' message.

      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

      Returns void

    • A message handler invoked on a 'before-detach' message.

      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

      Returns void

    • A message handler invoked on a 'before-hide' message.

      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

      Returns void

    • A message handler invoked on a 'before-show' message.

      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

      Returns void

    • A message handler invoked on a 'child-hidden' message.

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

      Parameters

      Returns void

    • A message handler invoked on a 'child-removed' message.

      This will remove the child widget from the layout.

      Subclasses should not typically reimplement this method.

      Parameters

      Returns void

    • A message handler invoked on a 'child-shown' message.

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

      Parameters

      Returns void

    • A message handler invoked on a 'fit-request' message.

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

      Parameters

      Returns void

    • A message handler invoked on a 'resize' message.

      The layout should ensure that its widgets are resized according to the specified layout space, and that they are sent a 'resize' message if appropriate.

      The default implementation of this method sends an UnknownSize resize message to all widgets.

      This may be reimplemented by subclasses as needed.

      Parameters

      Returns void

    • A message handler invoked on an 'update-request' message.

      The layout should ensure that its widgets are resized according to the available layout space, and that they are sent a 'resize' message if appropriate.

      The default implementation of this method sends an UnknownSize resize message to all widgets.

      This may be reimplemented by subclasses as needed.

      Parameters

      Returns void

    • Process a message sent to the parent widget.

      Parameters

      • msg: Message

        The message sent to the parent widget.

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

        Subclasses may reimplement this method as needed.

      Returns void

    • Remove a widget from the layout.

      Parameters

      • widget: Widget

        The widget to remove from the layout.

        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 should not modify the widget's parent.

      Returns void