[gwt-contrib] Re: The scaffold app is now a master / detail app. And it even warns (issue452801)

2010-05-03 Thread rjrjr

Ray, if you manage to review this tonight I'll submit it tonight.

http://gwt-code-reviews.appspot.com/452801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] The scaffold app is now a master / detail app. And it even warns (issue452801)

2010-05-03 Thread rjrjr

Reviewers: cromwellian,

Description:
The scaffold app is now a master / detail app. And it even warns
you of unsaved changes.

Review by: cromwell...@google.com

Please review this at http://gwt-code-reviews.appspot.com/452801/show

Affected files:
  M /bikeshed/src/com/google/gwt/app/client/EditorSupport.java
  M /bikeshed/src/com/google/gwt/app/place/ActivityManager.java
  M /bikeshed/src/com/google/gwt/app/rebind/EditorSupportGenerator.java
  M  
/bikeshed/src/com/google/gwt/bikeshed/list/shared/SingleSelectionModel.java

  M /bikeshed/src/com/google/gwt/sample/expenses/gwt/client/Scaffold.java
  D  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldActivities.java
  A  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldDetailsActivities.java
  A  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMasterActivities.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobile.java
  A  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobileActivities.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldShell.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldShell.ui.xml
  A  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/place/BaseScaffoldPlaceFilter.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/place/BaseScaffoldPlaceProcessor.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/ListActivitiesMapper.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeActivitiesMapper.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeDetailsActivity.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeDetailsView.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeDetailsView.ui.xml
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditActivity.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java
   
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.ui.xml
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeListActivity.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportActivitiesMapper.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsActivity.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportDetailsView.ui.xml
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditActivity.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.ui.xml
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportListActivity.java
  M  
/bikeshed/src/com/google/gwt/valuestore/ui/AbstractRecordListActivity.java

  M /bikeshed/src/com/google/gwt/valuestore/ui/AbstractRecordListView.java
  A /bikeshed/src/com/google/gwt/valuestore/ui/RecordDetailsView.java
  M /bikeshed/src/com/google/gwt/valuestore/ui/RecordEditView.java
  M /bikeshed/src/com/google/gwt/valuestore/ui/RecordListView.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix GWT logging in Devmode (issue437801)

2010-05-03 Thread unnurg

http://gwt-code-reviews.appspot.com/437801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix GWT logging in Devmode (issue437801)

2010-05-03 Thread unnurg

all done


http://gwt-code-reviews.appspot.com/437801/diff/1/3
File /dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java
(right):

http://gwt-code-reviews.appspot.com/437801/diff/1/3#newcode43
/dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java:43: *
should be instantiating this class.
On 2010/05/03 20:32:27, scottb wrote:

Instead of this last sentence, just make the constructor private or

default

access.


Done.

http://gwt-code-reviews.appspot.com/437801/diff/1/4
File /dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java
(right):

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode16
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:16:
On 2010/05/03 20:32:27, scottb wrote:

No blank line here.


Done.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode27
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:27: public
class DevModeLogManager extends LogManager {
On 2010/05/03 20:32:27, scottb wrote:

My main comment on this class is... a user can have multiple hosted

mode

sessions open concurrently, and each is supposed to live in its own

isolated

world.  But this implementation appears to lump all of the individual

clients

into the same bucket.



I think you need a per-client LogManager.  A pretty easy way to do

this is with

a ThreadLocal for clients.



If you go this route, individual delegation methods could look like

this:


public boolean addLogger(Logger logger) {
   return getDelegate().addLogger(logger);
}



where getDelegate() returns either the serverLogManager, or a

client-specific

one.


Done.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode34
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:34:
protected static LogManager delegate;
On 2010/05/03 20:32:27, scottb wrote:

Suggest naming this "serverLogManager" or something like that.


Done.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode39
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:39: //
delegate calls to there.
On 2010/05/03 20:32:27, scottb wrote:

The code you want will probably look something like this:



Class clazz =
Class.forName(logManagerClass).asSubclass(LogManager.class);
Constructor ctor =

clazz.getDeclaredConstructor();

ctor.setAccessible(true);
delegate = ctor.newInstance();



(mostly copied from ModuleSpace.rebindAndCreate())



The nice thing about implementing this is, you won't need
LogManagerWithExposedConstructor anymore, since you can instantiate it

via

reflection.



Done. However, I still needed a LogManger with an exposed constructor
for the clientLogManagers and also to create in case of error. I could
do both of these with reflection if you have a strong preference -
mostly I wanted to avoid the code to handle all of the exceptions that
the reflection method throws (but shouldn't fire since I actually know
for sure how the LogManager class behaves)

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode63
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:63:
On 2010/05/03 20:32:27, scottb wrote:

It seems like you'd want to forward all of the public methods, right?

Otherwise

you could break e.g. servlet code that uses loggging.


Mmm.. once upon a time I had this set up so that server code was going
to super and client code was going to a delegate, which was why this was
ok (the client code LogManager doesn't support any methods other than
addLogger and getLogger... I think though that if I'm going to support
the old logging.manager properties, I can't do that anymore, and I will
need to delegate all the calls... done

http://gwt-code-reviews.appspot.com/437801/diff/1/5
File /dev/core/test/com/google/gwt/dev/DevModeBaseTest.java (right):

http://gwt-code-reviews.appspot.com/437801/diff/1/5#newcode24
/dev/core/test/com/google/gwt/dev/DevModeBaseTest.java:24: String
kManagerProperty = "java.util.logging.manager";
On 2010/05/03 20:32:27, scottb wrote:

We don't use this style in GWT.  If you want to make it a constant,

make it a

static final field in the class and use THIS_FORMAT for the name.


Done.

http://gwt-code-reviews.appspot.com/437801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Moved the showErrors method into the generator. (issue451801)

2010-05-03 Thread amitmanjhi

Reviewers: Ray Ryan,

Description:
Moved the showErrors method into the generator.

Patch by: amitmanjhi
Review by: rjrjr (desk review)


Please review this at http://gwt-code-reviews.appspot.com/451801/show

Affected files:
  M trunk/bikeshed/src/com/google/gwt/app/client/EditorSupport.java
  M trunk/bikeshed/src/com/google/gwt/app/rebind/EditorSupportGenerator.java
  M  
trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java
  M  
trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java



--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Implement GWT logging (issue438801)

2010-05-03 Thread unnurg

http://gwt-code-reviews.appspot.com/438801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Implement GWT logging (issue438801)

2010-05-03 Thread unnurg

http://gwt-code-reviews.appspot.com/438801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Implement GWT logging (issue438801)

2010-05-03 Thread unnurg

On 2010/05/04 01:02:17, unnurg wrote:


We think that the latest changes to the DevMode fix CL (437801) which
not only gives the server and client their own root logger, but now
gives each client thread their own root logger, will fix the extra
handlers issue, so that code is removed.

http://gwt-code-reviews.appspot.com/438801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Implement GWT logging (issue438801)

2010-05-03 Thread unnurg

http://gwt-code-reviews.appspot.com/438801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Implement GWT logging (issue438801)

2010-05-03 Thread fredsa

Sorry I wasn't clear on the add/setWidget comment.


http://gwt-code-reviews.appspot.com/438801/diff/1/5
File /user/src/com/google/gwt/logging/client/BasicLoggingPopup.java
(right):

http://gwt-code-reviews.appspot.com/438801/diff/1/5#newcode55
/user/src/com/google/gwt/logging/client/BasicLoggingPopup.java:55:
public void add(Widget w) {
Here you've overridden add(Widget) but not setWidget(Widget). It could
look something like this:

public void setWidget(Widget w) {
  v.clear();
  v.add(w);
}

http://gwt-code-reviews.appspot.com/438801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Added server side validation using JSR 303. On the server side, one can now do (issue450801)

2010-05-03 Thread amitmanjhi

Reviewers: Ray Ryan,

Description:
Added server side validation using JSR 303. On the server side, one can
now do
validations before persisting an entity. Also, added a callback for sync
request so that any validation errors can be shown on the client.

Patch by: amitmanjhi
Review by: rjrjr (desk review)


Please review this at http://gwt-code-reviews.appspot.com/450801/show

Affected files:
  M trunk/bikeshed/eclipse.README
  M  
trunk/bikeshed/src/com/google/gwt/requestfactory/client/impl/RequestFactoryJsonImpl.java
  M  
trunk/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java

  M trunk/bikeshed/src/com/google/gwt/requestfactory/shared/SyncRequest.java
  A trunk/bikeshed/src/com/google/gwt/requestfactory/shared/SyncResult.java
  M  
trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditActivity.java
  M  
trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java
  M  
trunk/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditActivity.java
  M  
trunk/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Employee.java
  M  
trunk/bikeshed/src/com/google/gwt/valuestore/client/DeltaValueStoreJsonImpl.java

  A trunk/bikeshed/src/com/google/gwt/valuestore/client/SyncResultImpl.java
  M trunk/bikeshed/src/com/google/gwt/valuestore/shared/DeltaValueStore.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Implement GWT logging (issue438801)

2010-05-03 Thread unnurg

http://gwt-code-reviews.appspot.com/438801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix GWT logging in Devmode (issue437801)

2010-05-03 Thread scottb

I think DevModeLogManager still needs some work, the rest is just style
stuff.


http://gwt-code-reviews.appspot.com/437801/diff/1/3
File /dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java
(right):

http://gwt-code-reviews.appspot.com/437801/diff/1/3#newcode43
/dev/core/src/com/google/gwt/dev/shell/BrowserChannelServer.java:43: *
should be instantiating this class.
Instead of this last sentence, just make the constructor private or
default access.

http://gwt-code-reviews.appspot.com/437801/diff/1/4
File /dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java
(right):

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode16
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:16:
No blank line here.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode27
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:27: public
class DevModeLogManager extends LogManager {
My main comment on this class is... a user can have multiple hosted mode
sessions open concurrently, and each is supposed to live in its own
isolated world.  But this implementation appears to lump all of the
individual clients into the same bucket.

I think you need a per-client LogManager.  A pretty easy way to do this
is with a ThreadLocal for clients.

If you go this route, individual delegation methods could look like
this:

public boolean addLogger(Logger logger) {
  return getDelegate().addLogger(logger);
}

where getDelegate() returns either the serverLogManager, or a
client-specific one.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode34
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:34:
protected static LogManager delegate;
Suggest naming this "serverLogManager" or something like that.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode39
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:39: //
delegate calls to there.
The code you want will probably look something like this:

Class clazz =
Class.forName(logManagerClass).asSubclass(LogManager.class);
Constructor ctor = clazz.getDeclaredConstructor();
ctor.setAccessible(true);
delegate = ctor.newInstance();

(mostly copied from ModuleSpace.rebindAndCreate())

The nice thing about implementing this is, you won't need
LogManagerWithExposedConstructor anymore, since you can instantiate it
via reflection.

http://gwt-code-reviews.appspot.com/437801/diff/1/4#newcode63
/dev/core/src/com/google/gwt/dev/shell/DevModeLogManager.java:63:
It seems like you'd want to forward all of the public methods, right?
Otherwise you could break e.g. servlet code that uses loggging.

http://gwt-code-reviews.appspot.com/437801/diff/1/5
File /dev/core/test/com/google/gwt/dev/DevModeBaseTest.java (right):

http://gwt-code-reviews.appspot.com/437801/diff/1/5#newcode24
/dev/core/test/com/google/gwt/dev/DevModeBaseTest.java:24: String
kManagerProperty = "java.util.logging.manager";
We don't use this style in GWT.  If you want to make it a constant, make
it a static final field in the class and use THIS_FORMAT for the name.

http://gwt-code-reviews.appspot.com/437801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] [google-web-toolkit] r8027 committed - Edit views can now display errors. Weak in that they implement...

2010-05-03 Thread codesite-noreply

Revision: 8027
Author: rj...@google.com
Date: Mon May  3 09:01:39 2010
Log: Edit views can now display errors. Weak in that they implement
ShowErrors(Map) rather than
ShowErrors(Map>, String>), but it's a start.

Review at http://gwt-code-reviews.appspot.com/444801

Review by: amitman...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8027

Modified:
  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java
  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.ui.xml
  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java
  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.ui.xml

 /branches/2.1/bikeshed/src/com/google/gwt/valuestore/ui/RecordEditView.java

===
---  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java	 
Thu Apr 29 18:58:19 2010
+++  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java	 
Mon May  3 09:01:39 2010

@@ -17,6 +17,10 @@

 import com.google.gwt.app.client.EditorSupport;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.SpanElement;
+import com.google.gwt.dom.client.Style.FontWeight;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.sample.expenses.gwt.request.EmployeeRecord;
 import com.google.gwt.uibinder.client.UiBinder;
@@ -31,6 +35,7 @@
 import com.google.gwt.valuestore.shared.Property;
 import com.google.gwt.valuestore.ui.RecordEditView;

+import java.util.Map;
 import java.util.Set;

 /**
@@ -61,10 +66,12 @@
   InlineLabel id;
   @UiField
   InlineLabel version;
+  @UiField
+  DivElement errors;

   private Delegate delegate;
   private DeltaValueStore deltas;
-
+
   private EmployeeRecord record;

   public EmployeeEditView() {
@@ -110,4 +117,33 @@
   void onSave(@SuppressWarnings("unused") ClickEvent event) {
 delegate.saveClicked();
   }
-}
+
+  public void showErrors(Map errorMap) {
+// TODO Make EditorSupport do this
+
+errors.setInnerText("");
+
+if (errorMap == null || errorMap.isEmpty()) {
+  return;
+}
+
+Document doc = Document.get();
+for (Map.Entry entry : errorMap.entrySet()) {
+  /*
+   * Note that we are careful not to use setInnerHtml, to ensure we  
don't

+   * render user created markup: xsite attack protection
+   */
+
+  DivElement div = doc.createDivElement();
+  div.setInnerText(" " + entry.getValue());
+
+  SpanElement name = doc.createSpanElement();
+  name.getStyle().setFontWeight(FontWeight.BOLD);
+  name.setInnerText(entry.getKey());
+
+  div.insertFirst(name);
+
+  errors.appendChild(div);
+}
+  }
+}
===
---  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.ui.xml	 
Thu Apr 29 18:58:19 2010
+++  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.ui.xml	 
Mon May  3 09:01:39 2010

@@ -3,6 +3,7 @@
   xmlns:g='urn:import:com.google.gwt.user.client.ui' >
   
 Edit Employee ui:field='id'> (vui:field='version'/>)

+

 Display Name: ui:field='displayName'>
 User Name: ui:field='userName'>

===
---  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java	 
Thu Apr 29 18:58:19 2010
+++  
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java	 
Mon May  3 09:01:39 2010

@@ -17,6 +17,10 @@

 import com.google.gwt.app.client.EditorSupport;
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.SpanElement;
+import com.google.gwt.dom.client.Style.FontWeight;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.sample.expenses.gwt.request.ReportRecord;
 import com.google.gwt.uibinder.client.UiBinder;
@@ -31,6 +35,7 @@
 import com.google.gwt.valuestore.shared.Property;
 import com.google.gwt.valuestore.ui.RecordEditView;

+import java.util.Map;
 import java.util.Set;

 /**
@@ -55,17 +60,19 @@
   @UiField
   TextBox approvedSupervisorKey;
   @UiField
-  InlineLabel created; //TODO: use a DatePicker
+  InlineLabel created; // TODO: use a DatePicker
   @UiField
   Button save;
   @UiField
   InlineLabel id;
   @UiField
   InlineLabel version;
+  @UiField
+  DivElement errors;

   private Delegate delegate;
   private DeltaValueStore deltas;
-
+
   private ReportRecord record;

   public ReportEditView() {
@@ -111,4 +118,33 @@
   void onSave(@SuppressWarnings("unused") ClickEvent event) {
 delegate.saveClicked();
   }
-}
+
+  public void showErrors(Map errorMap) {
+// TOD

[gwt-contrib] Re: How to serialize client side objects to string?

2010-05-03 Thread mmoossen
i thought i was subscribed to lombardi dev channel, but i was not :(
but now i am, at least i hope so ;)

thanks for the ref
Michael

On May 3, 11:34 am, Thomas Broyer  wrote:
> On May 3, 10:32 am, mmoossen  wrote:
>
> > i got it working
>
> > the problem was that i was using
> > com.google.gwt.user.RemoteServiceObfuscateTypeNames in my module but
> > my faked SerializationPolicy does not implements TypeNameObfuscator.
>
> > so the next question is:
> > what is the best approach to get the right SerializationPolicy for
> > serializing??
>
> Just in time: Alex Moffat published an update of his blogpost on the
> matter for the new deRPC:http://development.lombardi.com/?p=1329
> It links to the previous article with downloadable 
> code:http://development.lombardi.com/?p=1174
> based on an article by Pat 
> Niemeyer:http://www.techhui.com/profiles/blogs/simpler-and-speedier-gwt-with
>
> Really worth the read.
>
> --http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Edit views can now display errors. Weak in that they implement (issue444801)

2010-05-03 Thread rjrjr

Reviewers: amitmanjhi,

Description:
Edit views can now display errors. Weak in that they implement
ShowErrors(Map) rather than
ShowErrors(Map>, String>), but it's a start.


Please review this at http://gwt-code-reviews.appspot.com/444801/show

Affected files:
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/employee/EmployeeEditView.ui.xml
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.java
  M  
/bikeshed/src/com/google/gwt/sample/expenses/gwt/ui/report/ReportEditView.ui.xml

  M /bikeshed/src/com/google/gwt/valuestore/ui/RecordEditView.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix zero-padding of 4-digit year patterns. (issue433801)

2010-05-03 Thread rchandia

LGTM

http://gwt-code-reviews.appspot.com/433801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix zero-padding of 4-digit year patterns. (issue433801)

2010-05-03 Thread jat

http://gwt-code-reviews.appspot.com/433801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Correcting the output names for SoycTest.java (issue442801)

2010-05-03 Thread spoon

LGTM

Let's not quibble about the exact numbers right now. There was a lot of
discussion about them, but I can't remember what the decision was. The
important thing now is that the test passes. If someone can argue the
number should be different, let's file that as a separate bug.



http://gwt-code-reviews.appspot.com/442801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Correcting the output names for SoycTest.java (issue442801)

2010-05-03 Thread Freeland Abbott
I'd been tracking down this error, which was initially convolved with some
code I'd added to Hello for an unrelated issue I was tracking with
Kathryn... but I don't have a good explanation why I'm now seeing zero-based
values.  But it seems, AFAICT, legit

On Mon, May 3, 2010 at 1:43 PM,  wrote:

> Reviewers: Lex,
>
> Description:
> Correcting the output names for SoycTest.java
>
> Review by: sp...@google.com
>
> Please review this at http://gwt-code-reviews.appspot.com/442801/show
>
> Affected files:
>  M dev/core/test/com/google/gwt/dev/SoycTest.java
>
>
> Index: dev/core/test/com/google/gwt/dev/SoycTest.java
> ===
> --- dev/core/test/com/google/gwt/dev/SoycTest.java  (revision 8015)
> +++ dev/core/test/com/google/gwt/dev/SoycTest.java  (working copy)
> @@ -43,12 +43,17 @@
> new Compiler(options).run(logger);
>
> // make sure the files have been produced
> -assertTrue(new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/index.html").exists());
> -assertTrue(new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/SoycDashboard-1-index.html").exists());
> -assertTrue(new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/total-1-overallBreakdown.html").exists());
> -assertTrue(new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/soyc.css").exists());
> +assertTrue("missing compile-report/index.html",
> +   new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/index.html").exists());
> +assertTrue("missing compile-report/SoycDashboard-0-index.html",
> +   new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/SoycDashboard-0-index.html").exists());
> +assertTrue("missing compile-report/total-0-overallBreakdown.html",
> +   new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/total-0-overallBreakdown.html").exists());
> +assertTrue("missing compile-report/soyc.css",
> +   new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/soyc.css").exists());
>
> -assertFalse(new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/index2.html").exists());
> +assertFalse("improperly has compile-report/index2.html",
> +new File(options.getExtraDir() +
> "/hello/soycReport/compile-report/index2.html").exists());
> Util.recursiveDelete(options.getExtraDir(), false);
>   }
>  }
>
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] Correcting the output names for SoycTest.java (issue442801)

2010-05-03 Thread fabbott

Reviewers: Lex,

Description:
Correcting the output names for SoycTest.java

Review by: sp...@google.com

Please review this at http://gwt-code-reviews.appspot.com/442801/show

Affected files:
  M dev/core/test/com/google/gwt/dev/SoycTest.java


Index: dev/core/test/com/google/gwt/dev/SoycTest.java
===
--- dev/core/test/com/google/gwt/dev/SoycTest.java  (revision 8015)
+++ dev/core/test/com/google/gwt/dev/SoycTest.java  (working copy)
@@ -43,12 +43,17 @@
 new Compiler(options).run(logger);

 // make sure the files have been produced
-assertTrue(new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/index.html").exists());
-assertTrue(new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/SoycDashboard-1-index.html").exists());
-assertTrue(new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/total-1-overallBreakdown.html").exists());
-assertTrue(new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/soyc.css").exists());

+assertTrue("missing compile-report/index.html",
+   new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/index.html").exists());

+assertTrue("missing compile-report/SoycDashboard-0-index.html",
+   new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/SoycDashboard-0-index.html").exists());

+assertTrue("missing compile-report/total-0-overallBreakdown.html",
+   new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/total-0-overallBreakdown.html").exists());

+assertTrue("missing compile-report/soyc.css",
+   new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/soyc.css").exists());


-assertFalse(new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/index2.html").exists());

+assertFalse("improperly has compile-report/index2.html",
+new File(options.getExtraDir()  
+ "/hello/soycReport/compile-report/index2.html").exists());

 Util.recursiveDelete(options.getExtraDir(), false);
   }
 }


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fix zero-padding of 4-digit year patterns. (issue433801)

2010-05-03 Thread rchandia

Needs work.

There is a discrepancy between the documentation and the proposed
implementation. For example for year 1996 and "y" the documentation
says "01996" should be printed. But the proposed fix would print "1996"
instead as it only pads "" patterns. Zero padding by default (that
is, for anything other than "yy") would provide a behavior according to
the documentation. Otherwise, let's fix the documentation to match the
implementation.


http://gwt-code-reviews.appspot.com/433801/diff/1/2
File user/src/com/google/gwt/i18n/client/DateTimeFormat.java (right):

http://gwt-code-reviews.appspot.com/433801/diff/1/2#newcode192
user/src/com/google/gwt/i18n/client/DateTimeFormat.java:192: * produces
"06"). Year is handled specially; that is, if the count
Either document the handling of  (padding with zeroes) or extend the
handling to any number of y's

http://gwt-code-reviews.appspot.com/433801/diff/1/2#newcode338
user/src/com/google/gwt/i18n/client/DateTimeFormat.java:338: *
"y.M.dd GGG hh:mm aaa"
According to the code in formatYear it would seem that this example
differs from the implementation. Formatting "y" produces "1996"
instead of "01996".

http://gwt-code-reviews.appspot.com/433801/diff/1/2#newcode1189
user/src/com/google/gwt/i18n/client/DateTimeFormat.java:1189: *
should be formatted
Document the two special cases 2 and 4. Does 4 need to be a special
case?

http://gwt-code-reviews.appspot.com/433801/diff/1/2#newcode1202
user/src/com/google/gwt/i18n/client/DateTimeFormat.java:1202: // count
!= 2
Should this become "count != 2 && count != 4"?

http://gwt-code-reviews.appspot.com/433801/diff/1/2#newcode1203
user/src/com/google/gwt/i18n/client/DateTimeFormat.java:1203:
buf.append(value);
Perhaps a better option would be to zero pad by default. Then, a single
'y' would perform an append and everything else would pad as expected
(with "yy" being a special case, as documented above).

http://gwt-code-reviews.appspot.com/433801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Introducing TOP value for constants analysis and using it (issue436801)

2010-05-03 Thread spoon

This is a great change! It simplifies the setup code for constant
analysis, and it means that the common case of a top assumption doesn't
require an explicit entry in the map.

Some small changes are requested in the implementation.



http://gwt-code-reviews.appspot.com/436801/diff/1/2
File
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysis.java
(right):

http://gwt-code-reviews.appspot.com/436801/diff/1/2#newcode49
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysis.java:49:
ConstantsAssumption.TOP, assumptionMap);
Nice to see this part go back to being so simple!

http://gwt-code-reviews.appspot.com/436801/diff/1/3
File
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumption.java
(right):

http://gwt-code-reviews.appspot.com/436801/diff/1/3#newcode157
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumption.java:157:
ConstantsAssumption other = (ConstantsAssumption) obj;
It won't come up much in practice, but it seems like there should be a
type test here before doing the cast.  If the object is the wrong type,
return false.

http://gwt-code-reviews.appspot.com/436801/diff/1/3#newcode158
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumption.java:158:
return values.equals(other.values);
Shouldn't this apply equal(JValueLiteral,JValueLiteral) to each element?
 Otherwise it will return false unnecessarily.

http://gwt-code-reviews.appspot.com/436801/diff/1/3#newcode188
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumption.java:188:
return null;
Null is the bottom assumption.  Shouldn't this case return the receiver?

http://gwt-code-reviews.appspot.com/436801/diff/1/3#newcode211
dev/core/src/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumption.java:211:
if (this == TOP) {
This should ideally check isEmpty(), too. Or else, make the class
constructor and the set() method private, so that isEmpty() isn't
needed.

http://gwt-code-reviews.appspot.com/436801/diff/1/6
File
dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysisTest.java
(right):

http://gwt-code-reviews.appspot.com/436801/diff/1/6#newcode1
dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAnalysisTest.java:1:
package com.google.gwt.dev.jjs.impl.gflow.constants;
This files is also missing a copyright header.

http://gwt-code-reviews.appspot.com/436801/diff/1/7
File
dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumptionTest.java
(right):

http://gwt-code-reviews.appspot.com/436801/diff/1/7#newcode1
dev/core/test/com/google/gwt/dev/jjs/impl/gflow/constants/ConstantsAssumptionTest.java:1:
package com.google.gwt.dev.jjs.impl.gflow.constants;
Needs copyright header.

http://gwt-code-reviews.appspot.com/436801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: CFG: fixing case fallthrough. (issue434801)

2010-05-03 Thread spoon

LGTM

I tricked myself into thinking fallthrough work, because fallthrough
does happen from a statement to the following case: node.  However, the
case: node turns into a conditional, so it's important to skip that
conditional if there's a fallthrough.

I'm surprised this hasn't bitten more people than it has!


http://gwt-code-reviews.appspot.com/434801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Fixing division by zero while evaluating constant expression. (issue435801)

2010-05-03 Thread spoon

LGTM

http://gwt-code-reviews.appspot.com/435801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: Question about CompilePerms and adding gwt module source at runtime.

2010-05-03 Thread Marko Vuksanovic
I solved the problem... This had nothing to do with the GWT. The
problem was with adding a folder to java class path dynamically.
Although at first I thought I had done it correctly, it turned out
that that's a little tricky...

For anyone else with the same problem - here's a gist on how to solve
it...
http://gist.github.com/387972

As you can see, a call to protected method is required in order to add
a folder to class path.

On May 3, 10:54 am, Marko Vuksanovic 
wrote:
> I am trying to distribute my gwt build process so that compilePerms
> step is executed on a remote machine. I am making a small java program
> for that purpose. I have successfully transfered the result of the
> Precompile step to the other computer as well as the source files...
>
> So I now have a folder structure something like
> /root
>   /src
>   /build
>     /custom-compile-perms.jar
>     /(uncompressed)
>       /work
>       /src
>     /
>   /resources
>
> Now when i run my custom compile perms program it creates a temp
> folder called _uncompressed_ which in turn contains /work and /src of
> the project transfered from the remote computer.
>
> At that time if I try to execute sth like
>
> List moduleNames = new ArrayList();
> moduleNames.add("com.hypersimple.HyperSimple");
> File workDir = new File("uncompressed\\work");
>
> final CompilePermsOptions options = new CompilePermsOptionsImpl();
>
> options.setModuleNames(moduleNames);
> options.setWorkDir(workDir);
> int perms[] = { 0 };
> options.setPermsToCompile(perms);
>
> I get an error that the module com.hypersimple.hypersimple cannot be
> found and that I should check if it is on the classpath.
>
> I have figured out that I need to have the folder /uncompressed/src on
> the classpath - but what if I don't know in which folder that source
> will reside - can I somehow add it during runtime?
>
> File uncompressedSrc = new File("uncompressed" + File.separator +
> "src" + File.separator);
> URL uncompressedSrcURL = null;
> try {
>     uncompressedSrcURL = new URL("file://"
>         + uncompressedSrc.getAbsolutePath());} catch (MalformedURLException 
> e) {
>
>     e.printStackTrace();}
>
> URL elements[] = { uncompressedSrcURL };
> new URLClassLoader(elements, ClassLoader.getSystemClassLoader());
>
> and even thought it adds /uncompressed/src to the classpath, GWT
> compilePerms doesn't seem to look into that folder.
>
> Any suggestions?
> I have tried using classloader as follows
>
> --http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: How to serialize client side objects to string?

2010-05-03 Thread Thomas Broyer


On May 3, 10:32 am, mmoossen  wrote:
> i got it working
>
> the problem was that i was using
> com.google.gwt.user.RemoteServiceObfuscateTypeNames in my module but
> my faked SerializationPolicy does not implements TypeNameObfuscator.
>
> so the next question is:
> what is the best approach to get the right SerializationPolicy for
> serializing??

Just in time: Alex Moffat published an update of his blogpost on the
matter for the new deRPC: http://development.lombardi.com/?p=1329
It links to the previous article with downloadable code:
http://development.lombardi.com/?p=1174
based on an article by Pat Niemeyer:
http://www.techhui.com/profiles/blogs/simpler-and-speedier-gwt-with

Really worth the read.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Question about CompilePerms and adding gwt module source at runtime.

2010-05-03 Thread Marko Vuksanovic
I am trying to distribute my gwt build process so that compilePerms
step is executed on a remote machine. I am making a small java program
for that purpose. I have successfully transfered the result of the
Precompile step to the other computer as well as the source files...

So I now have a folder structure something like
/root
  /src
  /build
/custom-compile-perms.jar
/(uncompressed)
  /work
  /src
/
  /resources

Now when i run my custom compile perms program it creates a temp
folder called _uncompressed_ which in turn contains /work and /src of
the project transfered from the remote computer.

At that time if I try to execute sth like

List moduleNames = new ArrayList();
moduleNames.add("com.hypersimple.HyperSimple");
File workDir = new File("uncompressed\\work");

final CompilePermsOptions options = new CompilePermsOptionsImpl();

options.setModuleNames(moduleNames);
options.setWorkDir(workDir);
int perms[] = { 0 };
options.setPermsToCompile(perms);

I get an error that the module com.hypersimple.hypersimple cannot be
found and that I should check if it is on the classpath.

I have figured out that I need to have the folder /uncompressed/src on
the classpath - but what if I don't know in which folder that source
will reside - can I somehow add it during runtime?


File uncompressedSrc = new File("uncompressed" + File.separator +
"src" + File.separator);
URL uncompressedSrcURL = null;
try {
uncompressedSrcURL = new URL("file://"
+ uncompressedSrc.getAbsolutePath());
} catch (MalformedURLException e) {
e.printStackTrace();
}
URL elements[] = { uncompressedSrcURL };
new URLClassLoader(elements, ClassLoader.getSystemClassLoader());

and even thought it adds /uncompressed/src to the classpath, GWT
compilePerms doesn't seem to look into that folder.

Any suggestions?
I have tried using classloader as follows

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors


[gwt-contrib] Re: How to serialize client side objects to string?

2010-05-03 Thread mmoossen
i got it working

the problem was that i was using
com.google.gwt.user.RemoteServiceObfuscateTypeNames in my module but
my faked SerializationPolicy does not implements TypeNameObfuscator.

so the next question is:
what is the best approach to get the right SerializationPolicy for
serializing??

thanks
Michael


On Apr 29, 3:56 pm, mmoossen  wrote:
> please, somebody help!
>
> thanks
> Michael
>
> On Apr 27, 2:54 pm, mmoossen  wrote:
>
>
>
> > Dear all!
>
> > i tried the described RPC prefetching mechanism and i am facing one
> > problem:
>
> > first, on the server-side to serialize/RPC.encode(...) i need the
> > serialization policy, but i need the strong name to get it from the
> > RemoteService. so i am just using a dummy serialization policy that
> > seems to work fine. is this the right approach? any alternative?
>
> > then i have to put the resulting payload into the host page as js
> > global string variable, i am enclosing it in single quotation marks,
> > but do i have to escape single quotation marks in the payload or will
> > they be already escaped?
>
> > and finally on the client-side the code fails at this line:
>
> > > streamFactory.createStreamReader(data).readObject();
>
> > with following exception:
> > com.google.gwt.user.client.rpc.SerializationException: my.project.Data/
> > 2847679377
> >         at
> > com.google.gwt.user.client.rpc.impl.SerializerBase.check(SerializerBase.java:
> > 161)
> >         at
> > com.google.gwt.user.client.rpc.impl.SerializerBase.instantiate(SerializerBase.java:
> > 138)
> >         at
> > com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:
> > 114)
> >         at
> > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:
> > 61)
>
> > which seems to mean that the client side serializer does not know
> > about my.project.Data, but this is included in the .gwt.rpc file.
> > so i have no idea what is wrong nor how to fix it.
> > any help is really appreciated.
>
> > thanks
> > Michael
>
> > On Apr 26, 7:55 pm, mmoossen  wrote:
>
> > > Hi, thomas!
>
> > > good hint that RPC prefetching method... i was using json for that,
> > > but with this method i can skip the java to json conversion, cool ;)
>
> > > thanks for sharing
> > > Michael
>
> > > --http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
> > --http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
> --http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors