Revision: 8649
Author: gwt.mirror...@gmail.com
Date: Wed Aug 25 23:35:42 2010
Log: Fix boolean properties, and punch up tests.
Review at http://gwt-code-reviews.appspot.com/755802
Review by: cromwell...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8649
Added:
/trunk/user/test/com/google/gwt/requestfactory/client/SimpleRequestFactoryInstance.java
/trunk/user/test/com/google/gwt/valuestore
/trunk/user/test/com/google/gwt/valuestore/server
/trunk/user/test/com/google/gwt/valuestore/server/SimpleFoo.java
Deleted:
/trunk/user/test/com/google/gwt/requestfactory/client/impl/SimpleFooRecordImpl.java
Modified:
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ReportRecord.java
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.java
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.ui.xml
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.ui.xml
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportListView.java
/trunk/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Report.java
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RecordJsoImpl.java
/trunk/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java
/trunk/user/test/com/google/gwt/requestfactory/client/impl/RecordJsoImplTest.java
/trunk/user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
/trunk/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
/trunk/user/test/com/google/gwt/requestfactory/server/SimpleFoo.java
/trunk/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecord.java
=======================================
--- /dev/null
+++
/trunk/user/test/com/google/gwt/requestfactory/client/SimpleRequestFactoryInstance.java
Wed Aug 25 23:35:42 2010
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.requestfactory.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.requestfactory.client.impl.RecordImpl;
+import com.google.gwt.requestfactory.client.impl.RecordSchema;
+import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import com.google.gwt.requestfactory.shared.SimpleRequestFactory;
+
+/**
+ * Easy access for RequestFactory tests.
+ */
+public class SimpleRequestFactoryInstance {
+ private static SimpleRequestFactory factory;
+
+ public static SimpleRequestFactory factory() {
+ if (factory == null) {
+ factory = GWT.create(SimpleRequestFactory.class);
+ }
+
+ return factory;
+ }
+
+ public static RecordSchema<?> schema() {
+ return ((RecordImpl)
factory().create(SimpleFooRecord.class)).getSchema();
+ }
+}
=======================================
--- /dev/null
+++ /trunk/user/test/com/google/gwt/valuestore/server/SimpleFoo.java Wed
Aug 25 23:35:42 2010
@@ -0,0 +1,334 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.valuestore.server;
+
+import com.google.gwt.requestfactory.server.SimpleBar;
+import com.google.gwt.requestfactory.shared.Id;
+import com.google.gwt.requestfactory.shared.SimpleEnum;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Domain object for SimpleFooRequest.
+ */
+public class SimpleFoo {
+
+ static SimpleFoo singleton = new SimpleFoo();
+
+ private static Long nextId = 1L;
+
+ public static Long countSimpleFoo() {
+ return 1L;
+ }
+
+ public static List<SimpleFoo> findAll() {
+ return Collections.singletonList(singleton);
+ }
+
+ public static SimpleFoo findSimpleFoo(Long id) {
+ return findSimpleFooById(id);
+ }
+
+ public static SimpleFoo findSimpleFooById(Long id) {
+ singleton.setId(id);
+ return singleton;
+ }
+
+ public static SimpleFoo getSingleton() {
+ return singleton;
+ }
+
+ public static void reset() {
+ singleton = new SimpleFoo();
+ }
+
+ @SuppressWarnings("unused")
+ private static Integer privateMethod() {
+ return 0;
+ }
+
+ Integer version = 1;
+
+ @Id
+ private Long id = 1L;
+
+ private Integer intId = -1;
+
+ private String password;
+
+ private String userName;
+
+ private Character charField;
+
+ private Long longField;
+
+ private BigDecimal bigDecimalField;
+
+ private BigInteger bigIntField;
+
+ private Short shortField;
+
+ private Byte byteField;
+
+ private Date created;
+
+ private Double doubleField;
+
+ private Float floatField;
+
+ private SimpleEnum enumField;
+
+ private Boolean boolField;
+
+ private Boolean otherBoolField;
+
+ private SimpleBar barField;
+
+ private SimpleFoo fooField;
+
+ public SimpleFoo() {
+ intId = 42;
+ version = 1;
+ userName = "GWT";
+ longField = 8L;
+ enumField = SimpleEnum.FOO;
+ created = new Date();
+ barField = SimpleBar.getSingleton();
+ boolField = true;
+ }
+
+ public Long countSimpleFooWithUserNameSideEffect() {
+ singleton.setUserName(userName);
+ return 1L;
+ }
+
+ public SimpleBar getBarField() {
+ return barField;
+ }
+
+ /**
+ * @return the bigDecimalField
+ */
+ public BigDecimal getBigDecimalField() {
+ return bigDecimalField;
+ }
+
+ /**
+ * @return the bigIntField
+ */
+ public BigInteger getBigIntField() {
+ return bigIntField;
+ }
+
+ public Boolean getBoolField() {
+ return boolField;
+ }
+
+ /**
+ * @return the byteField
+ */
+ public Byte getByteField() {
+ return byteField;
+ }
+
+ /**
+ * @return the charField
+ */
+ public Character getCharField() {
+ return charField;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ /**
+ * @return the doubleField
+ */
+ public Double getDoubleField() {
+ return doubleField;
+ }
+
+ public SimpleEnum getEnumField() {
+ return enumField;
+ }
+
+ /**
+ * @return the floatField
+ */
+ public Float getFloatField() {
+ return floatField;
+ }
+
+ public SimpleFoo getFooField() {
+ return fooField;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public Integer getIntId() {
+ return intId;
+ }
+
+ public Long getLongField() {
+ return longField;
+ }
+
+ /**
+ * @return the otherBoolField
+ */
+ public Boolean getOtherBoolField() {
+ return otherBoolField;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @return the shortField
+ */
+ public Short getShortField() {
+ return shortField;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public Integer getVersion() {
+ return version;
+ }
+
+ public String hello(SimpleBar bar) {
+ return "Greetings " + bar.getUserName() + " from " + getUserName();
+ }
+
+ public void persist() {
+ setId(nextId++);
+ }
+
+ public SimpleFoo persistAndReturnSelf() {
+ persist();
+ return this;
+ }
+
+ public void setBarField(SimpleBar barField) {
+ this.barField = barField;
+ }
+
+ /**
+ * @param bigDecimalField the bigDecimalField to set
+ */
+ public void setBigDecimalField(BigDecimal bigDecimalField) {
+ this.bigDecimalField = bigDecimalField;
+ }
+
+ /**
+ * @param bigIntField the bigIntField to set
+ */
+ public void setBigIntField(BigInteger bigIntField) {
+ this.bigIntField = bigIntField;
+ }
+
+ public void setBoolField(Boolean bool) {
+ boolField = bool;
+ }
+
+ /**
+ * @param byteField the byteField to set
+ */
+ public void setByteField(Byte byteField) {
+ this.byteField = byteField;
+ }
+
+ /**
+ * @param charField the charField to set
+ */
+ public void setCharField(Character charField) {
+ this.charField = charField;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ /**
+ * @param doubleField the doubleField to set
+ */
+ public void setDoubleField(Double doubleField) {
+ this.doubleField = doubleField;
+ }
+
+ public void setEnumField(SimpleEnum enumField) {
+ this.enumField = enumField;
+ }
+
+ /**
+ * @param floatField the floatField to set
+ */
+ public void setFloatField(Float floatField) {
+ this.floatField = floatField;
+ }
+
+ public void setFooField(SimpleFoo fooField) {
+ this.fooField = fooField;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public void setIntId(Integer id) {
+ this.intId = id;
+ }
+
+ public void setLongField(Long longField) {
+ this.longField = longField;
+ }
+
+ /**
+ * @param otherBoolField the otherBoolField to set
+ */
+ public void setOtherBoolField(Boolean otherBoolField) {
+ this.otherBoolField = otherBoolField;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @param shortField the shortField to set
+ */
+ public void setShortField(Short shortField) {
+ this.shortField = shortField;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+}
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/impl/SimpleFooRecordImpl.java
Wed Aug 25 17:41:41 2010
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
- * use this file except in compliance with the License. You may obtain a
copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
under
- * the License.
- */
-package com.google.gwt.requestfactory.client.impl;
-
-import com.google.gwt.requestfactory.shared.Property;
-import com.google.gwt.requestfactory.shared.Record;
-import com.google.gwt.requestfactory.shared.RecordChangedEvent;
-import com.google.gwt.requestfactory.shared.SimpleBarRecord;
-import com.google.gwt.requestfactory.shared.SimpleFooRecord;
-import com.google.gwt.requestfactory.shared.WriteOperation;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * The actual implementation of {...@link SimpleFooRecord}, which is normally
- * generated.
- *
- * TODO: Use the generator here.
- */
-public class SimpleFooRecordImpl extends RecordImpl implements
SimpleFooRecord {
-
- /**
- * The Schema class.
- */
- public static class MySchema extends RecordSchema<SimpleFooRecordImpl> {
-
- private final Set<Property<?>> allProperties;
-
- {
- Set<Property<?>> set = new HashSet<Property<?>>();
- set.addAll(super.allProperties());
- set.add(userName);
- set.add(password);
- set.add(boolField);
- set.add(intId);
- set.add(created);
- set.add(longField);
- set.add(enumField);
- allProperties = Collections.unmodifiableSet(set);
- }
- public MySchema() {
- super(SimpleFooRecord.class.getName());
- }
-
- @Override
- public Set<Property<?>> allProperties() {
- return allProperties;
- }
-
- @Override
- public SimpleFooRecordImpl create(RecordJsoImpl jso, boolean isFuture)
{
- return new SimpleFooRecordImpl(jso, isFuture);
- }
-
- @Override
- public RecordChangedEvent<?, ?> createChangeEvent(Record record,
- WriteOperation writeOperation) {
- // ignore
- return null;
- }
-
- @Override
- public Class<? extends Record> getProxyClass() {
- return SimpleFooRecord.class; // special field
- }
- }
-
- public static final RecordSchema<SimpleFooRecordImpl> SCHEMA = new
MySchema();
-
- private SimpleFooRecordImpl(RecordJsoImpl jso, boolean isFuture) {
- super(jso, isFuture);
- }
-
- public SimpleBarRecord getBarField() {
- return (SimpleBarRecord)
getValueStore().getRecordBySchemaAndId(SCHEMA, (Long) (Object)
get(barField));
- }
-
- public Boolean getBoolField() {
- return get(boolField);
- }
-
- public java.util.Date getCreated() {
- return get(created);
- }
-
- public com.google.gwt.requestfactory.shared.SimpleEnum getEnumField() {
- return get(enumField);
- }
-
- public SimpleFooRecord getFooField() {
- return (SimpleFooRecord)
getValueStore().getRecordBySchemaAndId(SCHEMA, (Long) (Object)
get(fooField));
- }
-
- public java.lang.Integer getIntId() {
- return get(intId);
- }
-
- public java.lang.Long getLongField() {
- return get(longField);
- }
-
- public java.lang.String getPassword() {
- return get(password);
- }
-
- public java.lang.String getUserName() {
- return get(userName);
- }
-
- public void setBarField(SimpleBarRecord barField) {
- // ignore
- }
-
- public void setBoolField(Boolean boolField) {
- // ignore
- }
-
- public void setCreated(Date created) {
- // ignore
- }
-
- public void setFooField(SimpleFooRecord fooField) {
- // ignore
- }
-
- public void setIntId(Integer intId) {
- // ignore
- }
-
- public void setLongField(Long longField) {
- // ignore
- }
-
- public void setPassword(String password) {
- // ignore
- }
-
- public void setUserName(String userName) {
- // ignore
- }
-
-}
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ReportRecord.java
Wed Aug 25 17:41:41 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ReportRecord.java
Wed Aug 25 23:35:42 2010
@@ -30,14 +30,20 @@
@DataTransferObject(com.google.gwt.sample.expenses.server.domain.Report.class)
public interface ReportRecord extends Record {
- Property<EmployeeRecord> approvedSupervisor = new
Property<EmployeeRecord>("approvedSupervisor", "Approved Supervisor Key",
- EmployeeRecord.class);
+ Property<Boolean> approved = new
Property<Boolean>("approved", "Approved",
+ Boolean.class);
+ Property<EmployeeRecord> approvedSupervisor = new
Property<EmployeeRecord>(
+ "approvedSupervisor", "Approved Supervisor Key",
EmployeeRecord.class);
Property<Date> created = new Property<Date>("created", "Created",
Date.class);
- Property<String> department = new
Property<String>("department", "Department", String.class);
+ Property<String> department = new Property<String>("department",
+ "Department", String.class);
Property<String> notes = new Property<String>("notes", "Notes",
String.class);
- Property<String> purpose = new Property<String>("purpose", "Purpose",
String.class);
- Property<EmployeeRecord> reporter = new
Property<EmployeeRecord>("reporter", "Reporter",
- EmployeeRecord.class);
+ Property<String> purpose = new Property<String>("purpose", "Purpose",
+ String.class);
+ Property<EmployeeRecord> reporter = new
Property<EmployeeRecord>("reporter",
+ "Reporter", EmployeeRecord.class);
+
+ Boolean getApproved();
EmployeeRecord getApprovedSupervisor();
@@ -48,11 +54,13 @@
String getNotes();
String getPurpose();
-
+
EmployeeRecord getReporter();
boolean isChanged();
+ void setApproved(Boolean approved);
+
void setApprovedSupervisor(EmployeeRecord approvedSupervisor);
void setCreated(Date created);
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.java
Fri Aug 20 04:22:09 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.java
Wed Aug 25 23:35:42 2010
@@ -15,6 +15,7 @@
*/
package com.google.gwt.sample.expenses.gwt.ui.report;
+import com.google.gwt.app.client.BooleanRenderer;
import com.google.gwt.app.place.RecordDetailsView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
@@ -57,6 +58,8 @@
@UiField
SpanElement approvedSupervisorKey;
@UiField
+ SpanElement approved;
+ @UiField
HasClickHandlers edit;
@UiField
HasClickHandlers delete;
@@ -102,5 +105,6 @@
versionSpan.setInnerText(record.getVersion().toString());
reporterKey.setInnerText(EmployeeRenderer.instance().render(record.getReporter()));
approvedSupervisorKey.setInnerText(EmployeeRenderer.instance().render(record.getApprovedSupervisor()));
+
approved.setInnerText(BooleanRenderer.instance().render(record.getApproved()));
}
}
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.ui.xml
Mon Jun 7 12:20:31 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.ui.xml
Wed Aug 25 23:35:42 2010
@@ -38,6 +38,7 @@
<tr><td><div class='{style.label}'>Created:</div></td><td><span
ui:field='created'></span></td></tr>
<tr><td><div class='{style.label}'>Reporter Key:</div></td><td><span
ui:field='reporterKey'></span></td></tr>
<tr><td><div class='{style.label}'>Approved Supervisor
Key:</div></td><td><span ui:field='approvedSupervisorKey'></span></td></tr>
+ <tr><td><div class='{style.label}'>Approved:</div></td><td><span
ui:field='approved'></span></td></tr>
</table>
<div class='{style.bar}'>
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java
Fri Aug 20 04:22:09 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java
Wed Aug 25 23:35:42 2010
@@ -29,6 +29,7 @@
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.InlineLabel;
@@ -53,20 +54,40 @@
private static final Binder BINDER = GWT.create(Binder.class);
private static final DataBinder DATA_BINDER =
GWT.create(DataBinder.class);
- @UiField TextBox notes;
- @UiField TextBox purpose;
- @UiField(provided = true) ValueListBox<EmployeeRecord> reporter =
- new ValueListBox<EmployeeRecord>(EmployeeRenderer.instance());
- @UiField(provided = true) ValueListBox<EmployeeRecord>
approvedSupervisor =
- new ValueListBox<EmployeeRecord>(EmployeeRenderer.instance());
- @UiField DateBox created;
- @UiField Button cancel;
- @UiField Button save;
- @UiField InlineLabel id;
- @UiField InlineLabel version;
- @UiField DivElement errors;
- @UiField Element editTitle;
- @UiField Element createTitle;
+ @UiField
+ TextBox notes;
+ @UiField
+ TextBox purpose;
+ @UiField(provided = true)
+ ValueListBox<EmployeeRecord> reporter = new ValueListBox<EmployeeRecord>(
+ EmployeeRenderer.instance());
+ @UiField(provided = true)
+ CheckBox approved = new CheckBox() {
+ @Override
+ public void setValue(Boolean value, boolean fire) {
+ value = value == null ? false : value;
+ super.setValue(value, fire);
+ }
+ };
+ @UiField(provided = true)
+ ValueListBox<EmployeeRecord> approvedSupervisor = new
ValueListBox<EmployeeRecord>(
+ EmployeeRenderer.instance());
+ @UiField
+ DateBox created;
+ @UiField
+ Button cancel;
+ @UiField
+ Button save;
+ @UiField
+ InlineLabel id;
+ @UiField
+ InlineLabel version;
+ @UiField
+ DivElement errors;
+ @UiField
+ Element editTitle;
+ @UiField
+ Element createTitle;
private Delegate delegate;
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.ui.xml
Fri Aug 20 04:22:09 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.ui.xml
Wed Aug 25 23:35:42 2010
@@ -44,6 +44,7 @@
<tr><td><div class='{style.label}'>Created:</div></td><td><d:DateBox
ui:field='created'></d:DateBox></td></tr>
<tr><td><div
class='{style.label}'>Reporter:</div></td><td><g:ValueListBox
ui:field='reporter'></g:ValueListBox></td></tr>
<tr><td><div class='{style.label}'>Approved
Supervisor:</div></td><td><g:ValueListBox
ui:field='approvedSupervisor'></g:ValueListBox></td></tr>
+ <tr><td><div
class='{style.label}'>Approved:</div></td><td><g:CheckBox
ui:field='approved'></g:CheckBox></td></tr>
</table>
<div class='{style.bar}'>
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportListView.java
Fri Aug 20 04:22:09 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportListView.java
Wed Aug 25 23:35:42 2010
@@ -15,11 +15,13 @@
*/
package com.google.gwt.sample.expenses.gwt.ui.report;
+import com.google.gwt.app.client.BooleanRenderer;
import com.google.gwt.app.place.AbstractRecordListView;
import com.google.gwt.app.place.PropertyColumn;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.DateTimeFormatRenderer;
+import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
import com.google.gwt.sample.expenses.gwt.request.EmployeeRecord;
import com.google.gwt.sample.expenses.gwt.request.ReportRecord;
import com.google.gwt.sample.expenses.gwt.ui.employee.EmployeeRenderer;
@@ -57,7 +59,7 @@
List<PropertyColumn<ReportRecord, ?>> columns = new
ArrayList<PropertyColumn<ReportRecord, ?>>();
columns.add(new PropertyColumn<ReportRecord,
Date>(ReportRecord.created,
- new DateTimeFormatRenderer(DateTimeFormat.getShortDateFormat())));
+ new
DateTimeFormatRenderer(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT))));
columns.add(PropertyColumn.<ReportRecord>
getStringPropertyColumn(ReportRecord.purpose));
@@ -67,6 +69,9 @@
columns.add(new PropertyColumn<ReportRecord, EmployeeRecord>(
ReportRecord.approvedSupervisor, EmployeeRenderer.instance()));
+ columns.add(new PropertyColumn<ReportRecord, Boolean>(
+ ReportRecord.approved, BooleanRenderer.instance()));
+
return columns;
}
}
=======================================
---
/trunk/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Report.java
Thu Aug 19 17:13:42 2010
+++
/trunk/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Report.java
Wed Aug 25 23:35:42 2010
@@ -36,7 +36,6 @@
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Query;
-import javax.persistence.Transient;
import javax.persistence.Version;
/**
@@ -336,12 +335,6 @@
}
return query;
}
-
- @Transient
- private Employee approvedSupervisor;
-
- @Transient
- private Employee reporter;
// @JoinColumn
@@ -359,13 +352,15 @@
private String notes;
private String purpose;
-
+
+ private Boolean approved;
+
/**
* Store a lower case version of the purpose for searching.
*/
@SuppressWarnings("unused")
private String purposeLowerCase;
-
+
/**
* Store reporter's key instead of reporter. See:
http://code.google.com/appengine
* /docs/java/datastore/relationships.html#Unowned_Relationships
@@ -377,6 +372,10 @@
@Column(name = "version")
private Integer version;
+ public Boolean getApproved() {
+ return approved;
+ }
+
public Employee getApprovedSupervisor() {
return approvedSupervisorKey != null ? Employee.findEmployee(
approvedSupervisorKey) : null;
@@ -436,6 +435,10 @@
em.close();
}
}
+
+ public void setApproved(Boolean approved) {
+ this.approved = approved;
+ }
public void setApprovedSupervisor(Employee reporter) {
approvedSupervisorKey = reporter == null ? null : reporter.getId();
=======================================
---
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RecordJsoImpl.java
Wed Aug 25 17:41:41 2010
+++
/trunk/user/src/com/google/gwt/requestfactory/client/impl/RecordJsoImpl.java
Wed Aug 25 23:35:42 2010
@@ -177,9 +177,9 @@
if (property instanceof EnumProperty) {
EnumProperty<V> eProperty = (EnumProperty<V>) property;
- Enum[] values = (Enum[]) eProperty.getValues();
+ Enum<?>[] values = (Enum[]) eProperty.getValues();
int ordinal = getInt(property.getName());
- for (Enum value : values) {
+ for (Enum<?> value : values) {
if (ordinal == value.ordinal()) {
return (V) value;
}
@@ -311,6 +311,7 @@
if (value instanceof Boolean) {
setBoolean(property.getName(), ((Boolean) value).booleanValue());
+ return;
}
if (value instanceof RecordImpl) {
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java
Wed Aug 25 17:41:41 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/client/impl/DeltaValueStoreJsonImplTest.java
Wed Aug 25 23:35:42 2010
@@ -15,12 +15,11 @@
*/
package com.google.gwt.requestfactory.client.impl;
-import com.google.gwt.event.shared.EventBus;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.junit.client.GWTTestCase;
-import com.google.gwt.requestfactory.shared.LoggingRequest;
+import com.google.gwt.requestfactory.client.SimpleRequestFactoryInstance;
import com.google.gwt.requestfactory.shared.Record;
import com.google.gwt.requestfactory.shared.SimpleFooRecord;
import com.google.gwt.requestfactory.shared.WriteOperation;
@@ -32,6 +31,8 @@
*/
public class DeltaValueStoreJsonImplTest extends GWTTestCase {
+ private static final String SIMPLE_FOO_CLASS_NAME
= "com.google.gwt.requestfactory.shared.SimpleFooRecord";
+
/*
* sub-classed it here so that the protected constructor of {...@link
RecordImpl}
* can remain as such.
@@ -43,30 +44,6 @@
}
}
- final RecordToTypeMap typeMap = new RecordToTypeMap() {
- @SuppressWarnings("unchecked")
- public <R extends Record> RecordSchema<R> getType(Class<R>
recordClass) {
- if (recordClass.equals(SimpleFooRecord.class)) {
- return (RecordSchema<R>) SimpleFooRecordImpl.SCHEMA;
- }
- throw new IllegalArgumentException("Unknown token " + recordClass);
- }
-
- public RecordSchema<? extends Record> getType(
- String recordClass) {
- if (recordClass.equals("simple-foo-class-token")) {
- return SimpleFooRecordImpl.SCHEMA;
- }
- throw new IllegalArgumentException("Unknown token " + recordClass);
- }
-
- public String getClassToken(Class<?> recordClass) {
- if (recordClass.equals(SimpleFooRecord.class)) {
- return "simple-foo-class-token";
- }
- throw new IllegalArgumentException("Unknown token " + recordClass);
- }
- };
ValueStoreJsonImpl valueStore = null;
RequestFactoryJsonImpl requestFactory = null;
@@ -80,42 +57,7 @@
@Override
public void gwtSetUp() {
valueStore = new ValueStoreJsonImpl();
- requestFactory = new RequestFactoryJsonImpl() {
-
- public <R extends Record> R create(Class<R> token) {
- return create(token, typeMap);
- }
-
- @Override
- public RecordSchema<?> getSchema(String token) {
- return typeMap.getType(token);
- }
-
- @Override
- public void init(EventBus eventBus) {
- // ignore.
- }
-
- public LoggingRequest loggingRequest() {
- return null; // ignore
- }
-
- public Class<? extends Record> getClass(String token) {
- throw new UnsupportedOperationException("Auto-generated method
stub");
- }
-
- public Record getProxy(String token) {
- throw new UnsupportedOperationException("Auto-generated method
stub");
- }
-
- public String getToken(Class<? extends Record> clazz) {
- throw new UnsupportedOperationException("Auto-generated method
stub");
- }
-
- public String getToken(Record proxy) {
- throw new UnsupportedOperationException("Auto-generated method
stub");
- }
- };
+ requestFactory = (RequestFactoryJsonImpl)
SimpleRequestFactoryInstance.factory();
// add a record
jso = RecordJsoImpl.fromJson("{}");
@@ -125,7 +67,9 @@
jso.set(SimpleFooRecord.password, "bovik");
jso.set(SimpleFooRecord.intId, 4);
jso.set(SimpleFooRecord.created, new Date());
- jso.setSchema(SimpleFooRecordImpl.SCHEMA);
+ jso.set(SimpleFooRecord.boolField, false);
+ jso.set(SimpleFooRecord.otherBoolField, true);
+ jso.setSchema(SimpleRequestFactoryInstance.schema());
valueStore.setRecord(jso, requestFactory);
}
@@ -145,7 +89,7 @@
Record created = requestFactory.create(SimpleFooRecord.class);
assertNotNull(created.getId());
assertNotNull(created.getVersion());
-
+
DeltaValueStoreJsonImpl deltaValueStore = new DeltaValueStoreJsonImpl(
valueStore, requestFactory);
// DVS does not know about the created entity.
@@ -198,7 +142,7 @@
Long futureId = createRecord.getId();
RecordImpl mockRecord = new RecordImpl(RecordJsoImpl.create(futureId,
1,
- SimpleFooRecordImpl.SCHEMA), RequestFactoryJsonImpl.NOT_FUTURE);
+ SimpleRequestFactoryInstance.schema()),
RequestFactoryJsonImpl.NOT_FUTURE);
valueStore.setRecord(mockRecord.asJso(), requestFactory); // marked as
non-future..
DeltaValueStoreJsonImpl deltaValueStore = new DeltaValueStoreJsonImpl(
valueStore, requestFactory);
@@ -216,14 +160,14 @@
WriteOperation.CREATE.name()).isArray();
assertEquals(1, createOperationArray.size());
assertEquals("harry", createOperationArray.get(0).isObject().get(
- SimpleFooRecord.class.getName()).isObject().get(
+ SIMPLE_FOO_CLASS_NAME).isObject().get(
SimpleFooRecord.userName.getName()).isString().stringValue());
JSONArray updateOperationArray = jsonObject.get(
WriteOperation.UPDATE.name()).isArray();
assertEquals(1, updateOperationArray.size());
assertEquals("bovik", updateOperationArray.get(0).isObject().get(
- SimpleFooRecord.class.getName()).isObject().get(
+ SIMPLE_FOO_CLASS_NAME).isObject().get(
SimpleFooRecord.userName.getName()).isString().stringValue());
}
@@ -256,9 +200,9 @@
JSONObject recordWithName = writeOperationArray.get(0).isObject();
assertEquals(1, recordWithName.size());
-
assertTrue(recordWithName.containsKey(SimpleFooRecord.class.getName()));
-
- JSONObject record =
recordWithName.get(SimpleFooRecord.class.getName()).isObject();
+ assertTrue(recordWithName.containsKey(SIMPLE_FOO_CLASS_NAME));
+
+ JSONObject record =
recordWithName.get(SIMPLE_FOO_CLASS_NAME).isObject();
assertTrue(record.containsKey("id"));
assertTrue(record.containsKey("version"));
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/impl/RecordJsoImplTest.java
Wed Aug 25 17:41:41 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/client/impl/RecordJsoImplTest.java
Wed Aug 25 23:35:42 2010
@@ -17,8 +17,11 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.requestfactory.client.SimpleRequestFactoryInstance;
import com.google.gwt.requestfactory.shared.SimpleFooRecord;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.util.Date;
/**
@@ -26,7 +29,54 @@
*/
public class RecordJsoImplTest extends GWTTestCase {
- private static final String ALL_PROPERTIES_JSON
= "{\"id\":\"42\",\"version\":1,\"userName\":\"bovik\",\"password\":\"bovik\",\"intId\":4,\"created\":\"400\"}";
+ private static final String ALL_PROPERTIES_JSON;
+ static {
+ StringBuilder b = new StringBuilder();
+ b.append("{");
+
+ String[] stringBits = new String[] {
+ "userName", "bovik", "password", "bovik", "charField", "c",
+ "longField", "1234567890", "bigDecimalField",
+ "12345678901234.5678901234567890", "bigIntField",
+ "123456789012345678901234567890", "created", "400", "id", "42"};
+
+ String[] literalBits = new String[] {
+ "version", "1", "intId", "4", "shortField", "5",
+ "byteField", "6", "floatField", "12.3456789", "doubleField",
+ "12345.6789", "boolField", "false", "otherBoolField", "true"};
+
+ boolean isFirst = true;
+ boolean isLabel = true;
+ for (String s : stringBits) {
+
+ if (isLabel) {
+ if (isFirst) {
+ isFirst = false;
+ } else {
+ b.append(",");
+ }
+ b.append("\"").append(s).append("\":");
+ } else {
+ b.append("\"").append(s).append("\"");
+ }
+ isLabel = !isLabel;
+ }
+
+ for (String s : literalBits) {
+ if (isLabel) {
+ b.append(",");
+ b.append("\"").append(s).append("\":");
+ } else {
+ b.append(s);
+ }
+ isLabel = !isLabel;
+ }
+
+ b.append("}");
+
+ ALL_PROPERTIES_JSON = b.toString();
+ }
+
private static final String EMPTY_JSON = "{}";
private static final String ID_VERSION_JSON
= "{\"id\":\"42\",\"version\":1}";
private static final String ID_VERSION_JSON2
= "{\"id\":\"43\",\"version\":1}";
@@ -70,10 +120,30 @@
public void testSet() {
RecordJsoImpl jso = getMinimalJso();
+
jso.set(SimpleFooRecord.userName, "bovik");
jso.set(SimpleFooRecord.password, "bovik");
+
+ jso.set(SimpleFooRecord.charField, 'c');
+
+ jso.set(SimpleFooRecord.longField, 1234567890L);
+ jso.set(SimpleFooRecord.bigDecimalField, new BigDecimal(
+ "12345678901234.5678901234567890"));
+ jso.set(SimpleFooRecord.bigIntField, new BigInteger(
+ "123456789012345678901234567890"));
+
jso.set(SimpleFooRecord.intId, 4);
+ jso.set(SimpleFooRecord.shortField, (short) 5);
+ jso.set(SimpleFooRecord.byteField, (byte) 6);
+
jso.set(SimpleFooRecord.created, new Date(400));
+
+ jso.set(SimpleFooRecord.doubleField, 12345.6789);
+ jso.set(SimpleFooRecord.floatField, 12.3456789f);
+
+ jso.set(SimpleFooRecord.boolField, false);
+ jso.set(SimpleFooRecord.otherBoolField, true);
+
testPopulatedJso(jso, SCHEMA_PRESENT);
}
@@ -86,7 +156,7 @@
}
private RecordJsoImpl getMinimalJso() {
- return RecordJsoImpl.create(42L, 1, SimpleFooRecordImpl.SCHEMA);
+ return RecordJsoImpl.create(42L, 1,
SimpleRequestFactoryInstance.schema());
}
private RecordJsoImpl getPopulatedJso() {
@@ -106,10 +176,10 @@
}
private void testMinimalJso(RecordJsoImpl jso, boolean schemaPresent) {
- for (String property : new String[]{"id", "version"}) {
+ for (String property : new String[] {"id", "version"}) {
assertTrue(jso.isDefined(property));
}
- for (String property : new String[]{
+ for (String property : new String[] {
"created", "intId", "userName", "password"}) {
assertFalse(jso.isDefined(property));
assertNull(jso.get(property));
@@ -122,22 +192,48 @@
}
private void testPopulatedJso(RecordJsoImpl jso, boolean schemaPresent) {
- for (String property : new String[]{
- "id", "version", "created", "intId", "userName", "password"}) {
- assertTrue(jso.isDefined(property));
- }
- assertEquals((Long) 42L, jso.getId());
- assertEquals(new Integer(1), jso.getVersion());
+ for (String property : new String[] {
+ "userName", "password", "charField", "longField", "bigDecimalField",
+ "bigIntField", "intId", "shortField", "byteField", "created",
+ "doubleField", "floatField", "boolField", "otherBoolField", "id",
+ "version"}) {
+ assertTrue("Expect " + property + " to be defined",
+ jso.isDefined(property));
+ }
assertEquals("bovik", jso.get(SimpleFooRecord.userName));
assertEquals("bovik", jso.get(SimpleFooRecord.password));
- assertEquals(new Integer(4), jso.get(SimpleFooRecord.intId));
+
+ assertEquals(new Character('c'), jso.get(SimpleFooRecord.charField));
+
+ assertEquals(new Long(1234567890L),
jso.get(SimpleFooRecord.longField));
+ assertEquals(new BigDecimal("12345678901234.5678901234567890"),
+ jso.get(SimpleFooRecord.bigDecimalField));
+ assertEquals(new BigInteger("123456789012345678901234567890"),
+ jso.get(SimpleFooRecord.bigIntField));
+
+ assertEquals(Integer.valueOf(4), jso.get(SimpleFooRecord.intId));
+ assertEquals(Short.valueOf((short) 5),
jso.get(SimpleFooRecord.shortField));
+ assertEquals(Byte.valueOf((byte) 6),
jso.get(SimpleFooRecord.byteField));
+
assertEquals(new Date(400), jso.get(SimpleFooRecord.created));
+ assertEquals(Double.valueOf(12345.6789),
jso.get(SimpleFooRecord.doubleField));
+
+ int expected = (int) (Float.valueOf(12.3456789f) * 1000);
+ int actual = (int) (jso.get(SimpleFooRecord.floatField) * 1000);
+ assertEquals(expected, actual);
+
+ assertFalse(jso.get(SimpleFooRecord.boolField));
+ assertTrue(jso.get(SimpleFooRecord.otherBoolField));
+
+ assertEquals((Long) 42L, jso.getId());
+ assertEquals(new Integer(1), jso.getVersion());
+
testSchema(jso, schemaPresent);
}
private void testSchema(RecordJsoImpl jso, boolean schemaPresent) {
if (schemaPresent) {
- assertEquals(SimpleFooRecordImpl.SCHEMA, jso.getSchema());
+ assertEquals(SimpleRequestFactoryInstance.schema(), jso.getSchema());
} else {
assertNull(jso.getSchema());
}
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
Fri Aug 13 10:45:41 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/client/impl/RecordKeyTest.java
Wed Aug 25 23:35:42 2010
@@ -15,15 +15,44 @@
*/
package com.google.gwt.requestfactory.client.impl;
+import com.google.gwt.requestfactory.shared.Record;
+import com.google.gwt.requestfactory.shared.RecordChangedEvent;
+import com.google.gwt.requestfactory.shared.WriteOperation;
+
import junit.framework.TestCase;
/**
- * Tests for {...@link RecordJsoImpl}.
+ * Eponymous unit test.
*/
public class RecordKeyTest extends TestCase {
+ static class Schema1 extends RecordSchema<Record> {
+ public Schema1() {
+ super("schemey");
+ }
+
+ @Override
+ public Record create(RecordJsoImpl jso, boolean isFuture) {
+ throw new UnsupportedOperationException("Auto-generated method
stub");
+ }
+
+ @Override
+ public RecordChangedEvent<?, ?> createChangeEvent(Record record,
+ WriteOperation writeOperation) {
+ throw new UnsupportedOperationException("Auto-generated method
stub");
+ }
+
+ @Override
+ public Class<? extends Record> getProxyClass() {
+ throw new UnsupportedOperationException("Auto-generated method
stub");
+ }
+ }
+
+ static class Schema2 extends Schema1 {
+ }
+
public void testEquals() {
- RecordKey newKey1 = new RecordKey(1L, SimpleFooRecordImpl.SCHEMA,
+ RecordKey newKey1 = new RecordKey(1L, new Schema1(),
RequestFactoryJsonImpl.IS_FUTURE);
RecordKey anotherNewKey1 = new RecordKey(newKey1.id, newKey1.schema,
@@ -37,7 +66,7 @@
assertFalse(newKey1.hashCode() == newKey2.hashCode());
RecordKey newKey1NoSchema = new RecordKey(newKey1.id,
- SimpleBazRecordImpl.SCHEMA, newKey1.isFuture);
+ new Schema2(), newKey1.isFuture);
assertFalse(newKey1.equals(newKey1NoSchema));
assertFalse(newKey1.hashCode() == newKey1NoSchema.hashCode());
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
Wed Aug 25 17:41:41 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/server/JsonRequestProcessorTest.java
Wed Aug 25 23:35:42 2010
@@ -115,7 +115,7 @@
assertEquals(1, updateArray.getJSONObject(0).length());
assertTrue(updateArray.getJSONObject(0).has("id"));
assertFalse(updateArray.getJSONObject(0).has("violations"));
- assertEquals((int) 45, (int) fooResult.getIntId());
+ assertEquals(45, (int) fooResult.getIntId());
assertEquals("JSC", fooResult.getUserName());
assertEquals(now, fooResult.getCreated());
assertEquals(9L, (long) fooResult.getLongField());
@@ -148,7 +148,7 @@
// check modified fields and no violations
assertFalse(result.getJSONObject("sideEffects").has("UPDATE"));
fooResult = SimpleFoo.getSingleton();
- assertEquals((int) 45, (int) fooResult.getIntId());
+ assertEquals(45, (int) fooResult.getIntId());
assertEquals("JSC", fooResult.getUserName());
} catch (Exception e) {
e.printStackTrace();
@@ -177,7 +177,7 @@
// check modified fields and no violations
assertTrue(result.getJSONObject("sideEffects").has("UPDATE"));
fooResult = SimpleFoo.getSingleton();
- assertEquals((int) 45, (int) fooResult.getIntId());
+ assertEquals(45, (int) fooResult.getIntId());
assertEquals("JSC", fooResult.getUserName());
assertEquals(newTime, fooResult.getCreated().getTime());
} catch (Exception e) {
=======================================
--- /trunk/user/test/com/google/gwt/requestfactory/server/SimpleFoo.java
Wed Aug 25 17:41:41 2010
+++ /trunk/user/test/com/google/gwt/requestfactory/server/SimpleFoo.java
Wed Aug 25 20:23:14 2010
@@ -18,6 +18,8 @@
import com.google.gwt.requestfactory.shared.Id;
import com.google.gwt.requestfactory.shared.SimpleEnum;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -51,15 +53,6 @@
public static SimpleFoo getSingleton() {
return singleton;
}
-
- public Long countSimpleFooWithUserNameSideEffect() {
- singleton.setUserName(userName);
- return 1L;
- }
-
- public String hello(SimpleBar bar) {
- return "Greetings " + bar.getUserName() + " from " + getUserName();
- }
public static void reset() {
singleton = new SimpleFoo();
@@ -70,24 +63,36 @@
return 0;
}
- Integer version = 1;
-
- private Boolean boolField;
- private Date created;
- private SimpleEnum enumField;
@Id
private Long id = 1L;
- private Integer intId = -1;
-
+ Integer version = 1;
+
+ private String userName;
+ private String password;
+
+ private Character charField;
private Long longField;
- private String password;
-
- private String userName;
+ private BigDecimal bigDecimalField;
+
+ private BigInteger bigIntField;
+ private Integer intId = -1;
+ private Short shortField;
+
+ private Byte byteField;
+
+ private Date created;
+ private Double doubleField;
+
+ private Float floatField;
+
+ private SimpleEnum enumField;
+ private Boolean boolField;
+
+ private Boolean otherBoolField;
private SimpleBar barField;
-
private SimpleFoo fooField;
public SimpleFoo() {
@@ -100,22 +105,69 @@
barField = SimpleBar.getSingleton();
boolField = true;
}
+
+ public Long countSimpleFooWithUserNameSideEffect() {
+ singleton.setUserName(userName);
+ return 1L;
+ }
public SimpleBar getBarField() {
return barField;
}
+
+ /**
+ * @return the bigDecimalField
+ */
+ public BigDecimal getBigDecimalField() {
+ return bigDecimalField;
+ }
+
+ /**
+ * @return the bigIntegerField
+ */
+ public BigInteger getBigIntField() {
+ return bigIntField;
+ }
public Boolean getBoolField() {
return boolField;
}
+
+ /**
+ * @return the byteField
+ */
+ public Byte getByteField() {
+ return byteField;
+ }
+
+ /**
+ * @return the charField
+ */
+ public Character getCharField() {
+ return charField;
+ }
public Date getCreated() {
return created;
}
+
+ /**
+ * @return the doubleField
+ */
+ public Double getDoubleField() {
+ return doubleField;
+ }
public SimpleEnum getEnumField() {
return enumField;
}
+
+ /**
+ * @return the floatField
+ */
+ public Float getFloatField() {
+ return floatField;
+ }
public SimpleFoo getFooField() {
return fooField;
@@ -133,9 +185,22 @@
return longField;
}
+ /**
+ * @return the otherBoolField
+ */
+ public Boolean getOtherBoolField() {
+ return otherBoolField;
+ }
public String getPassword() {
return password;
}
+
+ /**
+ * @return the shortField
+ */
+ public Short getShortField() {
+ return shortField;
+ }
public String getUserName() {
return userName;
@@ -144,6 +209,10 @@
public Integer getVersion() {
return version;
}
+
+ public String hello(SimpleBar bar) {
+ return "Greetings " + bar.getUserName() + " from " + getUserName();
+ }
public void persist() {
setId(nextId++);
@@ -157,19 +226,61 @@
public void setBarField(SimpleBar barField) {
this.barField = barField;
}
+
+ /**
+ * @param bigDecimalField the bigDecimalField to set
+ */
+ public void setBigDecimalField(BigDecimal bigDecimalField) {
+ this.bigDecimalField = bigDecimalField;
+ }
+
+ /**
+ * @param bigIntegerField the bigIntegerField to set
+ */
+ public void setBigIntField(BigInteger bigIntegerField) {
+ this.bigIntField = bigIntegerField;
+ }
public void setBoolField(Boolean bool) {
boolField = bool;
}
-
+
+ /**
+ * @param byteField the byteField to set
+ */
+ public void setByteField(Byte byteField) {
+ this.byteField = byteField;
+ }
+
+ /**
+ * @param charField the charField to set
+ */
+ public void setCharField(Character charField) {
+ this.charField = charField;
+ }
+
public void setCreated(Date created) {
this.created = created;
}
+
+ /**
+ * @param doubleField the doubleField to set
+ */
+ public void setDoubleField(Double doubleField) {
+ this.doubleField = doubleField;
+ }
public void setEnumField(SimpleEnum enumField) {
this.enumField = enumField;
}
+ /**
+ * @param floatField the floatField to set
+ */
+ public void setFloatField(Float floatField) {
+ this.floatField = floatField;
+ }
+
public void setFooField(SimpleFoo fooField) {
this.fooField = fooField;
}
@@ -185,10 +296,24 @@
public void setLongField(Long longField) {
this.longField = longField;
}
+
+ /**
+ * @param otherBoolField the otherBoolField to set
+ */
+ public void setOtherBoolField(Boolean otherBoolField) {
+ this.otherBoolField = otherBoolField;
+ }
public void setPassword(String password) {
this.password = password;
}
+
+ /**
+ * @param shortField the shortField to set
+ */
+ public void setShortField(Short shortField) {
+ this.shortField = shortField;
+ }
public void setUserName(String userName) {
this.userName = userName;
=======================================
---
/trunk/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecord.java
Wed Aug 25 17:41:41 2010
+++
/trunk/user/test/com/google/gwt/requestfactory/shared/SimpleFooRecord.java
Wed Aug 25 20:23:14 2010
@@ -17,6 +17,8 @@
import com.google.gwt.requestfactory.server.SimpleFoo;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.util.Date;
/**
@@ -30,14 +32,29 @@
String.class);
Property<String> password = new Property<String>("password", "Password",
String.class);
- Property<Boolean> boolField = new Property<Boolean>("boolField",
Boolean.class);
+
+ Property<Character> charField = new Property<Character>("charField",
Character.class);
+
+ Property<Long> longField = new Property<Long>("longField", Long.class);
+ Property<BigDecimal> bigDecimalField = new
Property<BigDecimal>("bigDecimalField", BigDecimal.class);
+ Property<BigInteger> bigIntField = new
Property<BigInteger>("bigIntField", BigInteger.class);
+
Property<Integer> intId = new Property<Integer>("intId", Integer.class);
+ Property<Short> shortField = new Property<Short>("shortField",
Short.class);
+ Property<Byte> byteField = new Property<Byte>("byteField", Byte.class);
+
Property<Date> created = new Property<Date>("created", Date.class);
- Property<Long> longField = new Property<Long>("longField", Long.class);
- Property<com.google.gwt.requestfactory.shared.SimpleEnum> enumField =
- new
EnumProperty<com.google.gwt.requestfactory.shared.SimpleEnum>("enumField",
- com.google.gwt.requestfactory.shared.SimpleEnum.class,
SimpleEnum.values());
-
+
+ Property<Double> doubleField = new Property<Double>("doubleField",
Double.class);
+ Property<Float> floatField = new Property<Float>("floatField",
Float.class);
+
+ Property<SimpleEnum> enumField =
+ new EnumProperty<SimpleEnum>("enumField",
+ SimpleEnum.class, SimpleEnum.values());
+
+ Property<Boolean> boolField = new Property<Boolean>("boolField",
Boolean.class);
+ Property<Boolean> otherBoolField = new
Property<Boolean>("otherBoolField", Boolean.class);
+
Property<SimpleBarRecord> barField = new
Property<SimpleBarRecord>("barField",
SimpleBarRecord.class);
@@ -45,36 +62,68 @@
SimpleFooRecord.class);
SimpleBarRecord getBarField();
-
+
+ BigDecimal getBigDecimalField();
+
+ BigInteger getBigIntField();
+
Boolean getBoolField();
+ Byte getByteField();
+
+ Character getCharField();
+
Date getCreated();
-
+
+ Double getDoubleField();
+
SimpleEnum getEnumField();
-
+
+ Float getFloatField();
+
SimpleFooRecord getFooField();
-
+
Integer getIntId();
-
+
Long getLongField();
-
+
+ Boolean getOtherBoolField();
+
String getPassword();
+ Short getShortField();
+
String getUserName();
-
+
void setBarField(SimpleBarRecord barField);
+ void setBigDecimalField(BigDecimal d);
+
+ void setBigIntField(BigInteger i);
+
void setBoolField(Boolean boolField);
+ void setByteField(Byte b);
+
+ void setCharField(Character c);
+
void setCreated(Date created);
+ void setDoubleField(Double d);
+
+ void setFloatField(Float f);
+
void setFooField(SimpleFooRecord fooField);
void setIntId(Integer intId);
void setLongField(Long longField);
+ void setOtherBoolField(Boolean boolField);
+
void setPassword(String password);
+ void setShortField(Short s);
+
void setUserName(String userName);
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors