Class StdLayoutImpl

All Implemented Interfaces:
WLayoutImpl, WLayoutItemImpl

public abstract class StdLayoutImpl extends StdLayoutItemImpl implements WLayoutImpl
An abstract base class for implementing layout managers.

See Also:
  • Constructor Details

  • Method Details

    • updateDom

      public abstract void updateDom(DomElement parent)
      Updates the DomElements in the WLayout.

      This function should update the DomElements in the WLayout. This means creating DomElements for newly added StdLayoutItemImpl, deleting DomElements from deleted StdLayoutItemImpl and updating the placement and size of the DomElements.

    • itemResized

      public abstract boolean itemResized(WLayoutItem item)
      Called when a WLayoutItem in the WLayout is resized.

      When a WLayoutItem is resized, it may be necessary to update the whole layout. Items may have moved in such a way, that it would push other items of screen, requiring other items to adapt to it.

      If it returns true, a subsequent updateDom() may be necessary.

    • isParentResized

      public abstract boolean isParentResized()
      Called when the parent is resized.

      When the parent is resized, it may be necessary to update the whole layout. More or less items could not potentially fit in the layout, or the layout's boundaries may have changed.

      If it returns true, a subsequent updateDom() may be necessary.

      See Also:
    • getLayoutItem

      public WLayoutItem getLayoutItem()
      Returns the WLayout as a WLayoutItem.
      Specified by:
      getLayoutItem in class StdLayoutItemImpl
    • update

      public void update()
      Updates the layout.

      By default, this will trigger a call to updateDom().

      Note: Several calls to update() may happens before updateDom() is called.

      Specified by:
      update in interface WLayoutImpl
      See Also:
    • setObjectName

      public void setObjectName(String name)
      Description copied from class: WObject
      Sets an object name.

      The object name can be used to easily identify a type of object in the DOM, and does not need to be unique. It will usually reflect the widget type or role. The object name is prepended to the auto-generated object WObject.getId().

      The default object name is empty.

      Overrides:
      setObjectName in class WObject
      Parameters:
      name - the object name.
    • getLayout

      protected WLayout getLayout()
      Returns the WLayout.
    • getImpl

      protected static StdLayoutItemImpl getImpl(WLayoutItem item)
      Returns a WLayoutItem implementation.

      Returns a WLayoutItem implementation if the implementation is a subclass of StdLayoutItemImpl. Otherwise returns null.