aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-08-28 07:06:48 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-08-28 07:06:48 +0000
commit19d014438c158fa41a57e061778ad58b526379c6 (patch)
treecfa6f63006e01f6b38ccef75a47814533d99e3bb
parente3e48eab259227e908eceaffa28ea36864de8064 (diff)
downloadvaadin-framework-19d014438c158fa41a57e061778ad58b526379c6.tar.gz
vaadin-framework-19d014438c158fa41a57e061778ad58b526379c6.zip
now listening on focus hints
svn changeset:2138/svn branch:trunk
-rwxr-xr-xsrc/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java19
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");