aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-04-26 15:37:03 +0000
committerArtur Signell <artur.signell@itmill.com>2011-04-26 15:37:03 +0000
commit96f2068af62353155cce230276011984ae68fb96 (patch)
treed9345cc64d551dfd7e7d827d658feb9b00eba170 /src
parentedce21e05216e13cb04e5b085640cdd40b1d365e (diff)
downloadvaadin-framework-96f2068af62353155cce230276011984ae68fb96.tar.gz
vaadin-framework-96f2068af62353155cce230276011984ae68fb96.zip
#6716 Support for resizeLazy for sub window
svn changeset:18479/svn branch:6.6
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VWindow.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
index dd09559078..aae6cf0049 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
@@ -11,6 +11,7 @@ import java.util.Iterator;
import java.util.Set;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.DomEvent.Type;
@@ -136,6 +137,8 @@ public class VWindow extends VOverlay implements Container,
private boolean draggable = true;
+ private boolean resizeLazy = false;
+
private Element modalityCurtain;
private Element draggingCurtain;
@@ -178,6 +181,14 @@ public class VWindow extends VOverlay implements Container,
private int bringToFrontSequence = -1;
+ private VLazyExecutor delayedContentsSizeUpdater = new VLazyExecutor(200,
+ new ScheduledCommand() {
+
+ public void execute() {
+ updateContentsSize();
+ }
+ });
+
public VWindow() {
super(false, false, true); // no autohide, not modal, shadow
// Different style of shadow for windows
@@ -297,6 +308,7 @@ public class VWindow extends VOverlay implements Container,
if (uidl.getBooleanAttribute("resizable") != resizable) {
setResizable(!resizable);
}
+ resizeLazy = uidl.hasAttribute(VView.RESIZE_LAZY);
setDraggable(!uidl.hasAttribute("fixedposition"));
}
@@ -1020,6 +1032,16 @@ public class VWindow extends VOverlay implements Container,
client.updateVariable(id, "height", h, immediate);
}
+ if (updateVariables || !resizeLazy) {
+ // Resize has finished or is not lazy
+ updateContentsSize();
+ } else {
+ // Lazy resize - wait for a while before re-rendering contents
+ delayedContentsSizeUpdater.trigger();
+ }
+ }
+
+ private void updateContentsSize() {
// Update child widget dimensions
if (client != null) {
client.handleComponentRelativeSize((Widget) layout);