Class LayoutManager
- java.lang.Object
-
- com.vaadin.client.LayoutManager
-
public class LayoutManager extends Object
-
-
Constructor Summary
Constructors Constructor Description LayoutManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddElementResizeListener(com.google.gwt.dom.client.Element element, ElementResizeListener listener)Adds a listener that will be notified whenever the size of a specific element changes.voidforceLayout()static LayoutManagerget(ApplicationConnection connection)Gets the layout manager associated with the givenApplicationConnection.intgetBorderBottom(com.google.gwt.dom.client.Element element)Gets the bottom border of the given element, provided that it has been measured.intgetBorderHeight(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.intgetBorderLeft(com.google.gwt.dom.client.Element element)Gets the left border of the given element, provided that it has been measured.intgetBorderRight(com.google.gwt.dom.client.Element element)Gets the right border of the given element, provided that it has been measured.intgetBorderTop(com.google.gwt.dom.client.Element element)Gets the top border of the given element, provided that it has been measured.intgetBorderWidth(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 ApplicationConnectiongetConnection()Returns the application connection for this layout manager.intgetInnerHeight(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.doublegetInnerHeightDouble(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.intgetInnerWidth(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.doublegetInnerWidthDouble(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.intgetMarginBottom(com.google.gwt.dom.client.Element element)Gets the bottom margin of the given element, provided that it has been measured.intgetMarginHeight(com.google.gwt.dom.client.Element element)Gets the combined top & bottom margin of the given element, provided that they have been measured.intgetMarginLeft(com.google.gwt.dom.client.Element element)Gets the left margin of the given element, provided that it has been measured.intgetMarginRight(com.google.gwt.dom.client.Element element)Gets the right margin of the given element, provided that it has been measured.intgetMarginTop(com.google.gwt.dom.client.Element element)Gets the top margin of the given element, provided that it has been measured.intgetMarginWidth(com.google.gwt.dom.client.Element element)Gets the combined left & right margin of the given element, provided that they have been measured.protected MeasuredSizegetMeasuredSize(com.google.gwt.dom.client.Element element, MeasuredSize defaultSize)Gets the measured size for an element.intgetOuterHeight(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.doublegetOuterHeightDouble(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.intgetOuterWidth(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.doublegetOuterWidthDouble(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.intgetPaddingBottom(com.google.gwt.dom.client.Element element)Gets the bottom padding of the given element, provided that it has been measured.intgetPaddingHeight(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.intgetPaddingLeft(com.google.gwt.dom.client.Element element)Gets the left padding of the given element, provided that it has been measured.intgetPaddingRight(com.google.gwt.dom.client.Element element)Gets the right padding of the given element, provided that it has been measured.intgetPaddingTop(com.google.gwt.dom.client.Element element)Gets the top padding of the given element, provided that it has been measured.intgetPaddingWidth(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.booleanisLayoutNeeded()Checks if there is something waiting for a layout to take place.booleanisLayoutRunning()voidlayoutLater()voidlayoutNow()protected voidperformBrowserLayoutHacks()Called once per iteration in the layout loop before size calculations so different browsers quirks can be handled.voidregisterDependency(ManagedLayout owner, com.google.gwt.dom.client.Element element)Registers that a ManagedLayout is depending on the size of an Element.voidremoveElementResizeListener(com.google.gwt.dom.client.Element element, ElementResizeListener listener)Removes an element resize listener from the provided element.voidreportHeightAssignedToRelative(ComponentConnector component, int assignedHeight)Registers the height reserved for a relatively sized component.voidreportOuterHeight(ComponentConnector component, int outerHeight)Registers the outer height (including margins, borders and paddings) of a component.voidreportOuterWidth(ComponentConnector component, int outerWidth)Registers the outer width (including margins, borders and paddings) of a component.voidreportWidthAssignedToRelative(ComponentConnector component, int assignedWidth)Registers the width reserved for a relatively sized component.voidsetConnection(ApplicationConnection connection)Sets the application connection this instance is connected to.voidsetEverythingNeedsMeasure()protected voidsetMeasuredSize(com.google.gwt.dom.client.Element element, MeasuredSize measuredSize)Assigns a measured size to an element.voidsetNeedsHorizontalLayout(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.voidsetNeedsLayout(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.voidsetNeedsMeasure(ComponentConnector component)Informs this LayoutManager that the size of a component might have changed.voidsetNeedsMeasureRecursively(ComponentConnector component)Informs this LayoutManager that some sizes in a component hierarchy might have changed.voidsetNeedsVerticalLayout(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.voidsetThoroughSizeChck(boolean thoroughSizeCheck)Set whether the measuring should use a thorough size check that evaluates the presence of the element and uses calculated size, or default to a slightly faster check that can result in incorrect size information if the check is triggered while a transform animation is ongoing.voidunregisterDependency(ManagedLayout owner, com.google.gwt.dom.client.Element element)Registers that a ManagedLayout is no longer depending on the size of an Element.
-
-
-
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
-
setThoroughSizeChck
public void setThoroughSizeChck(boolean thoroughSizeCheck)
Set whether the measuring should use a thorough size check that evaluates the presence of the element and uses calculated size, or default to a slightly faster check that can result in incorrect size information if the check is triggered while a transform animation is ongoing. This can happen e.g. when a PopupView is opened.By default, the thorough size check is enabled.
- Parameters:
thoroughSizeCheck-trueif thorough size check enabled,falseif not- Since:
- 8.13
-
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 givenApplicationConnection.- 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 elementelement- 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 for legacy reasons.- Parameters:
element- the dom element to attach the measured size tomeasuredSize- the measured size to attach to the element. Ifnull, 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 for legacy reasons.- Parameters:
element- The element to get measured size fordefaultSize- 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 elementelement- 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 exists for legacy reasons.
-
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
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
- 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
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
- 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
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
- 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
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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 reportedouterHeight- 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 reportedassignedHeight- 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 reportedassignedWidth- 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 reportedouterWidth- 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 changeslistener- 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 addedlistener- 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()
-
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
-
-