Class LayoutManager

    • Constructor Summary

      Constructors 
      Constructor Description
      LayoutManager()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addElementResizeListener​(com.google.gwt.dom.client.Element element, ElementResizeListener listener)
      Adds a listener that will be notified whenever the size of a specific element changes.
      void cleanMeasuredSizes()
      Clean measured sizes which are no longer needed.
      void forceLayout()  
      static LayoutManager get​(ApplicationConnection connection)
      Gets the layout manager associated with the given ApplicationConnection.
      int getBorderBottom​(com.google.gwt.dom.client.Element element)
      Gets the bottom border of the given element, provided that it has been measured.
      int getBorderHeight​(com.google.gwt.dom.client.Element element)
      Gets the border height (top border + bottom border) of the given element, provided that it has been measured.
      int getBorderLeft​(com.google.gwt.dom.client.Element element)
      Gets the left border of the given element, provided that it has been measured.
      int getBorderRight​(com.google.gwt.dom.client.Element element)
      Gets the right border of the given element, provided that it has been measured.
      int getBorderTop​(com.google.gwt.dom.client.Element element)
      Gets the top border of the given element, provided that it has been measured.
      int getBorderWidth​(com.google.gwt.dom.client.Element element)
      Gets the border width (left border + right border) of the given element, provided that it has been measured.
      protected ApplicationConnection getConnection()
      Returns the application connection for this layout manager.
      int getInnerHeight​(com.google.gwt.dom.client.Element element)
      Gets the inner height (excluding margins, paddings and borders) of the given element, provided that it has been measured.
      double getInnerHeightDouble​(com.google.gwt.dom.client.Element element)
      Gets the inner height (excluding margins, paddings and borders) of the given element, provided that it has been measured.
      int getInnerWidth​(com.google.gwt.dom.client.Element element)
      Gets the inner width (excluding margins, paddings and borders) of the given element, provided that it has been measured.
      double getInnerWidthDouble​(com.google.gwt.dom.client.Element element)
      Gets the inner width (excluding margins, paddings and borders) of the given element, provided that it has been measured.
      int getMarginBottom​(com.google.gwt.dom.client.Element element)
      Gets the bottom margin of the given element, provided that it has been measured.
      int getMarginHeight​(com.google.gwt.dom.client.Element element)
      Gets the combined top & bottom margin of the given element, provided that they have been measured.
      int getMarginLeft​(com.google.gwt.dom.client.Element element)
      Gets the left margin of the given element, provided that it has been measured.
      int getMarginRight​(com.google.gwt.dom.client.Element element)
      Gets the right margin of the given element, provided that it has been measured.
      int getMarginTop​(com.google.gwt.dom.client.Element element)
      Gets the top margin of the given element, provided that it has been measured.
      int getMarginWidth​(com.google.gwt.dom.client.Element element)
      Gets the combined left & right margin of the given element, provided that they have been measured.
      protected MeasuredSize getMeasuredSize​(com.google.gwt.dom.client.Element element, MeasuredSize defaultSize)
      Gets the measured size for an element.
      int getOuterHeight​(com.google.gwt.dom.client.Element element)
      Gets the outer height (including margins, paddings and borders) of the given element, provided that it has been measured.
      double getOuterHeightDouble​(com.google.gwt.dom.client.Element element)
      Gets the outer height (including margins, paddings and borders) of the given element, provided that it has been measured.
      int getOuterWidth​(com.google.gwt.dom.client.Element element)
      Gets the outer width (including margins, paddings and borders) of the given element, provided that it has been measured.
      double getOuterWidthDouble​(com.google.gwt.dom.client.Element element)
      Gets the outer width (including margins, paddings and borders) of the given element, provided that it has been measured.
      int getPaddingBottom​(com.google.gwt.dom.client.Element element)
      Gets the bottom padding of the given element, provided that it has been measured.
      int getPaddingHeight​(com.google.gwt.dom.client.Element element)
      Gets the padding height (top padding + bottom padding) of the given element, provided that it has been measured.
      int getPaddingLeft​(com.google.gwt.dom.client.Element element)
      Gets the left padding of the given element, provided that it has been measured.
      int getPaddingRight​(com.google.gwt.dom.client.Element element)
      Gets the right padding of the given element, provided that it has been measured.
      int getPaddingTop​(com.google.gwt.dom.client.Element element)
      Gets the top padding of the given element, provided that it has been measured.
      int getPaddingWidth​(com.google.gwt.dom.client.Element element)
      Gets the padding width (left padding + right padding) of the given element, provided that it has been measured.
      boolean isLayoutNeeded()
      Checks if there is something waiting for a layout to take place.
      boolean isLayoutRunning()  
      void layoutLater()  
      void layoutNow()  
      protected void performBrowserLayoutHacks()
      Called once per iteration in the layout loop before size calculations so different browsers quirks can be handled.
      void registerDependency​(ManagedLayout owner, com.google.gwt.dom.client.Element element)
      Registers that a ManagedLayout is depending on the size of an Element.
      void removeElementResizeListener​(com.google.gwt.dom.client.Element element, ElementResizeListener listener)
      Removes an element resize listener from the provided element.
      void reportHeightAssignedToRelative​(ComponentConnector component, int assignedHeight)
      Registers the height reserved for a relatively sized component.
      void reportOuterHeight​(ComponentConnector component, int outerHeight)
      Registers the outer height (including margins, borders and paddings) of a component.
      void reportOuterWidth​(ComponentConnector component, int outerWidth)
      Registers the outer width (including margins, borders and paddings) of a component.
      void reportWidthAssignedToRelative​(ComponentConnector component, int assignedWidth)
      Registers the width reserved for a relatively sized component.
      void setConnection​(ApplicationConnection connection)
      Sets the application connection this instance is connected to.
      void setEverythingNeedsMeasure()  
      protected void setMeasuredSize​(com.google.gwt.dom.client.Element element, MeasuredSize measuredSize)
      Assigns a measured size to an element.
      void setNeedsHorizontalLayout​(ManagedLayout layout)
      Marks that a ManagedLayout should be layouted horizontally in the next layout phase even if none of the elements managed by the layout have been resized horizontally.
      void setNeedsLayout​(ManagedLayout layout)
      Marks that a ManagedLayout should be layouted in the next layout phase even if none of the elements managed by the layout have been resized.
      void setNeedsMeasure​(ComponentConnector component)
      Informs this LayoutManager that the size of a component might have changed.
      void setNeedsMeasureRecursively​(ComponentConnector component)
      Informs this LayoutManager that some sizes in a component hierarchy might have changed.
      void setNeedsVerticalLayout​(ManagedLayout layout)
      Marks that a ManagedLayout should be layouted vertically in the next layout phase even if none of the elements managed by the layout have been resized vertically.
      void unregisterDependency​(ManagedLayout owner, com.google.gwt.dom.client.Element element)
      Registers that a ManagedLayout is no longer depending on the size of an Element.
    • Constructor Detail

      • LayoutManager

        public LayoutManager()
    • Method Detail

      • setConnection

        public void setConnection​(ApplicationConnection connection)
        Sets the application connection this instance is connected to. Called internally by the framework.
        Parameters:
        connection - the application connection this instance is connected to
      • getConnection

        protected ApplicationConnection getConnection()
        Returns the application connection for this layout manager.
        Returns:
        connection
      • get

        public static LayoutManager get​(ApplicationConnection connection)
        Gets the layout manager associated with the given ApplicationConnection.
        Parameters:
        connection - the application connection to get a layout manager for
        Returns:
        the layout manager associated with the provided application connection
      • registerDependency

        public void registerDependency​(ManagedLayout owner,
                                       com.google.gwt.dom.client.Element element)
        Registers that a ManagedLayout is depending on the size of an Element. This causes this layout manager to measure the element in the beginning of every layout phase and call the appropriate layout method of the managed layout if the size of the element has changed.
        Parameters:
        owner - the ManagedLayout that depends on an element
        element - the Element that should be measured
      • setMeasuredSize

        protected void setMeasuredSize​(com.google.gwt.dom.client.Element element,
                                       MeasuredSize measuredSize)
        Assigns a measured size to an element. Method defined as protected to allow separate implementation for IE8.
        Parameters:
        element - the dom element to attach the measured size to
        measuredSize - the measured size to attach to the element. If null, any previous measured size is removed.
      • getMeasuredSize

        protected MeasuredSize getMeasuredSize​(com.google.gwt.dom.client.Element element,
                                               MeasuredSize defaultSize)
        Gets the measured size for an element. Method defined as protected to allow separate implementation for IE8.
        Parameters:
        element - The element to get measured size for
        defaultSize - The size to return if no measured size could be found
        Returns:
        The measured size for the element or defaultSize
      • unregisterDependency

        public void unregisterDependency​(ManagedLayout owner,
                                         com.google.gwt.dom.client.Element element)
        Registers that a ManagedLayout is no longer depending on the size of an Element.
        Parameters:
        owner - the ManagedLayout no longer depends on an element
        element - the Element that that no longer needs to be measured
        See Also:
        registerDependency(ManagedLayout, Element)
      • isLayoutRunning

        public boolean isLayoutRunning()
      • layoutLater

        public void layoutLater()
      • layoutNow

        public void layoutNow()
      • performBrowserLayoutHacks

        protected void performBrowserLayoutHacks()
        Called once per iteration in the layout loop before size calculations so different browsers quirks can be handled. Mainly this is currently for the IE8 permutation.
      • forceLayout

        public void forceLayout()
      • setNeedsLayout

        public final void setNeedsLayout​(ManagedLayout layout)
        Marks that a ManagedLayout should be layouted in the next layout phase even if none of the elements managed by the layout have been resized.

        This method should not be invoked during a layout phase since it only controls what will happen in the beginning of the next phase. If you want to explicitly cause some layout to be considered in an ongoing layout phase, you should use setNeedsMeasure(ComponentConnector) instead.

        Parameters:
        layout - the managed layout that should be layouted
      • setNeedsHorizontalLayout

        public final void setNeedsHorizontalLayout​(ManagedLayout layout)
        Marks that a ManagedLayout should be layouted horizontally in the next layout phase even if none of the elements managed by the layout have been resized horizontally.

        For SimpleManagedLayout which is always layouted in both directions, this has the same effect as setNeedsLayout(ManagedLayout).

        This method should not be invoked during a layout phase since it only controls what will happen in the beginning of the next phase. If you want to explicitly cause some layout to be considered in an ongoing layout phase, you should use setNeedsMeasure(ComponentConnector) instead.

        Parameters:
        layout - the managed layout that should be layouted
      • setNeedsVerticalLayout

        public final void setNeedsVerticalLayout​(ManagedLayout layout)
        Marks that a ManagedLayout should be layouted vertically in the next layout phase even if none of the elements managed by the layout have been resized vertically.

        For SimpleManagedLayout which is always layouted in both directions, this has the same effect as setNeedsLayout(ManagedLayout).

        This method should not be invoked during a layout phase since it only controls what will happen in the beginning of the next phase. If you want to explicitly cause some layout to be considered in an ongoing layout phase, you should use setNeedsMeasure(ComponentConnector) instead.

        Parameters:
        layout - the managed layout that should be layouted
      • getOuterHeight

        public final int getOuterHeight​(com.google.gwt.dom.client.Element element)
        Gets the outer height (including margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.

        The value returned by this method is always rounded up. To get the exact outer width, use getOuterHeightDouble(Element)

        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured outer height (including margins, paddings and borders) of the element in pixels.
      • getOuterHeightDouble

        public final double getOuterHeightDouble​(com.google.gwt.dom.client.Element element)
        Gets the outer height (including margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured outer height (including margins, paddings and borders) of the element in pixels.
        Since:
        7.5.1
      • getOuterWidth

        public final int getOuterWidth​(com.google.gwt.dom.client.Element element)
        Gets the outer width (including margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.

        The value returned by this method is always rounded up. To get the exact outer width, use getOuterWidthDouble(Element)

        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured outer width (including margins, paddings and borders) of the element in pixels.
        Since:
        7.5.1
      • getOuterWidthDouble

        public final double getOuterWidthDouble​(com.google.gwt.dom.client.Element element)
        Gets the outer width (including margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured outer width (including margins, paddings and borders) of the element in pixels.
      • getInnerHeight

        public final int getInnerHeight​(com.google.gwt.dom.client.Element element)
        Gets the inner height (excluding margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.

        The value returned by this method is always rounded up. To get the exact outer width, use getInnerHeightDouble(Element)

        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured inner height (excluding margins, paddings and borders) of the element in pixels.
      • getInnerHeightDouble

        public final double getInnerHeightDouble​(com.google.gwt.dom.client.Element element)
        Gets the inner height (excluding margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured inner height (excluding margins, paddings and borders) of the element in pixels.
        Since:
        7.5.1
      • getInnerWidth

        public final int getInnerWidth​(com.google.gwt.dom.client.Element element)
        Gets the inner width (excluding margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.

        The value returned by this method is always rounded up. To get the exact outer width, use getOuterHeightDouble(Element)

        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured inner width (excluding margins, paddings and borders) of the element in pixels.
      • getInnerWidthDouble

        public final double getInnerWidthDouble​(com.google.gwt.dom.client.Element element)
        Gets the inner width (excluding margins, paddings and borders) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        -1 is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured inner width (excluding margins, paddings and borders) of the element in pixels.
        Since:
        7.5.1
      • getBorderHeight

        public final int getBorderHeight​(com.google.gwt.dom.client.Element element)
        Gets the border height (top border + bottom border) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured border height (top border + bottom border) of the element in pixels.
      • getPaddingHeight

        public int getPaddingHeight​(com.google.gwt.dom.client.Element element)
        Gets the padding height (top padding + bottom padding) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured padding height (top padding + bottom padding) of the element in pixels.
      • getBorderWidth

        public int getBorderWidth​(com.google.gwt.dom.client.Element element)
        Gets the border width (left border + right border) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured border width (left border + right border) of the element in pixels.
      • getBorderTop

        public int getBorderTop​(com.google.gwt.dom.client.Element element)
        Gets the top border of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured top border of the element in pixels.
      • getBorderLeft

        public int getBorderLeft​(com.google.gwt.dom.client.Element element)
        Gets the left border of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured left border of the element in pixels.
      • getBorderBottom

        public int getBorderBottom​(com.google.gwt.dom.client.Element element)
        Gets the bottom border of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured bottom border of the element in pixels.
      • getBorderRight

        public int getBorderRight​(com.google.gwt.dom.client.Element element)
        Gets the right border of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured right border of the element in pixels.
      • getPaddingWidth

        public int getPaddingWidth​(com.google.gwt.dom.client.Element element)
        Gets the padding width (left padding + right padding) of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured padding width (left padding + right padding) of the element in pixels.
      • getPaddingTop

        public int getPaddingTop​(com.google.gwt.dom.client.Element element)
        Gets the top padding of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured top padding of the element in pixels.
      • getPaddingLeft

        public int getPaddingLeft​(com.google.gwt.dom.client.Element element)
        Gets the left padding of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured left padding of the element in pixels.
      • getPaddingBottom

        public int getPaddingBottom​(com.google.gwt.dom.client.Element element)
        Gets the bottom padding of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured bottom padding of the element in pixels.
      • getPaddingRight

        public int getPaddingRight​(com.google.gwt.dom.client.Element element)
        Gets the right padding of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured right padding of the element in pixels.
      • getMarginTop

        public int getMarginTop​(com.google.gwt.dom.client.Element element)
        Gets the top margin of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured top margin of the element in pixels.
      • getMarginRight

        public int getMarginRight​(com.google.gwt.dom.client.Element element)
        Gets the right margin of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured right margin of the element in pixels.
      • getMarginBottom

        public int getMarginBottom​(com.google.gwt.dom.client.Element element)
        Gets the bottom margin of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured bottom margin of the element in pixels.
      • getMarginLeft

        public int getMarginLeft​(com.google.gwt.dom.client.Element element)
        Gets the left margin of the given element, provided that it has been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured size for
        Returns:
        the measured left margin of the element in pixels.
      • getMarginHeight

        public int getMarginHeight​(com.google.gwt.dom.client.Element element)
        Gets the combined top & bottom margin of the given element, provided that they have been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured margin for
        Returns:
        the measured top+bottom margin of the element in pixels.
      • getMarginWidth

        public int getMarginWidth​(com.google.gwt.dom.client.Element element)
        Gets the combined left & right margin of the given element, provided that they have been measured. These elements are guaranteed to be measured:
        • ManagedLayouts and their child Connectors
        • Elements for which there is at least one ElementResizeListener
        • Elements for which at least one ManagedLayout has registered a dependency
        A negative number is returned if the element has not been measured. If 0 is returned, it might indicate that the element is not attached to the DOM.
        Parameters:
        element - the element to get the measured margin for
        Returns:
        the measured left+right margin of the element in pixels.
      • reportOuterHeight

        public void reportOuterHeight​(ComponentConnector component,
                                      int outerHeight)
        Registers the outer height (including margins, borders and paddings) of a component. This can be used as an optimization by ManagedLayouts; by informing the LayoutManager about what size a component will have, the layout propagation can continue directly without first measuring the potentially resized elements.
        Parameters:
        component - the component for which the size is reported
        outerHeight - the new outer height (including margins, borders and paddings) of the component in pixels
      • reportHeightAssignedToRelative

        public void reportHeightAssignedToRelative​(ComponentConnector component,
                                                   int assignedHeight)
        Registers the height reserved for a relatively sized component. This can be used as an optimization by ManagedLayouts; by informing the LayoutManager about what size a component will have, the layout propagation can continue directly without first measuring the potentially resized elements.
        Parameters:
        component - the relatively sized component for which the size is reported
        assignedHeight - the inner height of the relatively sized component's parent element in pixels
      • reportWidthAssignedToRelative

        public void reportWidthAssignedToRelative​(ComponentConnector component,
                                                  int assignedWidth)
        Registers the width reserved for a relatively sized component. This can be used as an optimization by ManagedLayouts; by informing the LayoutManager about what size a component will have, the layout propagation can continue directly without first measuring the potentially resized elements.
        Parameters:
        component - the relatively sized component for which the size is reported
        assignedWidth - the inner width of the relatively sized component's parent element in pixels
      • reportOuterWidth

        public void reportOuterWidth​(ComponentConnector component,
                                     int outerWidth)
        Registers the outer width (including margins, borders and paddings) of a component. This can be used as an optimization by ManagedLayouts; by informing the LayoutManager about what size a component will have, the layout propagation can continue directly without first measuring the potentially resized elements.
        Parameters:
        component - the component for which the size is reported
        outerWidth - the new outer width (including margins, borders and paddings) of the component in pixels
      • addElementResizeListener

        public void addElementResizeListener​(com.google.gwt.dom.client.Element element,
                                             ElementResizeListener listener)
        Adds a listener that will be notified whenever the size of a specific element changes. Adding a listener to an element also ensures that all sizes for that element will be available starting from the next layout phase.
        Parameters:
        element - the element that should be checked for size changes
        listener - an ElementResizeListener that will be informed whenever the size of the target element has changed
      • removeElementResizeListener

        public void removeElementResizeListener​(com.google.gwt.dom.client.Element element,
                                                ElementResizeListener listener)
        Removes an element resize listener from the provided element. This might cause this LayoutManager to stop tracking the size of the element if no other sources are interested in the size.
        Parameters:
        element - the element to which the element resize listener was previously added
        listener - the ElementResizeListener that should no longer get informed about size changes to the target element.
      • setNeedsMeasure

        public void setNeedsMeasure​(ComponentConnector component)
        Informs this LayoutManager that the size of a component might have changed. This method should be used whenever the size of an individual component might have changed from outside of Vaadin's normal update phase, e.g. when an icon has been loaded or when the user resizes some part of the UI using the mouse.

        To set an entire component hierarchy to be measured, use setNeedsMeasureRecursively(ComponentConnector) instead.

        If there is no upcoming layout phase, a new layout phase is scheduled.

        Parameters:
        component - the component whose size might have changed.
      • setNeedsMeasureRecursively

        public void setNeedsMeasureRecursively​(ComponentConnector component)
        Informs this LayoutManager that some sizes in a component hierarchy might have changed. This method should be used whenever the size of any child component might have changed from outside of Vaadin's normal update phase, e.g. when a CSS class name related to sizing has been changed.

        To set a single component to be measured, use setNeedsMeasure(ComponentConnector) instead.

        If there is no upcoming layout phase, a new layout phase is scheduled.

        Parameters:
        component - the component at the root of the component hierarchy to measure
        Since:
        7.2
      • setEverythingNeedsMeasure

        public void setEverythingNeedsMeasure()
      • cleanMeasuredSizes

        public void cleanMeasuredSizes()
        Clean measured sizes which are no longer needed. Only for IE8.
      • isLayoutNeeded

        public boolean isLayoutNeeded()
        Checks if there is something waiting for a layout to take place.
        Returns:
        true if there are connectors waiting for measurement or layout, false otherwise
        Since:
        7.5.6