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>
* @since 3.0
*/
@SuppressWarnings("serial")
-public class CustomLayout extends AbstractLayout {
+public class CustomLayout extends AbstractLayout implements Vaadin6Component {
private static final int BUFFER_SIZE = 10000;
"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);
+ }
+ }
+
}