summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-04-18 17:07:16 +0300
committerLeif Åstrand <leif@vaadin.com>2012-04-18 17:07:16 +0300
commit0d95a362d9ee1a163affbbefb820ecdf75f21da0 (patch)
tree3323e7ac9ae138ff29d9d7254dfbff4fb4f6056d /src/com
parent5dabe8749011d0bac8c5791dd20d021478d46541 (diff)
downloadvaadin-framework-0d95a362d9ee1a163affbbefb820ecdf75f21da0.tar.gz
vaadin-framework-0d95a362d9ee1a163affbbefb820ecdf75f21da0.zip
Explicitly paint CustomLayout to send template to the client (#8688)
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/ui/CustomLayout.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/com/vaadin/ui/CustomLayout.java b/src/com/vaadin/ui/CustomLayout.java
index 0d74fe9878..97cea1c49d 100644
--- a/src/com/vaadin/ui/CustomLayout.java
+++ b/src/com/vaadin/ui/CustomLayout.java
@@ -9,8 +9,14 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.terminal.gwt.client.ui.customlayout.CustomLayoutState;
+import com.vaadin.terminal.gwt.server.JsonPaintTarget;
/**
* <p>
@@ -42,7 +48,7 @@ import com.vaadin.terminal.gwt.client.ui.customlayout.CustomLayoutState;
* @since 3.0
*/
@SuppressWarnings("serial")
-public class CustomLayout extends AbstractLayout {
+public class CustomLayout extends AbstractLayout implements Vaadin6Component {
private static final int BUFFER_SIZE = 10000;
@@ -299,4 +305,20 @@ public class CustomLayout extends AbstractLayout {
"CustomLayout does not support margins.");
}
+ public void changeVariables(Object source, Map<String, Object> variables) {
+ // Nothing to see here
+ }
+
+ public void paintContent(PaintTarget target) throws PaintException {
+ // Workaround to make the CommunicationManager read the template file
+ // and send it to the client
+ String templateName = getState().getTemplateName();
+ if (templateName != null && templateName.length() != 0) {
+ Set<Object> usedResources = ((JsonPaintTarget) target)
+ .getUsedResources();
+ String resourceName = "layouts/" + templateName + ".html";
+ usedResources.add(resourceName);
+ }
+ }
+
}