diff options
author | Artur Signell <artur@vaadin.com> | 2014-04-14 09:06:54 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-04-14 09:06:54 +0000 |
commit | e697d8b318c88d0acecd1fbb23231667fda5b4b8 (patch) | |
tree | 15db6ab386f1e814acaa8750ce08f59d70bbe7b4 /client | |
parent | 758f26b7d767f536a09ae38c28dfbf859377e66a (diff) | |
parent | 416e2f97bcaf93e4d2a782149a963fca95b8400e (diff) | |
download | vaadin-framework-e697d8b318c88d0acecd1fbb23231667fda5b4b8.tar.gz vaadin-framework-e697d8b318c88d0acecd1fbb23231667fda5b4b8.zip |
Merge "Merge branch 'master' into 7.2" into 7.2
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); |