Reviewers: amitmanjhi,
Description:
Fix dates inefficiently for a moment, pending Date fix to get JSO
friendly again
Please review this at http://gwt-code-reviews.appspot.com/195801
Affected files:
bikeshed/eclipse.README
bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java
user/super/com/google/gwt/emul/java/util/Date.java
Index: bikeshed/eclipse.README
===================================================================
--- bikeshed/eclipse.README (revision 0)
+++ bikeshed/eclipse.README (revision 0)
@@ -0,0 +1,22 @@
+To make eclipse go:
+
+* Set svn or git or whatever to exclude the following:
+
+.settings
+.classpath
+.project
+bin
+build
+classes
+com.google.gwt.*
+eclipse-trunk
+bikeshed/war/expenses
+bikeshed/war/stocks
+bikeshed/war/tree
+
+* Install the Google Plugin for Eclipse
+* Import bikeshed as a new Java project with existing source
+* Bring up the project properties and find the Google settings, and turn
on AppEngine and WebKit
+* Copy tools/redist/json/r2_20080312/json.jar to bikeshed/war/WEB_INF/lib
+* Right click on the bikeshed project and choose Run as > Web Application.
Choose from the various .html files
+
Index: bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java
===================================================================
--- bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java
(revision 7723)
+++ bikeshed/src/com/google/gwt/sample/expenses/client/ValuesImpl.java
(working copy)
@@ -15,7 +15,6 @@
*/
package com.google.gwt.sample.expenses.client;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.valuestore.shared.Property;
@@ -49,12 +48,13 @@
}
if (Date.class.equals(property.getValueType())) {
double millis = getDouble(property.getName());
- if (GWT.isScript()) {
- return (V) initDate(new Date(), millis);
- } else {
+ //TODO (rjrjr) bring this back when Date gets JSO friendly again
+// if (GWT.isScript()) {
+// return (V) initDate(new Date(), millis);
+// } else {
// In dev mode, we're using real JRE dates
return (V) new Date((long) millis);
- }
+// }
}
return nativeGet(property);
@@ -80,10 +80,10 @@
return this[name];
}-*/;
- private native Date initDate(Date date, double millis) /*-{
- da...@java.util.date::init(D)(millis);
- return date;
- }-*/;
+// private native Date initDate(Date date, double millis) /*-{
+// da...@java.util.date::init(D)(millis);
+// return date;
+// }-*/;
private native <V, P extends Property<T, V>> V nativeGet(P property) /*-{
return
this[proper...@com.google.gwt.valuestore.shared.property::getName()()];
Index: user/super/com/google/gwt/emul/java/util/Date.java
===================================================================
--- user/super/com/google/gwt/emul/java/util/Date.java (revision 7723)
+++ user/super/com/google/gwt/emul/java/util/Date.java (working copy)
@@ -71,7 +71,11 @@
private final JsDate jsdate;
public Date() {
- jsdate = JsDate.create();
+ this(JsDate.create());
+ }
+
+ protected Date(JsDate jsdate) {
+ this.jsdate = jsdate;
}
public Date(int year, int month, int date) {
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors