From: Joonas Lehtinen Date: Wed, 13 Jun 2007 12:55:56 +0000 (+0000) Subject: Cleaned log output X-Git-Tag: 6.7.0.beta1~6281 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6965840e729dacb152f029b761f7d340847f0b42;p=vaadin-framework.git Cleaned log output svn changeset:1696/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/Client.java b/src/com/itmill/toolkit/terminal/gwt/client/Client.java index 990871181b..55b7f86a41 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/Client.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/Client.java @@ -93,7 +93,6 @@ public class Client implements EntryPoint { } }); - console.log("Request sent"); } catch (RequestException e) { console.error(e.getMessage()); @@ -103,7 +102,6 @@ public class Client implements EntryPoint { private void handleReceivedJSONMessage(Response response) { Date start = new Date(); - console.log(response.getText().substring(3) + "}"); System.out.println(response.getText().substring(3) + "}"); JSONValue json = JSONParser .parse(response.getText().substring(3) + "}"); @@ -112,7 +110,6 @@ public class Client implements EntryPoint { for (int i = 0; i < changes.size(); i++) { try { UIDL change = new UIDL((JSONArray) changes.get(i)); - console.log("Received the following change: "); try { console.dirUIDL(change); } catch (Exception e) { diff --git a/src/com/itmill/toolkit/terminal/gwt/client/UIDL.java b/src/com/itmill/toolkit/terminal/gwt/client/UIDL.java index e1203950d3..8b4c29592c 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/UIDL.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/UIDL.java @@ -158,25 +158,24 @@ public class UIDL { Tree t = new Tree(); t.addItem(dir()); Iterator it = t.treeItemIterator(); + int c = 0; while(it.hasNext()) - ((TreeItem) it.next()).setState(true); + ((TreeItem) it.next()).setState(c++ > 0); return t; } public TreeItem dir() { - TreeItem item = new TreeItem(getTag()); - TreeItem tmp = new TreeItem("attr"); - + String nodeName = getTag(); for (Iterator i = getAttributeNames().iterator(); i.hasNext();) { String name = i.next().toString(); String value = getAttribute(name); - tmp.addItem(name + "=" + value); + nodeName += " " + name + "=" + value; } - item.addItem(tmp); + TreeItem item = new TreeItem(nodeName); try { - tmp = new TreeItem("variables"); + TreeItem tmp = null; for (Iterator i = getVariableHash().keySet().iterator(); i.hasNext();) { String name = i.next().toString(); String value = ""; @@ -195,28 +194,26 @@ public class UIDL { } } } + if (tmp == null) tmp = new TreeItem("variables"); tmp.addItem(name + "=" + value); } - item.addItem(tmp); + if (tmp != null) item.addItem(tmp); } catch (Exception e) { // Ingonered, no variables } - tmp = new TreeItem("child nodes"); - Iterator i = getChildIterator(); while (i.hasNext()) { Object child = i.next(); try{ UIDL c = (UIDL) child; - tmp.addItem(c.dir()); + item.addItem(c.dir()); } catch (Exception e) { - tmp.addItem(child.toString()); + item.addItem(child.toString()); } } - item.addItem(tmp); return item; }