diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-08-28 07:06:48 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-08-28 07:06:48 +0000 |
commit | 19d014438c158fa41a57e061778ad58b526379c6 (patch) | |
tree | cfa6f63006e01f6b38ccef75a47814533d99e3bb | |
parent | e3e48eab259227e908eceaffa28ea36864de8064 (diff) | |
download | vaadin-framework-19d014438c158fa41a57e061778ad58b526379c6.tar.gz vaadin-framework-19d014438c158fa41a57e061778ad58b526379c6.zip |
now listening on focus hints
svn changeset:2138/svn branch:trunk
-rwxr-xr-x | src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index 1eb3942a7b..4c1b7d4e87 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -18,6 +18,7 @@ import com.google.gwt.json.client.JSONString; import com.google.gwt.json.client.JSONValue; import com.google.gwt.user.client.ui.FocusListener; import com.google.gwt.user.client.ui.FocusWidget; +import com.google.gwt.user.client.ui.HasFocus; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; @@ -172,13 +173,25 @@ public class ApplicationConnection implements EntryPoint, FocusListener { + uidl.getTag() + ", but there is no such paintable (" + uidl.getId() + ") registered yet."); - view.updateFromUIDL(uidl, this); - } + view.updateFromUIDL(uidl, this); + } } catch (Throwable e) { e.printStackTrace(); } - } + + if(((JSONObject) json).containsKey("meta")) { + JSONObject meta = ((JSONObject) json).get("meta").isObject(); + if(meta.containsKey("focus")) { + String focusPid = meta.get("focus").isString().stringValue(); + Paintable toBeFocused = this.getPaintable(focusPid); + if (toBeFocused instanceof HasFocus) { + HasFocus toBeFocusedWidget = (HasFocus) toBeFocused; + toBeFocusedWidget.setFocus(true); + } + } + } + long prosessingTime = (new Date().getTime()) - start.getTime(); console.log(" Processing time was " + String.valueOf(prosessingTime) + "ms for " + jsonText.length() + " characters of JSON"); |