diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-12-28 10:10:02 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-12-28 10:10:02 +0000 |
commit | 7830dd06df20cee7292d909d92b9de780f64e2de (patch) | |
tree | 53e3f5a739138320531b528c1aa3210b91730c5e /src/com/vaadin/terminal/gwt/client/Util.java | |
parent | fce626683d65d112a936c414866d6c4afccfbb6e (diff) | |
download | vaadin-framework-7830dd06df20cee7292d909d92b9de780f64e2de.tar.gz vaadin-framework-7830dd06df20cee7292d909d92b9de780f64e2de.zip |
relocated debug code to helper class + fixed bug when reporting variables and when multiple bursts in queue
svn changeset:16682/svn branch:6.5
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/Util.java')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/Util.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index da69d67728..1f02f4cfa7 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -4,6 +4,7 @@ package com.vaadin.terminal.gwt.client; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -973,4 +974,46 @@ public class Util { return idx; } + private static void printPaintablesVariables(ArrayList<String[]> vars, + String id, ApplicationConnection c) { + Paintable paintable = c.getPaintable(id); + if (paintable != null) { + VConsole.log("\t" + id + " (" + paintable.getClass() + ") :"); + for (String[] var : vars) { + VConsole.log("\t\t" + var[1] + " (" + var[2] + ")" + " : " + + var[0]); + } + } + } + + static void logVariableBurst(ApplicationConnection c, + ArrayList<String> loggedBurst) { + try { + VConsole.log("Variable burst to be sent to server:"); + String curId = null; + ArrayList<String[]> vars = new ArrayList<String[]>(); + for (int i = 0; i < loggedBurst.size(); i++) { + String value = loggedBurst.get(i++); + String[] split = loggedBurst.get(i).split( + ApplicationConnection.VAR_FIELD_SEPARATOR); + String id = split[0]; + + if (curId == null) { + curId = id; + } else if (!curId.equals(id)) { + printPaintablesVariables(vars, curId, c); + vars.clear(); + curId = id; + } + split[0] = value; + vars.add(split); + } + if (!vars.isEmpty()) { + printPaintablesVariables(vars, curId, c); + } + } catch (Exception e) { + VConsole.error(e); + } + } + } |