]> source.dussan.org Git - vaadin-framework.git/commitdiff
Cleaned log output
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Wed, 13 Jun 2007 12:55:56 +0000 (12:55 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Wed, 13 Jun 2007 12:55:56 +0000 (12:55 +0000)
svn changeset:1696/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/Client.java
src/com/itmill/toolkit/terminal/gwt/client/UIDL.java

index 990871181b808102ccd787f48ff76e7326559248..55b7f86a41fc7c7609351a3997a15513825dd6ac 100755 (executable)
@@ -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) {
index e1203950d38536c95523db71a2886b79a7375651..8b4c29592c8c0d4486ac836aeeb9a13ce30286f7 100644 (file)
@@ -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;
        }