diff options
author | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-04-14 11:53:11 +0300 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-04-14 12:06:05 +0300 |
commit | 416e2f97bcaf93e4d2a782149a963fca95b8400e (patch) | |
tree | eac6d22107b7c2d7bf6371e5278078f02bb860e9 /client | |
parent | d2e24feb09ccba7f3a2f253687488774af2bc340 (diff) | |
parent | eda9edcbde781d29ff5939defb61ba5fb159e206 (diff) | |
download | vaadin-framework-416e2f97bcaf93e4d2a782149a963fca95b8400e.tar.gz vaadin-framework-416e2f97bcaf93e4d2a782149a963fca95b8400e.zip |
Merge branch 'master' into 7.2
72d0aa0 Update Window Javadoc based on 7.2 API review changes
ee203f5 Apply abstract ordered layout settings for replaced component (#13568)
02998d8 Updated Window API based on 7.2 API review
cd94b21 Discourage use of setNeedsLayout while a layout is running (#13542)
f374bc7 Make ComboBox always immediate (#4054)
aec102a Update 3rd party license information (#13449)
013d32d Remove old widget from tab content on replace (#12931).
3d0ff32 Prevent duplicate detach() calls with push (#13261)
a452bad Refactor VaadinPortletRequest extending. (#13551)
55dfd29 Prevent duplicate session destroy events (#12612)
2067d4e Don't allocate unnecessary memory for empty array of Objects in MethodProperty (#10446).
00a9af5 Refactor PushConfigurationTest.
Merge: no
Change-Id: I6563769a77f91a68cfeadcb3306dd71fe431863c
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/LayoutManager.java | 37 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/VAccordion.java | 1 |
2 files changed, 36 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index fbf540273f..69f3f08144 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -20,6 +20,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import java.util.logging.Logger; import com.google.gwt.core.client.Duration; import com.google.gwt.core.client.JsArrayString; @@ -827,6 +828,12 @@ public class LayoutManager { /** * 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. + * <p> + * 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 {@link #setNeedsMeasure(ComponentConnector)} + * instead. * * @param layout * the managed layout that should be layouted @@ -840,14 +847,25 @@ public class LayoutManager { * 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. - * + * <p> * For SimpleManagedLayout which is always layouted in both directions, this * has the same effect as {@link #setNeedsLayout(ManagedLayout)}. + * <p> + * 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 {@link #setNeedsMeasure(ComponentConnector)} + * instead. * * @param layout * the managed layout that should be layouted */ public final void setNeedsHorizontalLayout(ManagedLayout layout) { + if (isLayoutRunning()) { + getLogger() + .warning( + "setNeedsHorizontalLayout should not be run while a layout phase is in progress."); + } needsHorizontalLayout.add(layout.getConnectorId()); } @@ -855,14 +873,25 @@ public class LayoutManager { * 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. - * + * <p> * For SimpleManagedLayout which is always layouted in both directions, this * has the same effect as {@link #setNeedsLayout(ManagedLayout)}. + * <p> + * 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 {@link #setNeedsMeasure(ComponentConnector)} + * instead. * * @param layout * the managed layout that should be layouted */ public final void setNeedsVerticalLayout(ManagedLayout layout) { + if (isLayoutRunning()) { + getLogger() + .warning( + "setNeedsVerticalLayout should not be run while a layout phase is in progress."); + } needsVerticalLayout.add(layout.getConnectorId()); } @@ -1609,4 +1638,8 @@ public class LayoutManager { protected void cleanMeasuredSizes() { } + private static Logger getLogger() { + return Logger.getLogger(LayoutManager.class.getName()); + } + } diff --git a/client/src/com/vaadin/client/ui/VAccordion.java b/client/src/com/vaadin/client/ui/VAccordion.java index cba08d8e6b..d348e6863b 100644 --- a/client/src/com/vaadin/client/ui/VAccordion.java +++ b/client/src/com/vaadin/client/ui/VAccordion.java @@ -277,6 +277,7 @@ public class VAccordion extends VTabsheetBase { public void replaceWidget(Widget newWidget) { if (getWidgetCount() > 1) { Widget oldWidget = getWidget(1); + remove(oldWidget); widgets.remove(oldWidget); } add(newWidget, content); |