Re: CheckboxCell 2 clicks for selection, when using SingleSelectionModel

2011-06-14 Thread bb.f.pav
Hi Patrick,

unfortunately i'll need the single selection model for the purpose of
the project ;)

Thx
bb.f.pav

On 13 Jun., 22:42, Patrick Tucker tucker...@gmail.com wrote:
 If you don't need the selection model, try NoSelectionModel.

 On Jun 13, 2:56 pm, bb.f.pav bb.f@googlemail.com wrote:







  Hi Juan,

  1) i'm not yet reached that point. i'm using the stockwatcher examples
  as basis for my celltable example and run it via eclipse as web
  application
      that's my module.gwt.xml

  ?xml version=1.0 encoding=UTF-8?
  module rename-to='mysamplegwtohnemaven'
    !-- Inherit the core Web Toolkit stuff.                        --
    inherits name='com.google.gwt.user.User'/

    !-- Inherit the default GWT style sheet.  You can change       --
    !-- the theme of your GWT application by uncommenting          --
    !-- any one of the following lines.                            --
    inherits name='com.google.gwt.user.theme.standard.Standard'/

    !-- Specify the app entry point class.                         --
    entry-point
  class='de.f10rian.mySampleGwtOhneMaven.client.MySampleGwtOhneMaven'/

    !-- Specify the paths for translatable code                    --
    source path='client'/
    source path='shared'/

  /module

  2) Here is my CellTableExample code. hopefully you'll see my error:

  public class CellTableExample extends Composite {

          private static CellTableExampleUiBinder uiBinder = GWT
                          .create(CellTableExampleUiBinder.class);

          interface CellTableExampleUiBinder extends
                          UiBinderWidget, CellTableExample {
          }

          @UiField
          CellTablePerson ct;

          ListLong checkBoxSelectedIds = new ArrayListLong();

          private final ListDataProviderPerson dataProvider = new
  ListDataProviderPerson();
          private final SingleSelectionModelPerson singleSelectionModel = 
  new
  SingleSelectionModelPerson();

          {
                  singleSelectionModel.addSelectionChangeHandler(new 
  Handler() {
                          @Override
                          public void onSelectionChange(SelectionChangeEvent 
  event) {
                                  GWT.log(getSelectedObject +
  singleSelectionModel.getSelectedObject().toString());
                          }
                  });
          }

          public CellTableExample() {
                  initWidget(uiBinder.createAndBindUi(this));

                  // name column
                  ColumnPerson, String nameCol = new ColumnPerson, String(
                                  new TextInputCell()){
                          public String getValue(Person object) {
                                  return object.getName();
                          }
                  };

                  nameCol.setFieldUpdater(new FieldUpdaterPerson, String() {
                          public void update(int index, Person object, String 
  value) {
                                  object.setName(value);
                          }
                  });

                  // title column
                  ColumnPerson, String forenameCol = new ColumnPerson, 
  String(
                                  new TextInputCell()){
                          public String getValue(Person object) {
                                  return object.getForeName();
                          }
                  };

                  forenameCol.setFieldUpdater(new FieldUpdaterPerson, 
  String() {
                          public void update(int index, Person object, String 
  value) {
                                  object.setForeName(value);
                          }
                  });

                  /*
                   * add check column
                   */
                  ColumnPerson, Boolean cbCol = new ColumnPerson, 
  Boolean(new
 CheckboxCell()) {
                          public Boolean getValue(Person object) {
                                  GWT.log(cbCol.getValue:  + Boolean.FALSE);
                                  return object.isSelected();
                          }
                  };

                  cbCol.setFieldUpdater(new FieldUpdaterPerson, Boolean() {
                          public void update(int index, Person object, 
  Boolean value) {
                                  GWT.log(cbCol.setValue:  + value);
                                  object.setSelected(value);
                          }
                  });

                  // Add the columns.
                  ct.addColumn(forenameCol, Forname);
                  ct.addColumn(nameCol, Name);
                  ct.addColumn(cbCol, Check);

              // Set the width of the table and put the table in fixed width
  mode.
                  ct.setWidth(100%, true);

              // Set the width of each column.
                  ct.setColumnWidth(forenameCol, 200.0, Unit.PX);
                  ct.setColumnWidth(nameCol, 50.0, Unit.PCT);
 

RequestFactory causing OutOfMemoryError

2011-06-14 Thread Filip Krygowski
Hi!

We've recently been trying to switch from GWT-RPC to RequestFactory
and we've been generally successful. However, we’ve noticed that after
quite a large number of requests (depending on the volume of data
sent) the server was running out of memory. I set up a test project to
investigate and came up with this simple class:

public class SampleMessage {
private String message;
private ListLong numbers;

// getters and setters cut for brevity
}

and a client-side ValueProxy for it. Regardless of the size of the
data sent per request (controlled by the number of  Longs in the
list), we were still running out of memory, both in development mode
and with compiled code deployed on a server. Later I’ve come across
this issue: http://code.google.com/p/google-web-toolkit/issues/detail?id=6193
; thinking it might be related, I checked out the GWT trunk, built the
jars and used those, but that didn’t help.

I took a long and careful look at the heap and after some analysis I
noticed that the Longs I’ve been sending don’t get garbage-collected
(also true for other types stored in lists, which I checked later).
The same goes for all serialized properties (the ‘message’ String and
Longs). The questions at this point is: is this some kind of caching
feature that backfires on us? Or is it possible that we messed up
configuration at some point? Or perhaps this is a new bug?

Thanks in advance for all replies,
Filip Krygowski

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory causing OutOfMemoryError

2011-06-14 Thread Julian Scheid
On Tue, Jun 14, 2011 at 7:18 PM, Filip Krygowski
filip.krygow...@gmail.com wrote:
 I took a long and careful look at the heap and after some analysis I
 noticed that the Longs I’ve been sending don’t get garbage-collected
 (also true for other types stored in lists, which I checked later).
 The same goes for all serialized properties (the ‘message’ String and
 Longs). The questions at this point is: is this some kind of caching
 feature that backfires on us? Or is it possible that we messed up
 configuration at some point? Or perhaps this is a new bug?

http://code.google.com/p/google-web-toolkit/issues/detail?id=6193

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RequestFactory causing OutOfMemoryError

2011-06-14 Thread khiem nguyen
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/b16e9efa51b6/4e7c898492471c12?hl=enlnk=gstq=leak#4e7c898492471c12

On Tue, Jun 14, 2011 at 9:21 AM, Julian Scheid julian...@googlemail.comwrote:

 On Tue, Jun 14, 2011 at 7:18 PM, Filip Krygowski
 filip.krygow...@gmail.com wrote:
  I took a long and careful look at the heap and after some analysis I
  noticed that the Longs I’ve been sending don’t get garbage-collected
  (also true for other types stored in lists, which I checked later).
  The same goes for all serialized properties (the ‘message’ String and
  Longs). The questions at this point is: is this some kind of caching
  feature that backfires on us? Or is it possible that we messed up
  configuration at some point? Or perhaps this is a new bug?

 http://code.google.com/p/google-web-toolkit/issues/detail?id=6193

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Displaying only part of an image using GWT Image Widget

2011-06-14 Thread redjhawk
Um, last parenthesis was not showed in the link... method is
setVisibleRect

On Jun 12, 9:49 pm, Jim Douglas jdou...@basis.com wrote:
 http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/g...)

 On Jun 12, 12:19 pm, Noor baken...@gmail.com wrote:







  I want to display only part of image using the GWT Image widget;
  for e.g. for an image of 400X400, I want to use an image widget to
  display only the top left 100x100 px. I want to do this for a puzzle,
  check thishttp://i.stack.imgur.com/4BVoi.png

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



How to set lable of Textbox

2011-06-14 Thread Sanjay Jain India
Hello all
I am using GWT2.3.In this I want to create a form.For This I used a
form panel and texbox.Textbox is for the User Name purpose.So I want
to set the label of text box.But there no way to set label.
I want label at the left side of the text box.

Please help me how to set label, So It come left to text box.
Thanks In Advance

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Wave rich text editor

2011-06-14 Thread Thomas Broyer
Your bug report https://issues.apache.org/jira/browse/WAVE-284 actually 
had answers… on the wave-dev mailing list!
See 
http://mail-archives.apache.org/mod_mbox/incubator-wave-dev/201106.mbox/%3cbanlktinwsi4mpu3dgwvqpvhxr4kmz0nzr0eiqzwch9zdimx...@mail.gmail.com%3E
 (also, 
read the associated thread)

If you want to reuse the Editor though, the module you actually need is 
org.waveprotocol.wave.client.editor.Editor. And you'll probably also need 
org.waveprotocol.wave.model.Model (and 
org.waveprotocol.wave.model.account.Account and 
org.waveprotocol.wave.model.supplement.Supplement or you'll have a bunch of 
errors on the console; it won't make you build fail though, unless you build 
in -strict mode)
EditorHarness is, as its name suggest, the GWT *application* that allows 
devs to test the Editor. It's a good start to understand how to bootstrap 
the editor, but it's not a reusable module.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/NpGb-9lzmNMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GXT : Out of memory error

2011-06-14 Thread Shawn Brown
 I am new to GXT development.We have used GXT in our project. However, on
 running the hosted mode in debug I encounter Out of memory error very
 frequently. Is there any thing which i can do to prevent this or minimize
 the frequency of occurance?
 Any tweaks for this?


Can't you go to Run Configurations (to configure hosted mode) and set
more memory as a VM argument?  Well that assumes you use Eclipse.  I
have -Xmx512m and it never has a problem.

If that doesn't work, I'd try setting a  VM argument under Advanced
when you click to compile the project.  Im not sure if the settings
get carried over to developer mode though, so that's why I'd set it
directly first.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CheckboxCell 2 clicks for selection, when using SingleSelectionModel

2011-06-14 Thread Juan Pablo Gardella
The only difference I see is addSelectionChangeHandler. I don't see an
error, sorry

2011/6/14 bb.f.pav bb.f@googlemail.com

 Hi Patrick,

 unfortunately i'll need the single selection model for the purpose of
 the project ;)

 Thx
 bb.f.pav

 On 13 Jun., 22:42, Patrick Tucker tucker...@gmail.com wrote:
  If you don't need the selection model, try NoSelectionModel.
 
  On Jun 13, 2:56 pm, bb.f.pav bb.f@googlemail.com wrote:
 
 
 
 
 
 
 
   Hi Juan,
 
   1) i'm not yet reached that point. i'm using the stockwatcher examples
   as basis for my celltable example and run it via eclipse as web
   application
   that's my module.gwt.xml
 
   ?xml version=1.0 encoding=UTF-8?
   module rename-to='mysamplegwtohnemaven'
 !-- Inherit the core Web Toolkit stuff.--
 inherits name='com.google.gwt.user.User'/
 
 !-- Inherit the default GWT style sheet.  You can change   --
 !-- the theme of your GWT application by uncommenting  --
 !-- any one of the following lines.--
 inherits name='com.google.gwt.user.theme.standard.Standard'/
 
 !-- Specify the app entry point class. --
 entry-point
   class='de.f10rian.mySampleGwtOhneMaven.client.MySampleGwtOhneMaven'/
 
 !-- Specify the paths for translatable code--
 source path='client'/
 source path='shared'/
 
   /module
 
   2) Here is my CellTableExample code. hopefully you'll see my error:
 
   public class CellTableExample extends Composite {
 
   private static CellTableExampleUiBinder uiBinder = GWT
   .create(CellTableExampleUiBinder.class);
 
   interface CellTableExampleUiBinder extends
   UiBinderWidget, CellTableExample {
   }
 
   @UiField
   CellTablePerson ct;
 
   ListLong checkBoxSelectedIds = new ArrayListLong();
 
   private final ListDataProviderPerson dataProvider = new
   ListDataProviderPerson();
   private final SingleSelectionModelPerson singleSelectionModel
 = new
   SingleSelectionModelPerson();
 
   {
   singleSelectionModel.addSelectionChangeHandler(new
 Handler() {
   @Override
   public void
 onSelectionChange(SelectionChangeEvent event) {
   GWT.log(getSelectedObject +
   singleSelectionModel.getSelectedObject().toString());
   }
   });
   }
 
   public CellTableExample() {
   initWidget(uiBinder.createAndBindUi(this));
 
   // name column
   ColumnPerson, String nameCol = new ColumnPerson,
 String(
   new TextInputCell()){
   public String getValue(Person object) {
   return object.getName();
   }
   };
 
   nameCol.setFieldUpdater(new FieldUpdaterPerson,
 String() {
   public void update(int index, Person object,
 String value) {
   object.setName(value);
   }
   });
 
   // title column
   ColumnPerson, String forenameCol = new ColumnPerson,
 String(
   new TextInputCell()){
   public String getValue(Person object) {
   return object.getForeName();
   }
   };
 
   forenameCol.setFieldUpdater(new FieldUpdaterPerson,
 String() {
   public void update(int index, Person object,
 String value) {
   object.setForeName(value);
   }
   });
 
   /*
* add check column
*/
   ColumnPerson, Boolean cbCol = new ColumnPerson,
 Boolean(new
  CheckboxCell()) {
   public Boolean getValue(Person object) {
   GWT.log(cbCol.getValue:  +
 Boolean.FALSE);
   return object.isSelected();
   }
   };
 
   cbCol.setFieldUpdater(new FieldUpdaterPerson,
 Boolean() {
   public void update(int index, Person object,
 Boolean value) {
   GWT.log(cbCol.setValue:  + value);
   object.setSelected(value);
   }
   });
 
   // Add the columns.
   ct.addColumn(forenameCol, Forname);
   ct.addColumn(nameCol, Name);
   ct.addColumn(cbCol, Check);
 
   // Set the width of the table and put the 

Intercept basic authentication popup

2011-06-14 Thread Vinicius Carvalho
Hi there!

Is it possible to intercept the basic auth login that pops up on a
browser? My problem is that I have a basic auth set on server side for
all my services (RPC and REST).

When I try to invoke a service and the user is not authenticated,
before I get the chance (the async callback gets called), the window
pops up.

What I would like (I know i could do this using either form, or spring
security for instance) is to intercept the return from the server that
asks for the authorization credentials, and then provide my
credentials on the requestbuilder by setting username/password.

Is this possible?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to set lable of Textbox

2011-06-14 Thread Juan Pablo Gardella
The label is Label
http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Label.htmlcomponent
or 
InlineLabelhttp://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/InlineLabel.html.
Read layout 
guidehttp://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html
to
see how arrange your components.

Juan

2011/6/14 Sanjay Jain India snj...@gmail.com

 Hello all
 I am using GWT2.3.In this I want to create a form.For This I used a
 form panel and texbox.Textbox is for the User Name purpose.So I want
 to set the label of text box.But there no way to set label.
 I want label at the left side of the text box.

 Please help me how to set label, So It come left to text box.
 Thanks In Advance

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



weird production compile problem

2011-06-14 Thread pansen
hey guys,

i think we have a massive problem with the generated js sources for
production. we built a larger app and since now all worked like a
charm, we had not a single stopper.

at the moment there is a strange issue. when i use the static app it
seems like there is a confusion about the generic-type or the content
of it. let me first show you the gwttest i wrote to let you see what
happens::

package net.vz.common.widgets.client.profile.lastvisitors;

import java.util.List;
import java.util.logging.Logger;

import net.vz.common.services.client.registry.Registry;
import net.vz.common.services.client.restdto.GenericListDto;
import net.vz.common.services.client.restdto.MinUserDto;
import net.vz.common.services.client.restservice.UserService;
import
net.vz.common.services.client.resty.vzcore.SimpleMethodCallback;
import net.vz.common.widgets.client.bundles.UnifiedResources;
import net.vz.common.widgets.client.i18n.LocalMessages;
import net.vz.common.widgets.client.listitem.GenericImageSlider;
import net.vz.common.widgets.client.listitem.GenericList;
import net.vz.common.widgets.client.listitem.renderer.MinUserRenderer;
import
net.vz.common.widgets.client.simpleItem.inject.SimpleItemModule;
import net.vz.common.widgets.client.toolbox.custompanels.ListPanel;
import net.vz.common.widgets.client.toolbox.slideBar.SlideBarActivity;
import net.vz.common.widgets.client.toolbox.slideBar.SlideBarView;
import net.vz.common.widgets.client.toolbox.slideBar.SlideBarViewImpl;

import org.fusesource.restygwt.client.Method;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.SimplePanel;

/**
 * try to reconstruct a production bug which seems to be caused by
wrong typing
 * from gwt??!
 *
 * @author abalke
 */
public class ProfileLastVisitorsActivityTestGwt extends GWTTestCase {

private static final String userKey = U:test_user;

@Override
public String getModuleName() {
return SimpleItemModule.MODULE_NAME;
}

public void testDo() {
LocalMessages localMessages = GWT.create(LocalMessages.class);
UnifiedResources unifiedResources = new UnifiedResources();

ListPanel ul = GWT.create(ListPanel.class);
SlideBarView sidebarView = GWT.create(SlideBarViewImpl.class);
SlideBarActivity slideBarActivity = new
SlideBarActivity(sidebarView);
GenericListMinUserDto genericLinkList = new
GenericListMinUserDto(unifiedResources);
GenericImageSliderMinUserDto slider = new
GenericImageSliderMinUserDto(
ul, slideBarActivity, genericLinkList,
unifiedResources);

ProfileLastVisitorsViewImpl__ view =
new ProfileLastVisitorsViewImpl__(localMessages);
UserService userService = GWT.create(UserService.class);
MinUserRenderer renderer = new MinUserRenderer();

AcceptsOneWidget panel = new SimplePanel();
SimpleEventBus eventBus = new SimpleEventBus();
ProfileLastVisitorsActivity a = new
ProfileLastVisitorsActivity(
view, userService, slider, renderer) {
protected void loadLastVisitors(String userId) {
userService.getLastVisitors(userId, new
SimpleMethodCallbackGenericListDtoMinUserDto() {
@Override
public void onSuccess(Method method,
GenericListDtoMinUserDto response) {
ListMinUserDto items = response.getItems();
if (Registry.canLog()) {
 
Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
.info(got a list of  +
MinUserDto.class + :  );
 
Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
.info(...  + items.get(0));
}
slider.render(items);
 
view.setLastVisitorsOverallCount(response.getCount());
view.show(true);

// in production, here is a wrong type
assertEquals(MinUserDto.class,
items.get(0).getClass());
assertEquals(true,
((ProfileLastVisitorsViewImpl__)view).getShowState());
finishTest();
}
});
}
};

a.start(panel, eventBus);

// the widget wants only to be loaded when this is my user
Registry.MY_USER_ID = userKey;

assertEquals(false, view.getShowState());
a.update(userKey);

delayTestFinish(5 * 1000);
}

class ProfileLastVisitorsViewImpl__ extends
ProfileLastVisitorsViewImpl {

private boolean isShown = false;

public ProfileLastVisitorsViewImpl__(LocalMessages
localMessages) {
super(localMessages);
}

@Override
public void show(boolean b) {
isShown = b;

Re: Local filesystem access

2011-06-14 Thread Juan Pablo Gardella
I think you can use gwt4air (use flash) .

Juan

2011/6/14 gwt_user csde...@gmail.com

 Hi,

 We need to be able to access physical files system from GWT
 application. Does anyone have any suggestions?

 Thanks!

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Local filesystem access

2011-06-14 Thread gwt_user
Hi,

We need to be able to access physical files system from GWT
application. Does anyone have any suggestions?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT pluggable GUIs

2011-06-14 Thread lemaiol
Hi Jaroslav,

Are you still interested on this topic? Maybe have a look at:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/42062c7f6cf8989b/e29d37a5f737d34e?lnk=gstq=pluggable#e29d37a5f737d34e
and give feedback.

cheers,
Berto

On May 5, 10:51 am, Jaroslav Urban jarour...@gmail.com wrote:
 Hello,

 I'm investigating the possibility to use GWT in our project. One of
 the requirements is the ability for extensible GUIs and possibly
 domain classes. I have the impression that it's not really possible
 (e.g. 
 seehttp://stackoverflow.com/questions/814647/is-it-possible-to-create-dy...).

 Let me explain our use case in more detail - basically we'd like our
 application to be extensible similarly to Eclipse platform. So the
 application would define a set of extension points that can be
 extended by plugins. One specific example - the application works with
 configurable entities that are configured via properties. The
 properties are typed (e.g. file path property has the type
 fileURL) and each type can have a specific editing GUI (file
 selection dialog in case of the file path). We need the ability of
 plugins to describe such configurable entities, and define new types
 of the properties with possibly new editing GUIs. From the point of
 view of the plugin it would register something like complexType type
 with its editing GUI provided by ComplexTypeEditor class.

 In effect the application would consist of a set of plugins - we don't
 necessarily need the plugins to be loadable at run-time (restart of
 the application might be OK). My impression is this is not possible
 because the GWT compiler takes all modules of the application and
 creates one big JavaScript (for each permutation). This would mean
 that kind-of plugin-ability would be possible only at compile time -
 the resulting application cannot be freely composed of plugins.

 Best regards,
 Jaroslav Urban

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



grid with CheckBoxSelectionModel

2011-06-14 Thread NANOUS
Hi all,
i have a problem when i use the CheckBoxSelectionModel in my grid is
that i can't define the listener.

So, i want extract information from the store when i checked some row
from the grid ( of course with the CheckBoxSelectionModel plugin)...

Someone can help me???  if there is some line of code that can help me
i would be grateful

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



RPC and Servlet

2011-06-14 Thread sam
What is the difference between RPC and HTTPServlet. I mean how
differently they work when connecting to a server.

Thank you
Sam

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Licensing

2011-06-14 Thread SS
When reading the licensing agreement (terms)
I found a reference to the Browser Detect Code as follows

Browser Detect v2.1.6   Creative Commons Attribution 1.0
google-web-toolkit.googlecode.com; transliterated into Java source

and also came across

Protocol BuffersNew BSD License
code.google.com/p/protobuf

How does this impact Commercial Software development? Both these
licenses are not acceptable to our company and was wondering whether
it would impact developing the software in GWT...

Thanks for your help in advance

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



How to start a web service which only return plain text with GWT?

2011-06-14 Thread Hong Kong Youth IT Group
Hi everyone,

I am a newbie to GWT and working on a web project which allow caller
to query data from database with given sql:

www.iamweb.com/callSQL=select NAME from CLASS_TABLE

First of all, I am not sure if GWT allows to return plain text (.csv)
instead of html?

Thanks very much in adv!

Adonis

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Wave rich text editor

2011-06-14 Thread Anton Starcev
Hello all,

Trying to extract rich text editor from the Wave, stuck with a compilation 
error:

  inherits name=com.google.common.collect.Collect/
  inherits name=org.waveprotocol.wave.client.Client/
  inherits name=org.waveprotocol.wave.client.editor.harness.EditorHarness 
/ 
... 

gwt compile produce: 
java 
Compiling module ru.artlebedev.ast.Admin 
   [ERROR] Errors in 
'jar:file:/mnt/sda1/projects/appengine/nucleus-app/war/WEB-INF/lib/client-common-src.jar!/org/waveprotocol/wave/client/common/util/UserAgentStaticProperties.java'
 
  [ERROR] Line 57: Rebind result 
'org.waveprotocol.wave.client.common.util.UserAgentStaticProperties' cannot 
be abstract 
   [ERROR] Cannot proceed due to previous errors 

When I replace in waveprotocol project in 
org.waveprotocol.wave.client.common.util.UserAgentStaticProperties string:
return GWT.create(UserAgentStaticProperties.class);

with:
return new FirefoxImpl();
everything is going well

Can anyone help?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/sxRSjlRXTYMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



CheckBoxSelectionModel

2011-06-14 Thread NANOUS
Bonjour,

Comment je peut ajouter un ActionListener à une grid ,sachant que
cette grid admet comme plugin un CheckBox,
et que l'action soit en relation avec ce plugin??

Merci d'avance

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Wave rich text editor

2011-06-14 Thread Anton Starcev
I didn't receive email notification, but I'm subscribed to the wave-dev 
mailing list now, thnx

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/BzyAjGuwa6IJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



CellTree with SingleSelectionModel will not fire event for root node (GWT 2.3)

2011-06-14 Thread Jens
Hi

I have a CellTree with a SingleSelectionModel, when i click the root
node it gets visually selected but does not fire a
SelectionChangeEvent, the problem is only for the root element.

Has anyone else discovered (is it by design / a bug / me that screwed
up).

My example is quite simple but i cannot post the code as is, but i can
clean it up and post it if required.

Best regards Jens

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Null Version

2011-06-14 Thread Pavel Byles
Anyone?

On Mon, Jun 13, 2011 at 9:23 AM, Pavel Byles pavelby...@gmail.com wrote:

 ??


 On Sat, Jun 11, 2011 at 12:20 AM, Pavel Byles pavelby...@gmail.comwrote:

 Sorry, DataNucleus.


 On Fri, Jun 10, 2011 at 5:44 AM, Juan Pablo Gardella 
 gardellajuanpa...@gmail.com wrote:

 So, what implementation of JPA are you using? EclipseLink, OpenJPA, ...


 2011/6/10 Pavel Byles pavelby...@gmail.com

 Not using hibernate.


 On Thu, Jun 9, 2011 at 11:33 PM, Juan Pablo Gardella 
 gardellajuanpa...@gmail.com wrote:

 Hibernate?


 2011/6/9 Pavel Byles pavelby...@gmail.com

 3.0-1.1.1


 On Thu, Jun 9, 2011 at 8:56 PM, Juan Pablo Gardella 
 gardellajuanpa...@gmail.com wrote:

 What implementation of JPA are you use?

 2011/6/9 Pavel Byles pavelby...@gmail.com

 anyone?

 On Wed, Jun 8, 2011 at 10:46 PM, Pavel Byles 
 pavelby...@gmail.comwrote:

 I'm getting the following error when I'm using requestfactory with
 locators:


 The persisted entity with id 152 has a null version

 I have a version column in my datastore and the following in my
 Entity:


 public Integer getVersion() {

   return this.version;

 }


 public void setVersion(Integer version) {

   this.version = version;

 }

 I also have this in my locator:

 @Override

 public Object getVersion(Country domainObject) {

   return domainObject.getVersion();

 }

 If I return 1 all the time for getVersion, everything works fine.

 I have looked at all the examples I could but there aren't many and
 tried to figure this out for a while. Things look right but doesn't 
 seem to
 work.

 Any ideas?

 --
 -Pav




 --
 -Pav

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




 --
 -Pav

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




 --
 -Pav

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com
 .
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




 --
 -Pav




 --
 --
 Pav




-- 
--
Pav

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Null Version

2011-06-14 Thread Juan Pablo Gardella
Can you make a sample to reproduce?

On Jun 14, 12:40 pm, Pavel Byles pavelby...@gmail.com wrote:
 Anyone?









 On Mon, Jun 13, 2011 at 9:23 AM, Pavel Byles pavelby...@gmail.com wrote:
  ??

  On Sat, Jun 11, 2011 at 12:20 AM, Pavel Byles pavelby...@gmail.comwrote:

  Sorry, DataNucleus.

  On Fri, Jun 10, 2011 at 5:44 AM, Juan Pablo Gardella 
  gardellajuanpa...@gmail.com wrote:

  So, what implementation of JPA are you using? EclipseLink, OpenJPA, ...

  2011/6/10 Pavel Byles pavelby...@gmail.com

  Not using hibernate.

  On Thu, Jun 9, 2011 at 11:33 PM, Juan Pablo Gardella 
  gardellajuanpa...@gmail.com wrote:

  Hibernate?

  2011/6/9 Pavel Byles pavelby...@gmail.com

  3.0-1.1.1

  On Thu, Jun 9, 2011 at 8:56 PM, Juan Pablo Gardella 
  gardellajuanpa...@gmail.com wrote:

  What implementation of JPA are you use?

  2011/6/9 Pavel Byles pavelby...@gmail.com

  anyone?

  On Wed, Jun 8, 2011 at 10:46 PM, Pavel Byles 
  pavelby...@gmail.comwrote:

  I'm getting the following error when I'm using requestfactory with
  locators:

  The persisted entity with id 152 has a null version

  I have a version column in my datastore and the following in my
  Entity:

  public Integer getVersion() {

    return this.version;

  }

  public void setVersion(Integer version) {

    this.version = version;

  }

  I also have this in my locator:

  @Override

  public Object getVersion(Country domainObject) {

    return domainObject.getVersion();

  }

  If I return 1 all the time for getVersion, everything works fine.

  I have looked at all the examples I could but there aren't many and
  tried to figure this out for a while. Things look right but doesn't 
  seem to
  work.

  Any ideas?

  --
  -Pav

  --
  -Pav

  --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

   --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

  --
  -Pav

  --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

   --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

  --
  -Pav

  --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

   --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-toolkit@googlegroups.com
  .
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

  --
  -Pav

  --
  --
  Pav

 --
 --
 Pav

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and Servlet

2011-06-14 Thread Juan Pablo Gardella
Both are servlets. See
http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html#DevGuideServerSide

2011/6/14 sam sanj.kan...@gmail.com

 What is the difference between RPC and HTTPServlet. I mean how
 differently they work when connecting to a server.

 Thank you
 Sam

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: weird production compile problem

2011-06-14 Thread pansen
the exception is::

java.lang.ClassCastException
at Unknown.com_google_gwt_core_client_impl_StackTraceCreator
$Collector_
$fillInStackTrace__Lcom_google_gwt_core_client_impl_StackTraceCreator
$Collector_2Ljava_lang_Throwable_2V(Unknown Source)
at
Unknown.java_lang_ClassCastException_ClassCastException__V(Unknown
Source)
at
Unknown.com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(Unknown
Source)
at
Unknown.net_vz_common_widgets_client_listitem_renderer_MinUserRenderer_render__Ljava_lang_Object_2ZLnet_vz_common_widgets_client_listitem_GenericList
$ImageSize_2Lnet_vz_common_widgets_client_bundles_UnifiedResources_2Lcom_google_gwt_user_client_ui_Widget_2(Unknown
Source)
at Unknown.net_vz_common_widgets_client_listitem_GenericList_
$addToList__Lnet_vz_common_widgets_client_listitem_GenericList_2Ljava_util_Collection_2Ljava_util_List_2(Unknown
Source)
at Unknown.anonymous(Unknown Source)
at
Unknown.net_vz_common_widgets_client_profile_lastvisitors_ProfileLastVisitorsActivity
$1_
$onSuccess__Lnet_vz_common_widgets_client_profile_lastvisitors_ProfileLastVisitorsActivity
$1_2Lorg_fusesource_restygwt_client_Method_2Lnet_vz_common_services_client_restdto_GenericListDto_2V(Unknown
Source)
at
Unknown.net_vz_common_widgets_client_profile_lastvisitors_ProfileLastVisitorsActivity
$1_onSuccess__Lorg_fusesource_restygwt_client_Method_2Ljava_lang_Object_2V(Unknown
Source)
at
Unknown.org_fusesource_restygwt_client_AbstractRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown
Source)
at
Unknown.org_fusesource_restygwt_client_callback_FilterawareRetryingCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown
Source)
at Unknown.com_google_gwt_http_client_Request_
$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown
Source)
at Unknown.com_google_gwt_http_client_RequestBuilder
$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown
Source)
at Unknown.anonymous(Unknown Source)
at
Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown
Source)
at
Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown
Source)
at Unknown.anonymous(Unknown Source)
at Unknown.anonymous(Unknown Source)
at Unknown.anonymous(Unknown Source)

On 14 Jun., 15:47, pansen andi.ba...@googlemail.com wrote:
 hey guys,

 i think we have a massive problem with the generated js sources for
 production. we built a larger app and since now all worked like a
 charm, we had not a single stopper.

 at the moment there is a strange issue. when i use the static app it
 seems like there is a confusion about the generic-type or the content
 of it. let me first show you the gwttest i wrote to let you see what
 happens::

 package net.vz.common.widgets.client.profile.lastvisitors;

 import java.util.List;
 import java.util.logging.Logger;

 import net.vz.common.services.client.registry.Registry;
 import net.vz.common.services.client.restdto.GenericListDto;
 import net.vz.common.services.client.restdto.MinUserDto;
 import net.vz.common.services.client.restservice.UserService;
 import
 net.vz.common.services.client.resty.vzcore.SimpleMethodCallback;
 import net.vz.common.widgets.client.bundles.UnifiedResources;
 import net.vz.common.widgets.client.i18n.LocalMessages;
 import net.vz.common.widgets.client.listitem.GenericImageSlider;
 import net.vz.common.widgets.client.listitem.GenericList;
 import net.vz.common.widgets.client.listitem.renderer.MinUserRenderer;
 import
 net.vz.common.widgets.client.simpleItem.inject.SimpleItemModule;
 import net.vz.common.widgets.client.toolbox.custompanels.ListPanel;
 import net.vz.common.widgets.client.toolbox.slideBar.SlideBarActivity;
 import net.vz.common.widgets.client.toolbox.slideBar.SlideBarView;
 import net.vz.common.widgets.client.toolbox.slideBar.SlideBarViewImpl;

 import org.fusesource.restygwt.client.Method;

 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.shared.SimpleEventBus;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.user.client.ui.AcceptsOneWidget;
 import com.google.gwt.user.client.ui.SimplePanel;

 /**
  * try to reconstruct a production bug which seems to be caused by
 wrong typing
  * from gwt??!
  *
  * @author abalke
  */
 public class ProfileLastVisitorsActivityTestGwt extends GWTTestCase {

     private static final String userKey = U:test_user;

     @Override
     public String getModuleName() {
         return SimpleItemModule.MODULE_NAME;
     }

     public void testDo() {
         LocalMessages localMessages = GWT.create(LocalMessages.class);
         UnifiedResources unifiedResources = new 

Re: CheckBoxSelectionModel

2011-06-14 Thread Juan Pablo Gardella
In english please

2011/6/14 NANOUS gaied.a...@gmail.com

 Bonjour,

 Comment je peut ajouter un ActionListener à une grid ,sachant que
 cette grid admet comme plugin un CheckBox,
 et que l'action soit en relation avec ce plugin??

 Merci d'avance

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to start a web service which only return plain text with GWT?

2011-06-14 Thread Juan Pablo Gardella
For this type of service I don't recommend GWT. GWT is for RIA application.
If you need a REST service, make a servlet and return csv directly.

Read about SQL injection too.

2011/6/14 Hong Kong Youth IT Group adonis@gmail.com

 Hi everyone,

 I am a newbie to GWT and working on a web project which allow caller
 to query data from database with given sql:

 www.iamweb.com/callSQL=select NAME from CLASS_TABLE

 First of all, I am not sure if GWT allows to return plain text (.csv)
 instead of html?

 Thanks very much in adv!

 Adonis

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: grid with CheckBoxSelectionModel

2011-06-14 Thread Juan Pablo Gardella
Check this 
threadhttp://groups.google.com/group/google-web-toolkit/browse_thread/thread/2b907ca2a4469a6b?pli=1

2011/6/14 NANOUS gaied.a...@gmail.com

 Hi all,
 i have a problem when i use the CheckBoxSelectionModel in my grid is
 that i can't define the listener.

 So, i want extract information from the store when i checked some row
 from the grid ( of course with the CheckBoxSelectionModel plugin)...

 Someone can help me???  if there is some line of code that can help me
 i would be grateful

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: weird production compile problem

2011-06-14 Thread Juan Pablo Gardella
Are you use third gwt libraries ? for example gin, etc.? What version of gwt
are you use?

2011/6/14 pansen andi.ba...@googlemail.com

 hey guys,

 i think we have a massive problem with the generated js sources for
 production. we built a larger app and since now all worked like a
 charm, we had not a single stopper.

 at the moment there is a strange issue. when i use the static app it
 seems like there is a confusion about the generic-type or the content
 of it. let me first show you the gwttest i wrote to let you see what
 happens::

 package net.vz.common.widgets.client.profile.lastvisitors;

 import java.util.List;
 import java.util.logging.Logger;

 import net.vz.common.services.client.registry.Registry;
 import net.vz.common.services.client.restdto.GenericListDto;
 import net.vz.common.services.client.restdto.MinUserDto;
 import net.vz.common.services.client.restservice.UserService;
 import
 net.vz.common.services.client.resty.vzcore.SimpleMethodCallback;
 import net.vz.common.widgets.client.bundles.UnifiedResources;
 import net.vz.common.widgets.client.i18n.LocalMessages;
 import net.vz.common.widgets.client.listitem.GenericImageSlider;
 import net.vz.common.widgets.client.listitem.GenericList;
 import net.vz.common.widgets.client.listitem.renderer.MinUserRenderer;
 import
 net.vz.common.widgets.client.simpleItem.inject.SimpleItemModule;
 import net.vz.common.widgets.client.toolbox.custompanels.ListPanel;
 import net.vz.common.widgets.client.toolbox.slideBar.SlideBarActivity;
 import net.vz.common.widgets.client.toolbox.slideBar.SlideBarView;
 import net.vz.common.widgets.client.toolbox.slideBar.SlideBarViewImpl;

 import org.fusesource.restygwt.client.Method;

 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.shared.SimpleEventBus;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.user.client.ui.AcceptsOneWidget;
 import com.google.gwt.user.client.ui.SimplePanel;

 /**
  * try to reconstruct a production bug which seems to be caused by
 wrong typing
  * from gwt??!
  *
  * @author abalke
  */
 public class ProfileLastVisitorsActivityTestGwt extends GWTTestCase {

private static final String userKey = U:test_user;

@Override
public String getModuleName() {
return SimpleItemModule.MODULE_NAME;
}

public void testDo() {
LocalMessages localMessages = GWT.create(LocalMessages.class);
UnifiedResources unifiedResources = new UnifiedResources();

ListPanel ul = GWT.create(ListPanel.class);
SlideBarView sidebarView = GWT.create(SlideBarViewImpl.class);
SlideBarActivity slideBarActivity = new
 SlideBarActivity(sidebarView);
GenericListMinUserDto genericLinkList = new
 GenericListMinUserDto(unifiedResources);
GenericImageSliderMinUserDto slider = new
 GenericImageSliderMinUserDto(
ul, slideBarActivity, genericLinkList,
 unifiedResources);

ProfileLastVisitorsViewImpl__ view =
new ProfileLastVisitorsViewImpl__(localMessages);
UserService userService = GWT.create(UserService.class);
MinUserRenderer renderer = new MinUserRenderer();

AcceptsOneWidget panel = new SimplePanel();
SimpleEventBus eventBus = new SimpleEventBus();
ProfileLastVisitorsActivity a = new
 ProfileLastVisitorsActivity(
view, userService, slider, renderer) {
protected void loadLastVisitors(String userId) {
userService.getLastVisitors(userId, new
 SimpleMethodCallbackGenericListDtoMinUserDto() {
@Override
public void onSuccess(Method method,
 GenericListDtoMinUserDto response) {
ListMinUserDto items = response.getItems();
if (Registry.canLog()) {

 Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
.info(got a list of  +
 MinUserDto.class + :  );

 Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
.info(...  + items.get(0));
}
slider.render(items);

 view.setLastVisitorsOverallCount(response.getCount());
view.show(true);

// in production, here is a wrong type
assertEquals(MinUserDto.class,
 items.get(0).getClass());
assertEquals(true,
 ((ProfileLastVisitorsViewImpl__)view).getShowState());
finishTest();
}
});
}
};

a.start(panel, eventBus);

// the widget wants only to be loaded when this is my user
Registry.MY_USER_ID = userKey;

assertEquals(false, view.getShowState());
a.update(userKey);

delayTestFinish(5 * 1000);
}

class ProfileLastVisitorsViewImpl__ extends
 ProfileLastVisitorsViewImpl {

private boolean isShown = false;

public 

ArrayOutOfBoundsException in editor 2.3

2011-06-14 Thread Ann Smith
hi

before I spend all night debugging  maybe someone can share his
experience with me.
Problem:
gwt 2.2 code works fine - 2.3 in a single method use of
editor.edit(proxy,context) throws me ArrayOutOfBoundsException

Anyone has had it too?

regards

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: ArrayOutOfBoundsException in editor 2.3

2011-06-14 Thread Juan Pablo Gardella
Can you make a sample?

2011/6/14 Ann Smith frugof...@gmail.com

 hi

 before I spend all night debugging  maybe someone can share his
 experience with me.
 Problem:
 gwt 2.2 code works fine - 2.3 in a single method use of
 editor.edit(proxy,context) throws me ArrayOutOfBoundsException

 Anyone has had it too?

 regards

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How does registerForProxyType works

2011-06-14 Thread Juan Pablo Gardella
If you propage a event via eventBus don't work?

2011/6/14 Aldo Neto tumo...@gmail.com

 Hi,

 I need to implement a dynamic table that is populated based on values of a
 given entity on the server by many clients simultaneously. I thought
 that registerForProxyType() would solve all problems of mine, but then I
 made some quick tests and found that it is not called when a different
 client performs changes to that table. Is this correct? I mean, If I have 2
 persons working on the same table and one updates an entry there, should I
 expect to be notified on both clients? If not, is there an easy way to do
 that?

 Thanks,
 Aldo

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



How does registerForProxyType works

2011-06-14 Thread Aldo Neto
Hi,

I need to implement a dynamic table that is populated based on values of a
given entity on the server by many clients simultaneously. I thought
that registerForProxyType() would solve all problems of mine, but then I
made some quick tests and found that it is not called when a different
client performs changes to that table. Is this correct? I mean, If I have 2
persons working on the same table and one updates an entry there, should I
expect to be notified on both clients? If not, is there an easy way to do
that?

Thanks,
Aldo

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: weird production compile problem

2011-06-14 Thread pansen
thx juan, sorry for the noise. i found out 1 hour ago that the problem
is with 99% percent probabilty related to restygwt. i'm happy i found
this, now we'll see if i can fix it ;)

keep you updated.

cheers, andi

On 14 Jun., 20:21, Juan Pablo Gardella gardellajuanpa...@gmail.com
wrote:
 Are you use third gwt libraries ? for example gin, etc.? What version of gwt
 are you use?

 2011/6/14 pansen andi.ba...@googlemail.com







  hey guys,

  i think we have a massive problem with the generated js sources for
  production. we built a larger app and since now all worked like a
  charm, we had not a single stopper.

  at the moment there is a strange issue. when i use the static app it
  seems like there is a confusion about the generic-type or the content
  of it. let me first show you the gwttest i wrote to let you see what
  happens::

  package net.vz.common.widgets.client.profile.lastvisitors;

  import java.util.List;
  import java.util.logging.Logger;

  import net.vz.common.services.client.registry.Registry;
  import net.vz.common.services.client.restdto.GenericListDto;
  import net.vz.common.services.client.restdto.MinUserDto;
  import net.vz.common.services.client.restservice.UserService;
  import
  net.vz.common.services.client.resty.vzcore.SimpleMethodCallback;
  import net.vz.common.widgets.client.bundles.UnifiedResources;
  import net.vz.common.widgets.client.i18n.LocalMessages;
  import net.vz.common.widgets.client.listitem.GenericImageSlider;
  import net.vz.common.widgets.client.listitem.GenericList;
  import net.vz.common.widgets.client.listitem.renderer.MinUserRenderer;
  import
  net.vz.common.widgets.client.simpleItem.inject.SimpleItemModule;
  import net.vz.common.widgets.client.toolbox.custompanels.ListPanel;
  import net.vz.common.widgets.client.toolbox.slideBar.SlideBarActivity;
  import net.vz.common.widgets.client.toolbox.slideBar.SlideBarView;
  import net.vz.common.widgets.client.toolbox.slideBar.SlideBarViewImpl;

  import org.fusesource.restygwt.client.Method;

  import com.google.gwt.core.client.GWT;
  import com.google.gwt.event.shared.SimpleEventBus;
  import com.google.gwt.junit.client.GWTTestCase;
  import com.google.gwt.user.client.ui.AcceptsOneWidget;
  import com.google.gwt.user.client.ui.SimplePanel;

  /**
   * try to reconstruct a production bug which seems to be caused by
  wrong typing
   * from gwt??!
   *
   * @author abalke
   */
  public class ProfileLastVisitorsActivityTestGwt extends GWTTestCase {

     private static final String userKey = U:test_user;

     @Override
     public String getModuleName() {
         return SimpleItemModule.MODULE_NAME;
     }

     public void testDo() {
         LocalMessages localMessages = GWT.create(LocalMessages.class);
         UnifiedResources unifiedResources = new UnifiedResources();

         ListPanel ul = GWT.create(ListPanel.class);
         SlideBarView sidebarView = GWT.create(SlideBarViewImpl.class);
         SlideBarActivity slideBarActivity = new
  SlideBarActivity(sidebarView);
         GenericListMinUserDto genericLinkList = new
  GenericListMinUserDto(unifiedResources);
         GenericImageSliderMinUserDto slider = new
  GenericImageSliderMinUserDto(
                 ul, slideBarActivity, genericLinkList,
  unifiedResources);

         ProfileLastVisitorsViewImpl__ view =
             new ProfileLastVisitorsViewImpl__(localMessages);
         UserService userService = GWT.create(UserService.class);
         MinUserRenderer renderer = new MinUserRenderer();

         AcceptsOneWidget panel = new SimplePanel();
         SimpleEventBus eventBus = new SimpleEventBus();
         ProfileLastVisitorsActivity a = new
  ProfileLastVisitorsActivity(
                 view, userService, slider, renderer) {
             protected void loadLastVisitors(String userId) {
                 userService.getLastVisitors(userId, new
  SimpleMethodCallbackGenericListDtoMinUserDto() {
                     @Override
                     public void onSuccess(Method method,
  GenericListDtoMinUserDto response) {
                         ListMinUserDto items = response.getItems();
                         if (Registry.canLog()) {

  Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
                                 .info(got a list of  +
  MinUserDto.class + :  );

  Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
                                 .info(...  + items.get(0));
                         }
                         slider.render(items);

  view.setLastVisitorsOverallCount(response.getCount());
                         view.show(true);

                         // in production, here is a wrong type
                         assertEquals(MinUserDto.class,
  items.get(0).getClass());
                         assertEquals(true,
  ((ProfileLastVisitorsViewImpl__)view).getShowState());
                         finishTest();
                     }
                 });
             }
         };

         

Re: CheckboxCell 2 clicks for selection, when using SingleSelectionModel

2011-06-14 Thread bb.f.pav
Ok, np, Thx you Juan for your patience/ efforts

On 14 Jun., 13:10, Juan Pablo Gardella gardellajuanpa...@gmail.com
wrote:
 The only difference I see is addSelectionChangeHandler. I don't see an
 error, sorry

 2011/6/14 bb.f.pav bb.f@googlemail.com







  Hi Patrick,

  unfortunately i'll need the single selection model for the purpose of
  the project ;)

  Thx
  bb.f.pav

  On 13 Jun., 22:42, Patrick Tucker tucker...@gmail.com wrote:
   If you don't need the selection model, try NoSelectionModel.

   On Jun 13, 2:56 pm, bb.f.pav bb.f@googlemail.com wrote:

Hi Juan,

1) i'm not yet reached that point. i'm using the stockwatcher examples
as basis for my celltable example and run it via eclipse as web
application
    that's my module.gwt.xml

?xml version=1.0 encoding=UTF-8?
module rename-to='mysamplegwtohnemaven'
  !-- Inherit the core Web Toolkit stuff.                        --
  inherits name='com.google.gwt.user.User'/

  !-- Inherit the default GWT style sheet.  You can change       --
  !-- the theme of your GWT application by uncommenting          --
  !-- any one of the following lines.                            --
  inherits name='com.google.gwt.user.theme.standard.Standard'/

  !-- Specify the app entry point class.                         --
  entry-point
class='de.f10rian.mySampleGwtOhneMaven.client.MySampleGwtOhneMaven'/

  !-- Specify the paths for translatable code                    --
  source path='client'/
  source path='shared'/

/module

2) Here is my CellTableExample code. hopefully you'll see my error:

public class CellTableExample extends Composite {

        private static CellTableExampleUiBinder uiBinder = GWT
                        .create(CellTableExampleUiBinder.class);

        interface CellTableExampleUiBinder extends
                        UiBinderWidget, CellTableExample {
        }

        @UiField
        CellTablePerson ct;

        ListLong checkBoxSelectedIds = new ArrayListLong();

        private final ListDataProviderPerson dataProvider = new
ListDataProviderPerson();
        private final SingleSelectionModelPerson singleSelectionModel
  = new
SingleSelectionModelPerson();

        {
                singleSelectionModel.addSelectionChangeHandler(new
  Handler() {
                        @Override
                        public void
  onSelectionChange(SelectionChangeEvent event) {
                                GWT.log(getSelectedObject +
singleSelectionModel.getSelectedObject().toString());
                        }
                });
        }

        public CellTableExample() {
                initWidget(uiBinder.createAndBindUi(this));

                // name column
                ColumnPerson, String nameCol = new ColumnPerson,
  String(
                                new TextInputCell()){
                        public String getValue(Person object) {
                                return object.getName();
                        }
                };

                nameCol.setFieldUpdater(new FieldUpdaterPerson,
  String() {
                        public void update(int index, Person object,
  String value) {
                                object.setName(value);
                        }
                });

                // title column
                ColumnPerson, String forenameCol = new ColumnPerson,
  String(
                                new TextInputCell()){
                        public String getValue(Person object) {
                                return object.getForeName();
                        }
                };

                forenameCol.setFieldUpdater(new FieldUpdaterPerson,
  String() {
                        public void update(int index, Person object,
  String value) {
                                object.setForeName(value);
                        }
                });

                /*
                 * add check column
                 */
                ColumnPerson, Boolean cbCol = new ColumnPerson,
  Boolean(new
   CheckboxCell()) {
                        public Boolean getValue(Person object) {
                                GWT.log(cbCol.getValue:  +
  Boolean.FALSE);
                                return object.isSelected();
                        }
                };

                cbCol.setFieldUpdater(new FieldUpdaterPerson,
  Boolean() {
                        public void update(int index, Person object,
  Boolean value) {
                                GWT.log(cbCol.setValue:  + value);
                                object.setSelected(value);
                        }
                });

                // Add the columns.
       

Re: GWT and Maven

2011-06-14 Thread jgonian
Also, you can find a bare minimum POM which works with Maven and Google 
Plugin for Eclipse here https://github.com/jgonian/GWT-maven-GPE-sample.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/J70NrcuqBZAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



JClassType source and isGenericType()

2011-06-14 Thread pansen
hi,

assuming i'm in a generator and receive a ``JClassType source`` which
is in that case a ``org.test.FooBar``.

then ``souce.isGenericType()`` returns ``null``
but ``source.getParameterizedQualifiedSourceName()`` returns
org.test.FooBar.
whereas ``source.getSimpleSourceName()`` only returns Foo

...which is a problem for me.

what can i call to see this is a specialization of a generic? e.g.
something like ``source.base().isGenericType()``.

what can i call to see the specialization of this class - in this case
i want the result of Bar.

thx a lot, andi

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Widget not displayed upon change of place

2011-06-14 Thread Harry X
I have a display region which will display diffrent widgets accpording place 
change event. 
The widgets are simple, haveing a couple of tables in a flowpanel and making a 
async call 
to get some data through RPC. When the place change events are fired by 
clicking 
on a 
navigation tree, sometimes the widgets are not displayed. However, 
A second click on the navi tree will trigger the widget to be displayed.

I think this has something to do with the handling with onStop()/onCancel(), 
but 
not
sure how to debug and change. Do you have any suggestion? Thanks.

Harry

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How does registerForProxyType works

2011-06-14 Thread Aldo Neto
Hi,

Thanks for the hint, but unless I'm doing something wrong I'm still not
being notified. Please note that when I say other clients I mean different
users working on different machines accessing the same table on the same
server.

As I said, I expected that everyone would be notified when registering
to registerForProxyType(). If this is not the case, the only thing that
comes to my mind is to periodically request for all the entries that I'm
interested. But again, I'd expect to have a way to PUSH the information I
need, and this is what I'm not being able to do.

Am I missing something? Any other idea?

Thanks


On Tue, Jun 14, 2011 at 3:49 PM, Juan Pablo Gardella 
gardellajuanpa...@gmail.com wrote:

 If you propage a event via eventBus don't work?

 2011/6/14 Aldo Neto tumo...@gmail.com

 Hi,

 I need to implement a dynamic table that is populated based on values of a
 given entity on the server by many clients simultaneously. I thought
 that registerForProxyType() would solve all problems of mine, but then I
 made some quick tests and found that it is not called when a different
 client performs changes to that table. Is this correct? I mean, If I have 2
 persons working on the same table and one updates an entry there, should I
 expect to be notified on both clients? If not, is there an easy way to do
 that?

 Thanks,
 Aldo

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: weird production compile problem

2011-06-14 Thread pansen
ok, i found the problem and fixed it in restygwt:
https://github.com/pansen/resty-gwt/commit/d6f63d9146f407fd12e9f1ab4cfccfa0c7a2d154

if someone could help me with that
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/e0f8392cf222a0ef
, i could finalize this in a smarter way.

cheers, andi

On 14 Jun., 20:55, pansen andi.ba...@googlemail.com wrote:
 thx juan, sorry for the noise. i found out 1 hour ago that the problem
 is with 99% percent probabilty related to restygwt. i'm happy i found
 this, now we'll see if i can fix it ;)

 keep you updated.

 cheers, andi

 On 14 Jun., 20:21, Juan Pablo Gardella gardellajuanpa...@gmail.com
 wrote:







  Are you use third gwt libraries ? for example gin, etc.? What version of gwt
  are you use?

  2011/6/14 pansen andi.ba...@googlemail.com

   hey guys,

   i think we have a massive problem with the generated js sources for
   production. we built a larger app and since now all worked like a
   charm, we had not a single stopper.

   at the moment there is a strange issue. when i use the static app it
   seems like there is a confusion about the generic-type or the content
   of it. let me first show you the gwttest i wrote to let you see what
   happens::

   package net.vz.common.widgets.client.profile.lastvisitors;

   import java.util.List;
   import java.util.logging.Logger;

   import net.vz.common.services.client.registry.Registry;
   import net.vz.common.services.client.restdto.GenericListDto;
   import net.vz.common.services.client.restdto.MinUserDto;
   import net.vz.common.services.client.restservice.UserService;
   import
   net.vz.common.services.client.resty.vzcore.SimpleMethodCallback;
   import net.vz.common.widgets.client.bundles.UnifiedResources;
   import net.vz.common.widgets.client.i18n.LocalMessages;
   import net.vz.common.widgets.client.listitem.GenericImageSlider;
   import net.vz.common.widgets.client.listitem.GenericList;
   import net.vz.common.widgets.client.listitem.renderer.MinUserRenderer;
   import
   net.vz.common.widgets.client.simpleItem.inject.SimpleItemModule;
   import net.vz.common.widgets.client.toolbox.custompanels.ListPanel;
   import net.vz.common.widgets.client.toolbox.slideBar.SlideBarActivity;
   import net.vz.common.widgets.client.toolbox.slideBar.SlideBarView;
   import net.vz.common.widgets.client.toolbox.slideBar.SlideBarViewImpl;

   import org.fusesource.restygwt.client.Method;

   import com.google.gwt.core.client.GWT;
   import com.google.gwt.event.shared.SimpleEventBus;
   import com.google.gwt.junit.client.GWTTestCase;
   import com.google.gwt.user.client.ui.AcceptsOneWidget;
   import com.google.gwt.user.client.ui.SimplePanel;

   /**
    * try to reconstruct a production bug which seems to be caused by
   wrong typing
    * from gwt??!
    *
    * @author abalke
    */
   public class ProfileLastVisitorsActivityTestGwt extends GWTTestCase {

      private static final String userKey = U:test_user;

      @Override
      public String getModuleName() {
          return SimpleItemModule.MODULE_NAME;
      }

      public void testDo() {
          LocalMessages localMessages = GWT.create(LocalMessages.class);
          UnifiedResources unifiedResources = new UnifiedResources();

          ListPanel ul = GWT.create(ListPanel.class);
          SlideBarView sidebarView = GWT.create(SlideBarViewImpl.class);
          SlideBarActivity slideBarActivity = new
   SlideBarActivity(sidebarView);
          GenericListMinUserDto genericLinkList = new
   GenericListMinUserDto(unifiedResources);
          GenericImageSliderMinUserDto slider = new
   GenericImageSliderMinUserDto(
                  ul, slideBarActivity, genericLinkList,
   unifiedResources);

          ProfileLastVisitorsViewImpl__ view =
              new ProfileLastVisitorsViewImpl__(localMessages);
          UserService userService = GWT.create(UserService.class);
          MinUserRenderer renderer = new MinUserRenderer();

          AcceptsOneWidget panel = new SimplePanel();
          SimpleEventBus eventBus = new SimpleEventBus();
          ProfileLastVisitorsActivity a = new
   ProfileLastVisitorsActivity(
                  view, userService, slider, renderer) {
              protected void loadLastVisitors(String userId) {
                  userService.getLastVisitors(userId, new
   SimpleMethodCallbackGenericListDtoMinUserDto() {
                      @Override
                      public void onSuccess(Method method,
   GenericListDtoMinUserDto response) {
                          ListMinUserDto items = response.getItems();
                          if (Registry.canLog()) {

   Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
                                  .info(got a list of  +
   MinUserDto.class + :  );

   Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
                                  .info(...  + items.get(0));
                          }
                          slider.render(items);


Ref: Jdoconfig.xml

2011-06-14 Thread sam
Hi All,

During the build process a copy of jdo-config.xml is created in the
WAR folder, so m question is what is the name of that file.


Thx in Advanced
Sanjay

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



[gwt-contrib] Add test for builtin constraints (issue1458801)

2011-06-14 Thread nchalko

Reviewers: rchandia,

Description:
Add test for builtin constraints
[JSR 303 TCK Result] 138 of 257 (53.70%) Pass with 11 Failures and 7
Errors.


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

Affected files:
  A  
user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinConstraintsTest.java

  A user/test/com/google/gwt/validation/tck/BuiltinConstraintsGwtSuite.java
  M user/test/org/hibernate/jsr303/tck/tests/ValidationTck.gwt.xml
  A  
user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinConstraintsGwtTest.java
  A  
user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinValidatorOverrideGwtTest.java
  A  
user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/TckTest.gwt.xml
  A  
user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/TckTestValidatorFactory.java



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


[gwt-contrib] Re: Adds hooks to Widget reduce MVP boilerplate and enshrines the app-wide EventBus. (issue1449817)

2011-06-14 Thread bobv

Just a look at the user/src classes so far.


http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java
File user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java
(right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java#newcode41
user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java:41:
public static DefaultEventBusProvider instance() {
Why not also provide a static setInstance()?

Is there a ProviderEventBus interface this type could implement?
Sprinkling such a specific type name around an app seems a bit gross.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java#newcode68
user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java:68:
public EventBus get() {
Without making get() and init() abstract, anyone providing a subclass
could forget to override one or the other.  How about breaking this type
up in the way Scheduler and SchedulerImpl are arranged?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java
File user/src/com/google/gwt/user/client/ui/IsEventSource.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java#newcode28
user/src/com/google/gwt/user/client/ui/IsEventSource.java:28: * event
bus.
Why a String and not the general Object that Events can use as a source?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java
File user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java#newcode53
user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java:53: public
interface IsWidgetDriver {
This type name implies there should be a single method

  WidgetDriver asWidgetDriver();

WidgetDriver could then be an abstract base class to allow additional
lifecycle methods to be added in the future.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java
File user/src/com/google/gwt/user/client/ui/Widget.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode69
user/src/com/google/gwt/user/client/ui/Widget.java:69: private Command
updateDriver;
Sort fields?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode89
user/src/com/google/gwt/user/client/ui/Widget.java:89: public final H
extends EventHandler HandlerRegistration addBitlessDomHandler(final H
handler,
Why is the handler param final on these methods?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode580
user/src/com/google/gwt/user/client/ui/Widget.java:580: protected
EventBus requireEventBus() {
Instead of having two getEventBusMethods(), what about placing a boolean
flag on getEventBus() to say don't return null or at least delegating
from getEventBus() to getEventBus(boolean) so there's only one method
that actually makes EventBus objects pop into existence?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java
File
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java
(right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/HandlerRegistration.java#newcode37
user/src/com/google/web/bindery/event/shared/HandlerRegistration.java:37:
public class Null implements HandlerRegistration {
Do you ever need more than one instance of this type?
HandlerRegistration.NULL might be a better choice.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java
File
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java
(right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java#newcode37
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java:37:
public ResettableEventBus(EventBus wrappedBus, String name) {
If the eventSourceName is turned into an Object eventSourceTag, it would
allow users to use enums or other Objects for dispatch instead of
descending into String-matching hell.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java#newcode77
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java:77:

Extra whitespace.

http://gwt-code-reviews.appspot.com/1449817/

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


[gwt-contrib] Re: Add test for builtin constraints (issue1458801)

2011-06-14 Thread rchandia

On 2011/06/14 06:34:54, Nick Chalko wrote:

LGTM

http://gwt-code-reviews.appspot.com/1458801/

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


[gwt-contrib] Re: Crude AST versioning. (issue1450816)

2011-06-14 Thread scottb

Updated per your advice.

http://gwt-code-reviews.appspot.com/1450816/

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


[gwt-contrib] [google-web-toolkit] r10330 committed - Add test for builtin constraints...

2011-06-14 Thread codesite-noreply

Revision: 10330
Author:   gwt.mirror...@gmail.com
Date: Tue Jun 14 07:47:25 2011
Log:  Add test for builtin constraints
[JSR 303 TCK Result] 138 of 257 (53.70%) Pass with 11 Failures and 7 Errors.

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

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

Added:
  
/trunk/user/test/com/google/gwt/validation/tck/BuiltinConstraintsGwtSuite.java
  
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints
  
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinConstraintsGwtTest.java
  
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinValidatorOverrideGwtTest.java
  
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/TckTest.gwt.xml
  
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/TckTestValidatorFactory.java
  
/trunk/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/constraints
  
/trunk/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints
  
/trunk/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinConstraintsTest.java

Modified:
 /trunk/user/test/org/hibernate/jsr303/tck/tests/ValidationTck.gwt.xml

===
--- /dev/null
+++  
/trunk/user/test/com/google/gwt/validation/tck/BuiltinConstraintsGwtSuite.java	 
Tue Jun 14 07:47:25 2011

@@ -0,0 +1,35 @@
+/*
+ * 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.validation.tck;
+
+import junit.framework.Test;
+
+import  
org.hibernate.jsr303.tck.tests.constraints.builtinconstraints.BuiltinConstraintsGwtTest;
+import  
org.hibernate.jsr303.tck.tests.constraints.builtinconstraints.BuiltinValidatorOverrideGwtTest;

+import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
+
+/**
+ * Tck Tests for the {@code constraints builtinconstraints} package.
+ */
+public class BuiltinConstraintsGwtSuite {
+  public static Test suite() {
+TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
+TCK for GWT Validation, constraints builtinconstraints package);
+suite.addTestSuite(BuiltinConstraintsGwtTest.class);
+suite.addTestSuite(BuiltinValidatorOverrideGwtTest.class);
+return suite;
+  }
+}
===
--- /dev/null
+++  
/trunk/user/test/org/hibernate/jsr303/tck/tests/constraints/builtinconstraints/BuiltinConstraintsGwtTest.java	 
Tue Jun 14 07:47:25 2011

@@ -0,0 +1,152 @@
+/*
+ * 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 org.hibernate.jsr303.tck.tests.constraints.builtinconstraints;
+
+import com.google.gwt.junit.client.GWTTestCase;
+
+import static  
org.hibernate.jsr303.tck.util.TestUtil.assertCorrectNumberOfViolations;
+import static  
org.hibernate.jsr303.tck.util.TestUtil.assertCorrectPropertyPaths;

+
+import org.hibernate.jsr303.tck.util.TestUtil;
+
+import java.util.Date;
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
+import javax.validation.constraints.Future;
+import javax.validation.constraints.Past;
+
+/**
+ * Test wrapper for {@link BuiltinConstraintsTest}.
+ *
+ * p
+ * NOTE: Test the Future and Past constraints here by hand because  
Hibernate
+ * does not use the super source version when creating the beanDescriptor  
for

+ * use at compile time.
+ */
+public class BuiltinConstraintsGwtTest extends GWTTestCase {
+
+  class FutureDummyEntity {
+
+@Future
+Date date;
+  }
+
+  class PastDummyEntity {
+
+@Past
+Date date;
+  }
+
+  private static final int DAYS_IN_MILLIS = 24 * 60 * 60 * 1000;
+
+  private final BuiltinConstraintsTest delegate = new  

[gwt-contrib] Re: Adds hooks to Widget reduce MVP boilerplate and enshrines the app-wide EventBus. (issue1449817)

2011-06-14 Thread jlabanca

See comments.  I think we can give users more control over when drivers
are started/stopped and make the flow a little more obtainable in the
process.


http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java
File user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java
(right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java#newcode54
user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java:54:
public static DefaultEventBusProvider instanceMaybe() {
Instead of making event sources do null checks, you could add a static
fireEvent/fireEventFromSource methods that do the null check for the
event source.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java
File user/src/com/google/gwt/user/client/ui/IsEventSource.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java#newcode28
user/src/com/google/gwt/user/client/ui/IsEventSource.java:28: * event
bus.
On 2011/06/14 12:29:25, bobv wrote:

Why a String and not the general Object that Events can use as a

source?

+1

Makes it hard to distinguish between multiple instances of the same
Widget, such as when used in a table column.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java
File user/src/com/google/gwt/user/client/ui/Widget.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode252
user/src/com/google/gwt/user/client/ui/Widget.java:252: * particular,
hiding a parent does not stop the drivers of its children.
This sounds like its going to cause problems.  If I detach a Panel,
ondetach will bubble down and stop the child drivers.  But if I hide a
Panel, that does not happen. That inconsistency is confusing and hard to
work around.   start() doesn't have enough information to know if I'm
invisible or if I'm detached, and I only need to descend in one of those
cases.

Instead, we could introduce two new methods to Widget: startDriver() and
stopDriver().  The contract of both methods should be that they descend
into child widgets.  By default, we call these methods from
onAttach/onDetach/setVisible.

Users should be able to set a boolean so they can manually control the
driver (possibly as an optional arg to setNextDriver).  If they take
manual control, then the user is responsible for calling
startDriver/stopDriver.  This is particularly useful if you plan to
attach/detach to widget often and don't necessarily want to kill the
driver. Its also useful if you don't want to disable the driver when the
widget is invisible.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode268
user/src/com/google/gwt/user/client/ui/Widget.java:268: driver.stop();
What if I set the driver within driver.stop()?  For example, maybe I
have a two drivers: one when the widget is active, one when its
inactive, and I swap them back and forth.

This should be more resilient:
IsWidgetDriver oldDriver = driver;
IsWidgetDriver newDriver = nextDriver;
driver = nextDriver;
if (...) {oldDriver.stop();}

// If setNextDriver was called in stop, newDriver is unused.
// Need to wait for updateDriver to execute asynchronously.
if (newDriver == nextDriver  ...) {
  nextDriver = null;
  newDriver.start()
}

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode320
user/src/com/google/gwt/user/client/ui/Widget.java:320: driver.start();
I'm worried that start/stop can get out of sync if the user overrides
setVisible().  Would it be better to maintain a boolean indicating that
the driver has been started?  If you take my suggestion for
startDriver/stopDriver, its an even better idea.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode364
user/src/com/google/gwt/user/client/ui/Widget.java:364: return new
ResettableEventBus(requireEventBus(), getEventSourceName());
Is like a temporary event bus?  Is the idea that a driver will spawn an
event bus and use it until its stopped?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode434
user/src/com/google/gwt/user/client/ui/Widget.java:434:
DefaultEventBusProvider ebProvider =
DefaultEventBusProvider.instanceMaybe();
This might be a bit too smart.  getEventBus() may or may not return null
depending on when the user adds a handler to
DefaultEventBusProvider.instance().

DefaultEventBusProvider.instance().eventBus().addHandler(...)
myWidget.getEventBus().addHandler(); // Works


myWidget.getEventBus().addHandler(); // NPE
DefaultEventBusProvider.instance().eventBus().addHandler(...)


[gwt-contrib] Re: Crude AST versioning. (issue1450816)

2011-06-14 Thread zundel

On 2011/06/14 14:14:05, scottb wrote:

Updated per your advice.


LGTM

http://gwt-code-reviews.appspot.com/1450816/

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


[gwt-contrib] Re: Convert samples/mobilewebapp to use maven. This paves the way to converting the sample to use GI... (issue1450809)

2011-06-14 Thread abhi
The POM files point to GWT 2.3 which means the code won't compile if
imported as a maven project as there are a bunch of new dependencies.
Since GWT 2.4 beta/m1 was released can we have a strategy of
maintaining a snapshot maven build to truly adhere to maven spirit?

On Jun 1, 3:57 pm, rj...@google.com wrote:
 r10253

 http://gwt-code-reviews.appspot.com/1450809/

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


[gwt-contrib] [google-web-toolkit] r10331 committed - Crude AST versioning....

2011-06-14 Thread codesite-noreply

Revision: 10331
Author:   sco...@google.com
Date: Tue Jun 14 05:20:58 2011
Log:  Crude AST versioning.

http://gwt-code-reviews.appspot.com/1450816/

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

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java

===
--- /trunk/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java	 
Thu May 12 10:40:46 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/CachedCompilationUnit.java	 
Tue Jun 14 05:20:58 2011

@@ -15,6 +15,7 @@
  */
 package com.google.gwt.dev.javac;

+import com.google.gwt.dev.jjs.impl.GwtAstBuilder;
 import com.google.gwt.dev.util.DiskCacheToken;

 import org.eclipse.jdt.core.compiler.CategorizedProblem;
@@ -27,6 +28,7 @@
  */
 public class CachedCompilationUnit extends CompilationUnit {
   private final DiskCacheToken astToken;
+  private final long astVersion;
   private final CollectionCompiledClass compiledClasses;
   private final ContentId contentId;
   private final Dependencies dependencies;
@@ -64,6 +66,7 @@
 this.isSuperSource = unit.isSuperSource();
 this.problems = unit.problems;
 this.astToken = unit.astToken;
+this.astVersion = unit.astVersion;
 this.sourceToken = unit.sourceToken;

 // Override these fields
@@ -106,6 +109,7 @@
   }
 }
 this.astToken = new DiskCacheToken(astToken);
+this.astVersion = GwtAstBuilder.getSerializationVersion();
 this.sourceToken = new DiskCacheToken(sourceToken);
   }

@@ -191,4 +195,8 @@
   CategorizedProblem[] getProblems() {
 return problems;
   }
-}
+
+  long getTypesSerializedVersion() {
+return astVersion;
+  }
+}
===
--- /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java	 
Mon Jun 13 07:52:03 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java	 
Tue Jun 14 05:20:58 2011

@@ -17,6 +17,7 @@

 import com.google.gwt.core.ext.TreeLogger;
 import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.dev.jjs.impl.GwtAstBuilder;
 import com.google.gwt.dev.util.log.speedtracer.DevModeEventType;
 import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger;
 import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
@@ -489,10 +490,15 @@
  */
 inputStream = new ObjectInputStream(bis);
 while (true) {
-  CompilationUnit unit = (CompilationUnit)  
inputStream.readObject();
+  CachedCompilationUnit unit = (CachedCompilationUnit)  
inputStream.readObject();

   if (unit == null) {
 break;
   }
+  if (GwtAstBuilder.ENABLED) {
+if (unit.getTypesSerializedVersion() !=  
GwtAstBuilder.getSerializationVersion()) {

+  continue;
+}
+  }
   UnitCacheEntry entry = new UnitCacheEntry(unit,  
UnitOrigin.PERSISTENT);
   UnitCacheEntry oldEntry =  
unitMap.get(unit.getResourcePath());
   if (oldEntry != null  unit.getLastModified()   
oldEntry.getUnit().getLastModified()) {

===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java	Mon  
Jun 13 12:05:05 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java	Tue  
Jun 14 05:20:58 2011

@@ -2752,6 +2752,13 @@

   public static boolean ENABLED =  
System.getProperties().containsKey(x.gwt.astBuilder);


+  /**
+   * Manually tracked version count.
+   *
+   * TODO(zundel): something much more awesome?
+   */
+  private static final long AST_VERSION = 1;
+
   private static final char[] _STRING = _String.toCharArray();
   private static final String ARRAY_LENGTH_FIELD = length;

@@ -2781,6 +2788,16 @@
   Unexpectedly unable to access  
ForeachStatement.collectionElementType via reflection, e);

 }
   }
+
+  /**
+   * Returns a serialization version number. Used to determine if the AST
+   * contained within cached compilation units is compatible with the  
current

+   * version of GWT.
+   */
+  public static long getSerializationVersion() {
+// TODO(zundel): something much awesomer.
+return ENABLED ? AST_VERSION : 0L;
+  }

   static String dotify(char[][] name) {
 StringBuffer result = new StringBuffer();

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


[gwt-contrib] A general purpose script injection class for injecting a script directly (issue1451818)

2011-06-14 Thread zundel

Reviewers: unnurg,

Description:
A general purpose script injection class for injecting a script directly
or adding a reference to a script by URL to the DOM


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

Affected files:
  A user/src/com/google/gwt/core/client/ScriptInjector.java
  M user/test/com/google/gwt/core/CoreSuite.java
  A user/test/com/google/gwt/core/client/ScriptInjectorTest.java
  A user/test/com/google/gwt/core/public/script_injector_test4.js
  A user/test/com/google/gwt/core/public/script_injector_test5.js
  A user/test/com/google/gwt/core/public/script_injector_test6.js
  A user/test/com/google/gwt/core/public/script_injector_test7.js


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


[gwt-contrib] Fixing login redirect in MobileWebApp sample. We now send a redirect URL with every request, an... (issue1450817)

2011-06-14 Thread jlabanca

Reviewers: rjrjr,

Description:
Fixing login redirect in MobileWebApp sample.  We now send a redirect
URL with every request, and use it if the user isn't logged in.  We
calculate the redirect URL on the client because the client browser has
built in support for parsing the URL components.

Example: http://jlabanca-testing.appspot.com/#tl:


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

Affected files:
  M  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java
  M  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java
  M  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/shared/GaeHelper.java



Index:  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java

===
---  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java	 
(revision 10331)
+++  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java	 
(working copy)

@@ -17,10 +17,11 @@

 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestBuilder;
 import com.google.gwt.http.client.RequestCallback;
 import com.google.gwt.http.client.Response;
 import com.google.gwt.sample.gaerequest.shared.GaeHelper;
-import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.Window.Location;
 import  
com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport;

 import com.google.web.bindery.requestfactory.shared.ServerFailure;

@@ -36,14 +37,29 @@
   }

   @Override
+  protected void configureRequestBuilder(RequestBuilder builder) {
+super.configureRequestBuilder(builder);
+
+/*
+ * Add the redirect URL in case the user is logged out.
+ *
+ * /MobileWebApp.html?parem0=value0param1=value1#hash
+ */
+String redirectUrl = Location.getPath() + Location.getQueryString() +  
Location.getHash();
+builder.setHeader(GaeHelper.REDIRECT_URL_HTTP_HEADER_NAME,  
redirectUrl);

+  }
+
+  @Override
   protected RequestCallback createRequestCallback(final TransportReceiver  
receiver) {
 final RequestCallback superCallback =  
super.createRequestCallback(receiver);


 return new RequestCallback() {
+  @Override
   public void onError(Request request, Throwable exception) {
 superCallback.onError(request, exception);
   }

+  @Override
   public void onResponseReceived(Request request, Response response) {
 /*
  * The GaeAuthFailure filter responds with  
Response.SC_UNAUTHORIZED and

@@ -51,15 +67,11 @@
  * receive that combo, post an event so that the app can handle  
things

  * as it sees fit.
  */
-
 if (Response.SC_UNAUTHORIZED == response.getStatusCode()) {
   String loginUrl = response.getHeader(login);
   if (loginUrl != null) {
-// Replace the redirect url placeholder with the current url.
-loginUrl = loginUrl.replace(GaeHelper.REDIRECT_URL_TOKEN,  
Window.Location.getHref());

-
 /*
- * Hand the receiver a non-fatal callback, so that *
+ * Hand the receiver a non-fatal callback, so that
  * com.google.web.bindery.requestfactory.shared.Receiver will  
not

  * post a runtime exception.
  */
Index:  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java

===
---  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java	 
(revision 10331)
+++  
samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java	 
(working copy)

@@ -35,9 +35,11 @@
  */
 public class GaeAuthFilter implements Filter {

+  @Override
   public void destroy() {
   }

+  @Override
   public void doFilter(ServletRequest servletRequest, ServletResponse  
servletResponse,

   FilterChain filterChain) throws IOException, ServletException {
 UserService userService = UserServiceFactory.getUserService();
@@ -45,7 +47,12 @@
 HttpServletResponse response = (HttpServletResponse) servletResponse;

 if (!userService.isUserLoggedIn()) {
-  response.setHeader(login,  
userService.createLoginURL(GaeHelper.REDIRECT_URL_TOKEN));
+  String redirectUrl =  
request.getHeader(GaeHelper.REDIRECT_URL_HTTP_HEADER_NAME);

+  if (redirectUrl == null || redirectUrl.length() == 0) {
+// Default to the root page if the redirecturl isn't specified in  
the request.

+redirectUrl = /MobileWebApp.html;
+  }
+  response.setHeader(login, userService.createLoginURL(redirectUrl));
   response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
  

[gwt-contrib] Resolve GWT.create() answers by source name (issue1450818)

2011-06-14 Thread scottb

Reviewers: zundel, jbrosenberg,


http://gwt-code-reviews.appspot.com/1450818/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java
File dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java (right):

http://gwt-code-reviews.appspot.com/1450818/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java#newcode960
dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java:960: }
I looked at factoring out a common sub-method, but the non-congruent
usage of internal vs. binary in searchForTypeByBinary made it
prohibitively nasty.



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

Affected files:
  M dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java


Index: dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java  
b/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java
index  
fff563d1ce461db4aced4dc225d8938f31ae2d10..f1a4246b0258268125fe40c8ed522a6e9d753da8  
100644

--- a/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java
@@ -360,7 +360,7 @@ public class UnifyAst {

   ArrayListJExpression instantiationExpressions = new  
ArrayListJExpression(answers.size());

   for (String answer : answers) {
-JDeclaredType answerType = searchForType(answer);
+JDeclaredType answerType = searchForTypeBySource(answer);
 if (answerType == null) {
   error(x, Rebind result ' + answer + ' could not be found);
   return null;
@@ -405,7 +405,7 @@ public class UnifyAst {
   JsniRef ref = JsniRef.parse(stringValue);
   if (ref != null) {
 if (Name.isBinaryName(ref.className())) {
-  searchForType(ref.className());
+  searchForTypeByBinary(ref.className());
 }
 node = JsniRefLookup.findJsniRefTarget(ref, program, new  
JsniRefLookup.ErrorReporter() {

   public void reportError(String errMsg) {
@@ -415,7 +415,7 @@ public class UnifyAst {
   } else {
 // See if it's just @foo.Bar, which would result in the class seed
 String typeName = stringValue.charAt(0) == '@' ?  
stringValue.substring(1) : stringValue;

-node = searchForType(typeName);
+node = searchForTypeByBinary(typeName);
   }
   if (node == null) {
 // Not found, must be null
@@ -469,6 +469,7 @@ public class UnifyAst {
   CLASS_IS_CLASS_METADATA_ENABLED));

   private final MapString, CompiledClass classFileMap;
+  private final MapString, CompiledClass classFileMapBySource;
   private boolean errorsFound = false;
   private final SetCompilationUnit failedUnits = new  
IdentityHashSetCompilationUnit();
   private final MapString, JField fieldMap = new HashMapString,  
JField();

@@ -511,23 +512,12 @@ public class UnifyAst {
 this.options = options;
 this.rpo = rpo;
 this.classFileMap = rpo.getCompilationState().getClassFileMap();
+this.classFileMapBySource =  
rpo.getCompilationState().getClassFileMapBySource();

   }

   public void addRootTypes(CollectionString sourceTypeNames) {
-MapString, CompiledClass classFileMapBySource =
-rpo.getCompilationState().getClassFileMapBySource();
 for (String sourceTypeName : sourceTypeNames) {
-  JDeclaredType type = program.getFromTypeMap(sourceTypeName);
-  if (type == null) {
-CompiledClass cc = classFileMapBySource.get(sourceTypeName);
-if (cc == null) {
-  // TODO: error
-  throw new NoClassDefFoundError(sourceTypeName);
-}
-assimilateUnit(cc.getUnit());
-type = program.getFromTypeMap(sourceTypeName);
-assert type != null || errorsFound;
-  }
+  searchForTypeBySource(sourceTypeName);
 }
   }

@@ -539,7 +529,7 @@ public class UnifyAst {
 this.logger = logger;
 for (String internalName : classFileMap.keySet()) {
   String typeName = InternalName.toBinaryName(internalName);
-  searchForType(typeName);
+  searchForTypeByBinary(typeName);
 }

 for (JDeclaredType type : program.getDeclaredTypes()) {
@@ -939,7 +929,7 @@ public class UnifyAst {
 type.resolve(resolvedInterfaces, resolvedRescues);
   }

-  private JDeclaredType searchForType(String binaryTypeName) {
+  private JDeclaredType searchForTypeByBinary(String binaryTypeName) {
 JDeclaredType type = program.getFromTypeMap(binaryTypeName);
 if (type == null) {
   CompiledClass cc =  
classFileMap.get(BinaryName.toInternalName(binaryTypeName));

@@ -954,6 +944,21 @@ public class UnifyAst {
 return type;
   }

+  private JDeclaredType searchForTypeBySource(String sourceTypeName) {
+JDeclaredType type = program.getFromTypeMap(sourceTypeName);
+if (type == null) {
+  CompiledClass cc = classFileMapBySource.get(sourceTypeName);
+  if (cc == null) {
+// TODO: error
+throw new NoClassDefFoundError(sourceTypeName);
+  }
+  assimilateUnit(cc.getUnit());
+  type = 

[gwt-contrib] Remove RenderablaComposite. \o/ (issue1455804)

2011-06-14 Thread rdcastro

Reviewers: rjrjr, rchandia,

Description:
Remove RenderablaComposite. \o/


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

Affected files:
  D user/src/com/google/gwt/user/client/ui/RenderableComposite.java


Index: user/src/com/google/gwt/user/client/ui/RenderableComposite.java
===
--- user/src/com/google/gwt/user/client/ui/RenderableComposite.java	 
(revision 10331)
+++ user/src/com/google/gwt/user/client/ui/RenderableComposite.java	 
(working copy)

@@ -1,31 +0,0 @@
-/*
- * Copyright 2011 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.user.client.ui;
-
-/**
- * EXPERIMENTAL and subject to change. Do not use this in production code.
- * p
- * A version of {@link Composite} that supports wrapping {@link Renderable}
- * widgets. This functionality will eventually be merged into {@link  
Composite}

- * itself, but is still under active development.
- * The only reason why this isn't a subclass of {@link Composite} is to  
avoid

- * messing up it's API, since {@link Composite} is very often subclassed.
- *
- * TODO(rdcastro): Delete this as soon as all references have been updated  
to

- * use Composite directly.
- */
-public abstract class RenderableComposite extends Composite {
-}


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


[gwt-contrib] Re: Remove RenderablaComposite. \o/ (issue1455804)

2011-06-14 Thread rchandia

On 2011/06/14 16:54:43, rdcastro wrote:

LGTM

http://gwt-code-reviews.appspot.com/1455804/

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


[gwt-contrib] Re: Resolve GWT.create() answers by source name (issue1450818)

2011-06-14 Thread zundel

LGTM

http://gwt-code-reviews.appspot.com/1450818/

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


[gwt-contrib] Re: Remove RenderablaComposite. \o/ (issue1455804)

2011-06-14 Thread Ray Ryan
LGTM

On Tue, Jun 14, 2011 at 10:09 AM, rchan...@google.com wrote:

 On 2011/06/14 16:54:43, rdcastro wrote:

 LGTM


 http://gwt-code-reviews.**appspot.com/1455804/http://gwt-code-reviews.appspot.com/1455804/


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

[gwt-contrib] [google-web-toolkit] r10332 committed - Remove RenderablaComposite. \o/...

2011-06-14 Thread codesite-noreply

Revision: 10332
Author:   rdcas...@google.com
Date: Tue Jun 14 07:40:15 2011
Log:  Remove RenderablaComposite. \o/

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

http://code.google.com/p/google-web-toolkit/source/detail?r=10332

Deleted:
 /trunk/user/src/com/google/gwt/user/client/ui/RenderableComposite.java

===
--- /trunk/user/src/com/google/gwt/user/client/ui/RenderableComposite.java	 
Wed Jun  8 04:46:32 2011

+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2011 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.user.client.ui;
-
-/**
- * EXPERIMENTAL and subject to change. Do not use this in production code.
- * p
- * A version of {@link Composite} that supports wrapping {@link Renderable}
- * widgets. This functionality will eventually be merged into {@link  
Composite}

- * itself, but is still under active development.
- * The only reason why this isn't a subclass of {@link Composite} is to  
avoid

- * messing up it's API, since {@link Composite} is very often subclassed.
- *
- * TODO(rdcastro): Delete this as soon as all references have been updated  
to

- * use Composite directly.
- */
-public abstract class RenderableComposite extends Composite {
-}

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


[gwt-contrib] Re: Resolve GWT.create() answers by source name (issue1450818)

2011-06-14 Thread jbrosenberg

LGTM

http://gwt-code-reviews.appspot.com/1450818/

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


[gwt-contrib] [google-web-toolkit] r10333 committed - Fixing login redirect in MobileWebApp sample. We now send a redirect ...

2011-06-14 Thread codesite-noreply

Revision: 10333
Author:   jlaba...@google.com
Date: Tue Jun 14 07:50:16 2011
Log:  Fixing login redirect in MobileWebApp sample.  We now send a  
redirect URL with every request, and use it if the user isn't logged in.   
We calculate the redirect URL on the client because the client browser has  
built in support for parsing the URL components.


Example: http://jlabanca-testing.appspot.com/#tl:

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

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

Modified:
  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java
  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java
  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/shared/GaeHelper.java


===
---  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java	 
Wed Jun  1 07:45:02 2011
+++  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/client/GaeAuthRequestTransport.java	 
Tue Jun 14 07:50:16 2011

@@ -17,10 +17,11 @@

 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestBuilder;
 import com.google.gwt.http.client.RequestCallback;
 import com.google.gwt.http.client.Response;
 import com.google.gwt.sample.gaerequest.shared.GaeHelper;
-import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.Window.Location;
 import  
com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport;

 import com.google.web.bindery.requestfactory.shared.ServerFailure;

@@ -34,16 +35,31 @@
   public GaeAuthRequestTransport(EventBus eventBus) {
 this.eventBus = eventBus;
   }
+
+  @Override
+  protected void configureRequestBuilder(RequestBuilder builder) {
+super.configureRequestBuilder(builder);
+
+/*
+ * Add the redirect URL in case the user is logged out.
+ *
+ * /MobileWebApp.html?parem0=value0param1=value1#hash
+ */
+String redirectUrl = Location.getPath() + Location.getQueryString() +  
Location.getHash();
+builder.setHeader(GaeHelper.REDIRECT_URL_HTTP_HEADER_NAME,  
redirectUrl);

+  }

   @Override
   protected RequestCallback createRequestCallback(final TransportReceiver  
receiver) {
 final RequestCallback superCallback =  
super.createRequestCallback(receiver);


 return new RequestCallback() {
+  @Override
   public void onError(Request request, Throwable exception) {
 superCallback.onError(request, exception);
   }

+  @Override
   public void onResponseReceived(Request request, Response response) {
 /*
  * The GaeAuthFailure filter responds with  
Response.SC_UNAUTHORIZED and

@@ -51,15 +67,11 @@
  * receive that combo, post an event so that the app can handle  
things

  * as it sees fit.
  */
-
 if (Response.SC_UNAUTHORIZED == response.getStatusCode()) {
   String loginUrl = response.getHeader(login);
   if (loginUrl != null) {
-// Replace the redirect url placeholder with the current url.
-loginUrl = loginUrl.replace(GaeHelper.REDIRECT_URL_TOKEN,  
Window.Location.getHref());

-
 /*
- * Hand the receiver a non-fatal callback, so that *
+ * Hand the receiver a non-fatal callback, so that
  * com.google.web.bindery.requestfactory.shared.Receiver will  
not

  * post a runtime exception.
  */
===
---  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java	 
Wed Jun  1 07:45:02 2011
+++  
/trunk/samples/mobilewebapp/src/main/java/com/google/gwt/sample/gaerequest/server/GaeAuthFilter.java	 
Tue Jun 14 07:50:16 2011

@@ -35,9 +35,11 @@
  */
 public class GaeAuthFilter implements Filter {

+  @Override
   public void destroy() {
   }

+  @Override
   public void doFilter(ServletRequest servletRequest, ServletResponse  
servletResponse,

   FilterChain filterChain) throws IOException, ServletException {
 UserService userService = UserServiceFactory.getUserService();
@@ -45,7 +47,12 @@
 HttpServletResponse response = (HttpServletResponse) servletResponse;

 if (!userService.isUserLoggedIn()) {
-  response.setHeader(login,  
userService.createLoginURL(GaeHelper.REDIRECT_URL_TOKEN));
+  String redirectUrl =  
request.getHeader(GaeHelper.REDIRECT_URL_HTTP_HEADER_NAME);

+  if (redirectUrl == null || redirectUrl.length() == 0) {
+// Default to the root page if the redirecturl isn't specified in  
the request.

+redirectUrl = /;
+  }
+  response.setHeader(login, userService.createLoginURL(redirectUrl));
   

[gwt-contrib] [google-web-toolkit] r10334 committed - Provide a more standard GWT linker for HTML5 worker threads based on t...

2011-06-14 Thread codesite-noreply

Revision: 10334
Author:   d...@google.com
Date: Tue Jun 14 08:28:02 2011
Log:  Provide a more standard GWT linker for HTML5 worker threads based  
on the ConfigurableLinker. Unlike the non-standard WorkerLinker and  
SharedWorkerLinker, this change allows worker threads to do GWT RPCs. A  
follow-up change will migrate existing uses of the old linkers to this new  
one.


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

Modified:
 /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java
 /trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js

===
---  
/trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java	 
Fri May  6 12:04:58 2011
+++  
/trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeLinker.java	 
Tue Jun 14 08:28:02 2011

@@ -1,12 +1,12 @@
 /*
  * 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
@@ -66,10 +66,18 @@
   LinkerContext context, ArtifactSet artifacts, CompilationResult  
result)

   throws UnableToCompleteException {

+if (shouldUseSelfForWindowAndDocument(context)) {
+  replaceAll(ss, __WINDOW_DEF__, self);
+  replaceAll(ss, __DOCUMENT_DEF__, self);
+} else {
+  replaceAll(ss, __WINDOW_DEF__, window);
+  replaceAll(ss, __DOCUMENT_DEF__, document);
+}
+
 // Must do installScript before installLocation and waitForBodyLoaded
 includeJs(ss, logger,  
getJsInstallScript(context), __INSTALL_SCRIPT__);
 includeJs(ss, logger,  
getJsInstallLocation(context), __INSTALL_LOCATION__);

-
+
 // Must do waitForBodyLoaded before isBodyLoaded
 includeJs(ss, logger,  
getJsWaitForBodyLoaded(context), __WAIT_FOR_BODY_LOADED__);
 includeJs(ss, logger,  
getJsIsBodyLoaded(context), __IS_BODY_LOADED__);

@@ -132,11 +140,24 @@

 if (context.isOutputCompact()) {
   replaceAll(ss, __START_OBFUSCATED_ONLY__, );
-  replaceAll(ss, __END_OBFUSCATED_ONLY__, );
+  replaceAll(ss, __END_OBFUSCATED_ONLY__, );
 } else {
   replaceAll(ss, __START_OBFUSCATED_ONLY__, /*);
   replaceAll(ss, __END_OBFUSCATED_ONLY__, */);
 }
+
+String jsModuleFunctionErrorCatch =  
getJsModuleFunctionErrorCatch(context);

+if (jsModuleFunctionErrorCatch != null) {
+  replaceAll(ss, __BEGIN_TRY_BLOCK__, try {);
+  replaceAll(ss, __END_TRY_BLOCK_AND_START_CATCH__, } catch  
(moduleError) {);
+  includeJs(ss, logger,  
jsModuleFunctionErrorCatch, __MODULE_FUNC_ERROR_CATCH__);

+  replaceAll(ss, __END_CATCH_BLOCK__, });
+} else {
+  replaceAll(ss, __BEGIN_TRY_BLOCK__, );
+  replaceAll(ss, __END_TRY_BLOCK_AND_START_CATCH__, );
+  replaceAll(ss, __MODULE_FUNC_ERROR_CATCH__, );
+  replaceAll(ss, __END_CATCH_BLOCK__, );
+}

 return ss.toString();
   }
@@ -218,6 +239,18 @@
   protected String getJsLoadExternalStylesheets(LinkerContext context) {
  
return com/google/gwt/core/ext/linker/impl/loadExternalStylesheets.js;

   }
+
+  /**
+   * Returns the name of the {@code JsModuleFunctionErrorCatch} script. By  
default returns null.
+   * This script executes if there's an error loading the module function  
or executing it.
+   * The error will be available under a local variable  
named moduleError. If non-null, the
+   * module function and the call to the module function will be placed in  
a try/catch block.

+   *
+   * @param context a LinkerContext
+   */
+  protected String getJsModuleFunctionErrorCatch(LinkerContext context) {
+return null;
+  }

   /**
* Returns the name of the {@code JsPermutations} script.  By default,
@@ -413,6 +446,14 @@
   protected boolean shouldOutputPropertyMap(LinkerContext context) {
 return false;
   }
+
+  /**
+   * Returns whether to use self for $wnd and $doc references. Defaults  
to false.

+   * Useful for worker threads.
+   */
+  protected boolean shouldUseSelfForWindowAndDocument(LinkerContext  
context) {

+return false;
+  }

   @Override
   protected String wrapPrimaryFragment(TreeLogger logger, LinkerContext  
context, String script,

===
---  
/trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js	 
Fri May  6 08:06:47 2011
+++  
/trunk/dev/core/src/com/google/gwt/core/linker/CrossSiteIframeTemplate.js	 
Tue Jun 14 08:28:02 2011

@@ -13,9 +13,10 @@
  * License for the specific language governing permissions and limitations  
under

  * the License.
  */
+__BEGIN_TRY_BLOCK__
 

[gwt-contrib] Re: Adds hooks to Widget reduce MVP boilerplate and enshrines the app-wide EventBus. (issue1449817)

2011-06-14 Thread rjrjr

Responses below. No code changes yet.


http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java
File user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java
(right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java#newcode41
user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java:41:
public static DefaultEventBusProvider instance() {
Yes, but I need to add the javax.inject package to GWT. I'll put a TODO.

Re: setInstance(), I've generally seen such things cause more harm than
good, especially in test code.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java#newcode54
user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java:54:
public static DefaultEventBusProvider instanceMaybe() {
You don't write a lot of app unit tests, do you?

The expectation is that instanceMaybe() will be used rarely, and only by
library developers. An app either uses the default bus (and so would
call instance), or it doesn't, and so would never refer to this class.
And even then, most app code would receive an eventBus as a constructor
argument, or would ask a Widget for it. If your app is littered with
references to this class, you screwed up. Perhaps the javadoc should say
so.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java#newcode68
user/src/com/google/gwt/user/client/ui/DefaultEventBusProvider.java:68:
public EventBus get() {
I'll look at that, thanks.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java
File user/src/com/google/gwt/user/client/ui/IsEventSource.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java#newcode28
user/src/com/google/gwt/user/client/ui/IsEventSource.java:28: * event
bus.
I've  gone back and forth on this. The idea with a string based approach
is that it makes sketching in ui.xml a lot simpler:

gwt:Button eventSourceName=saveSave/gwt:Button
gwt:Button eventSourceName=deleteDelete/gwt:Button

Elsewhere your app can register handlers for click events with those
names.
And it's not such a big deal to make those strings as unique as you need
them.

Perhaps the thing to do is provide a convenience setter for the string
case?

Object getEventSource()
void setEventSource(Object)
void setEventSourceName(String)

Too confusing?

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java
File user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java#newcode53
user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java:53: public
interface IsWidgetDriver {
I'd rather change the name than add another dimension of indirection to
our world. DrivesWidgets? Ditto for the abstract class. I'd rather
gamble that this is the right api than force clients to deal with an
abstract class. And to that end, I don't think I should include this in
2.4

On 2011/06/14 12:29:25, bobv wrote:

This type name implies there should be a single method



   WidgetDriver asWidgetDriver();



WidgetDriver could then be an abstract base class to allow additional

lifecycle

methods to be added in the future.


http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java
File user/src/com/google/gwt/user/client/ui/Widget.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/Widget.java#newcode252
user/src/com/google/gwt/user/client/ui/Widget.java:252: * particular,
hiding a parent does not stop the drivers of its children.
On 2011/06/14 15:05:48, jlabanca wrote:

This sounds like its going to cause problems.  If I detach a Panel,

ondetach

will bubble down and stop the child drivers.  But if I hide a Panel,

that does

not happen. That inconsistency is confusing and hard to work around.

start()

doesn't have enough information to know if I'm invisible or if I'm

detached, and

I only need to descend in one of those cases.



Instead, we could introduce two new methods to Widget: startDriver()

and

stopDriver().  The contract of both methods should be that they

descend into

child widgets.  By default, we call these methods from
onAttach/onDetach/setVisible.


These would be protected methods, right?


Users should be able to set a boolean so they can manually control the

driver

(possibly as an optional arg to setNextDriver).  If they take manual

control,

then the user is responsible for calling startDriver/stopDriver.  This

is

particularly useful if you plan to attach/detach to widget often and

don't

necessarily 

[gwt-contrib] [google-web-toolkit] r10335 committed - Resolve GWT.create() answers by source name....

2011-06-14 Thread codesite-noreply

Revision: 10335
Author:   gwt.mirror...@gmail.com
Date: Tue Jun 14 12:11:53 2011
Log:  Resolve GWT.create() answers by source name.

http://gwt-code-reviews.appspot.com/1450818

http://code.google.com/p/google-web-toolkit/source/detail?r=10335

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java

===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java	Fri Jun  
10 05:54:05 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/UnifyAst.java	Tue Jun  
14 12:11:53 2011

@@ -360,7 +360,7 @@

   ArrayListJExpression instantiationExpressions = new  
ArrayListJExpression(answers.size());

   for (String answer : answers) {
-JDeclaredType answerType = searchForType(answer);
+JDeclaredType answerType = searchForTypeBySource(answer);
 if (answerType == null) {
   error(x, Rebind result ' + answer + ' could not be found);
   return null;
@@ -405,7 +405,7 @@
   JsniRef ref = JsniRef.parse(stringValue);
   if (ref != null) {
 if (Name.isBinaryName(ref.className())) {
-  searchForType(ref.className());
+  searchForTypeByBinary(ref.className());
 }
 node = JsniRefLookup.findJsniRefTarget(ref, program, new  
JsniRefLookup.ErrorReporter() {

   public void reportError(String errMsg) {
@@ -415,7 +415,7 @@
   } else {
 // See if it's just @foo.Bar, which would result in the class seed
 String typeName = stringValue.charAt(0) == '@' ?  
stringValue.substring(1) : stringValue;

-node = searchForType(typeName);
+node = searchForTypeByBinary(typeName);
   }
   if (node == null) {
 // Not found, must be null
@@ -469,6 +469,7 @@
   CLASS_IS_CLASS_METADATA_ENABLED));

   private final MapString, CompiledClass classFileMap;
+  private final MapString, CompiledClass classFileMapBySource;
   private boolean errorsFound = false;
   private final SetCompilationUnit failedUnits = new  
IdentityHashSetCompilationUnit();
   private final MapString, JField fieldMap = new HashMapString,  
JField();

@@ -511,23 +512,12 @@
 this.options = options;
 this.rpo = rpo;
 this.classFileMap = rpo.getCompilationState().getClassFileMap();
+this.classFileMapBySource =  
rpo.getCompilationState().getClassFileMapBySource();

   }

   public void addRootTypes(CollectionString sourceTypeNames) {
-MapString, CompiledClass classFileMapBySource =
-rpo.getCompilationState().getClassFileMapBySource();
 for (String sourceTypeName : sourceTypeNames) {
-  JDeclaredType type = program.getFromTypeMap(sourceTypeName);
-  if (type == null) {
-CompiledClass cc = classFileMapBySource.get(sourceTypeName);
-if (cc == null) {
-  // TODO: error
-  throw new NoClassDefFoundError(sourceTypeName);
-}
-assimilateUnit(cc.getUnit());
-type = program.getFromTypeMap(sourceTypeName);
-assert type != null || errorsFound;
-  }
+  searchForTypeBySource(sourceTypeName);
 }
   }

@@ -539,7 +529,7 @@
 this.logger = logger;
 for (String internalName : classFileMap.keySet()) {
   String typeName = InternalName.toBinaryName(internalName);
-  searchForType(typeName);
+  searchForTypeByBinary(typeName);
 }

 for (JDeclaredType type : program.getDeclaredTypes()) {
@@ -939,7 +929,7 @@
 type.resolve(resolvedInterfaces, resolvedRescues);
   }

-  private JDeclaredType searchForType(String binaryTypeName) {
+  private JDeclaredType searchForTypeByBinary(String binaryTypeName) {
 JDeclaredType type = program.getFromTypeMap(binaryTypeName);
 if (type == null) {
   CompiledClass cc =  
classFileMap.get(BinaryName.toInternalName(binaryTypeName));

@@ -953,6 +943,21 @@
 }
 return type;
   }
+
+  private JDeclaredType searchForTypeBySource(String sourceTypeName) {
+JDeclaredType type = program.getFromTypeMap(sourceTypeName);
+if (type == null) {
+  CompiledClass cc = classFileMapBySource.get(sourceTypeName);
+  if (cc == null) {
+// TODO: error
+throw new NoClassDefFoundError(sourceTypeName);
+  }
+  assimilateUnit(cc.getUnit());
+  type = program.getFromTypeMap(sourceTypeName);
+  assert type != null || errorsFound;
+}
+return type;
+  }

   private void staticInitialize(JDeclaredType type) {
 if (type.isExternal()) {
@@ -995,7 +1000,7 @@
 }

 String typeName = type.getName();
-JDeclaredType newType = searchForType(typeName);
+JDeclaredType newType = searchForTypeByBinary(typeName);
 if (newType == null) {
   assert errorsFound;
   return type;

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


[gwt-contrib] Re: Updated rpc generator result caching for field serializers to use type signature instead of last... (issue1446818)

2011-06-14 Thread jbrosenberg

http://gwt-code-reviews.appspot.com/1446818/

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


[gwt-contrib] Re: Fixing login redirect in MobileWebApp sample. We now send a redirect URL with every request, an... (issue1450817)

2011-06-14 Thread jlabanca

committed as r10333

http://gwt-code-reviews.appspot.com/1450817/

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


[gwt-contrib] Re: Adds hooks to Widget reduce MVP boilerplate and enshrines the app-wide EventBus. (issue1449817)

2011-06-14 Thread bobv


http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java
File user/src/com/google/gwt/user/client/ui/IsEventSource.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsEventSource.java#newcode28
user/src/com/google/gwt/user/client/ui/IsEventSource.java:28: * event
bus.

Perhaps the thing to do is provide a convenience setter for the string

case?


Object getEventSource()
void setEventSource(Object)
void setEventSourceName(String)


Would UiBinder not widen the string XML attribute value to an Object?
Having a setEventSourcName(String) seem redundant when the only way to
actually access it is through an Object-return method.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java
File user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java (right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java#newcode53
user/src/com/google/gwt/user/client/ui/IsWidgetDriver.java:53: public
interface IsWidgetDriver {
DrivesWidgets SGTM.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java
File
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java
(right):

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java#newcode37
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java:37:
public ResettableEventBus(EventBus wrappedBus, String name) {
On 2011/06/14 18:34:41, rjrjr wrote:

You okay with the setEventSource(Object) / setEventSourceName(String)

notion to

keep uibinder simple?


If setEventSourceName(String) is necessary to make UiBinder work and
just delegates over to setEventSource(), I think that's something that
can be lived with.

http://gwt-code-reviews.appspot.com/1449817/diff/4001/user/src/com/google/web/bindery/event/shared/ResettableEventBus.java#newcode55
user/src/com/google/web/bindery/event/shared/ResettableEventBus.java:55:
* Remove all handlers that have been added through this wrapper, and
neuter

On 2011/06/14 15:05:48, jlabanca wrote:
 We should rename the method to neuter()


Many APIs use shutdown()

http://gwt-code-reviews.appspot.com/1449817/

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


[gwt-contrib] Re: A general purpose script injection class for injecting a script directly (issue1451818)

2011-06-14 Thread zundel

http://gwt-code-reviews.appspot.com/1451818/

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


[gwt-contrib] Re: Updated rpc generator result caching for field serializers to use type signature instead of last... (issue1446818)

2011-06-14 Thread tobyr

LGTM


http://gwt-code-reviews.appspot.com/1446818/diff/1/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
File user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java#newcode69
user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java:69:
public static final String CACHED_TYPE_INFO_KEY = ctik;
Unless there are some real constraints, would prefer the actual value of
this constant to be a little less brief. For example, would be less
opaque in debugging contexts.

http://gwt-code-reviews.appspot.com/1446818/diff/1010/dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java
File
dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1010/dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java#newcode111
dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java:111:
Found problem checking configuration property:  + e.getMessage());
Not good to squash the stack trace.

http://gwt-code-reviews.appspot.com/1446818/diff/1010/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
File user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1010/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java#newcode254
user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java:254:
boolean foundMatch =
This seems like a superfluous variable declaration

http://gwt-code-reviews.appspot.com/1446818/

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


[gwt-contrib] Re: Updated rpc generator result caching for field serializers to use type signature instead of last... (issue1446818)

2011-06-14 Thread jbrosenberg

http://gwt-code-reviews.appspot.com/1446818/

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


[gwt-contrib] Re: Updated rpc generator result caching for field serializers to use type signature instead of last... (issue1446818)

2011-06-14 Thread jbrosenberg


http://gwt-code-reviews.appspot.com/1446818/diff/1/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
File user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java#newcode69
user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java:69:
public static final String CACHED_TYPE_INFO_KEY = ctik;

Done.  Also made similar change in AbstractClientBundleGenerator

http://gwt-code-reviews.appspot.com/1446818/diff/1010/dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java
File
dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1010/dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java#newcode111
dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java:111:
Found problem checking configuration property:  + e.getMessage());
On 2011/06/14 21:02:20, tobyr wrote:

Not good to squash the stack trace.


Done.

http://gwt-code-reviews.appspot.com/1446818/diff/1010/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
File user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
(right):

http://gwt-code-reviews.appspot.com/1446818/diff/1010/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java#newcode254
user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java:254:
boolean foundMatch =
yep (was a relic to previous code)

http://gwt-code-reviews.appspot.com/1446818/

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


[gwt-contrib] GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread scottb

Reviewers: zundel, jbrosenberg,

Message:
Turns out the target GWT field is not always fully baked, as it was in
GenerateJavaAST.  Using JDT to get the compile-time constant is the
right appraoch.


http://gwt-code-reviews.appspot.com/1449818/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/1/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode258
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:258:
processField(x, info, JField.NULL_FIELD, ctx);
This line is why I hoisted the constant handling up to the call site
(below) instead changing the signature to pass in the FieldBinding.



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

Affected files:
  M dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java


Index: dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java  
b/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
index  
32971878c729bdc9077ba55538a147e295816c37..59d63bfae5cd6d80da339183d2981995198c7441  
100644

--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
@@ -236,6 +236,7 @@ public class GwtAstBuilder {
  * Resolves local references to function parameters, and JSNI  
references.

  */
 private class JsniResolver extends JsModVisitor {
+  private final GenerateJavaScriptLiterals generator = new  
GenerateJavaScriptLiterals();

   private final JsniMethodBody nativeMethodBody;

   private JsniResolver(JsniMethodBody nativeMethodBody) {
@@ -260,8 +261,23 @@ public class GwtAstBuilder {
 JType type = typeMap.get((TypeBinding) binding);
 processClassLiteral(x, info, type, ctx);
   } else if (binding instanceof FieldBinding) {
-JField field = typeMap.get((FieldBinding) binding);
-processField(x, info, field, ctx);
+FieldBinding fieldBinding = (FieldBinding) binding;
+/*
+ * We must replace any compile-time constants with the constant
+ * value of the field.
+ */
+if (fieldBinding.constant() != Constant.NotAConstant) {
+  assert !ctx.isLvalue();
+  JExpression constant = getConstant(info,  
fieldBinding.constant());

+  generator.accept(constant);
+  JsExpression result = generator.pop();
+  assert (result != null);
+  ctx.replaceMe(result);
+} else {
+  // Normal: create a jsniRef.
+  JField field = typeMap.get(fieldBinding);
+  processField(x, info, field, ctx);
+}
   } else {
 JMethod method = typeMap.get((MethodBinding) binding);
 processMethod(x, info, method);
@@ -276,25 +292,6 @@ public class GwtAstBuilder {
   }

   private void processField(JsNameRef nameRef, SourceInfo info, JField  
field, JsContext ctx) {

-/*
- * We must replace any compile-time constants with the constant  
value of

- * the field.
- */
-if (field.isCompileTimeConstant()) {
-  assert !ctx.isLvalue();
-  JLiteral initializer = field.getConstInitializer();
-  JType type = initializer.getType();
-  if (type instanceof JPrimitiveType || initializer instanceof  
JStringLiteral) {
-GenerateJavaScriptLiterals generator = new  
GenerateJavaScriptLiterals();

-generator.accept(initializer);
-JsExpression result = generator.peek();
-assert (result != null);
-ctx.replaceMe(result);
-return;
-  }
-}
-
-// Normal: create a jsniRef.
 JsniFieldRef fieldRef =
 new JsniFieldRef(info, nameRef.getIdent(), field,  
curClass.type, ctx.isLvalue());

 nativeMethodBody.addJsniRef(fieldRef);


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


[gwt-contrib] [google-web-toolkit] r10336 committed - Updated generator result caching to use lastModifiedTime from Compilat...

2011-06-14 Thread codesite-noreply

Revision: 10336
Author:   jbrosenb...@google.com
Date: Tue Jun 14 12:19:31 2011
Log:  Updated generator result caching to use lastModifiedTime from  
CompilationUnit.lastModified().

Removed GeneratorContextExt.getSourceLastModifiedTime().
Removed JRealClassType.getTypeStrongHash().
Added JRealClassType.getLastModifiedTime()

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

http://code.google.com/p/google-web-toolkit/source/detail?r=10336

Modified:
 /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExt.java
 /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExtWrapper.java
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java
  
/trunk/dev/core/src/com/google/gwt/dev/javac/rebind/CachedPropertyInformation.java

 /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/JRealClassType.java
  
/trunk/user/src/com/google/gwt/resources/rebind/context/AbstractClientBundleGenerator.java

 /trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java
  
/trunk/user/src/com/google/gwt/user/rebind/rpc/ServiceInterfaceProxyGenerator.java

 /trunk/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java
  
/trunk/user/test/com/google/gwt/user/rebind/rpc/SerializableTypeOracleBuilderTest.java


===
--- /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExt.java	 
Fri Feb  4 09:24:25 2011
+++ /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExt.java	 
Tue Jun 14 12:19:31 2011

@@ -15,7 +15,6 @@
  */
 package com.google.gwt.core.ext;

-import com.google.gwt.core.ext.typeinfo.JClassType;
 import com.google.gwt.dev.javac.rebind.CachedRebindResult;

 /**
@@ -38,15 +37,6 @@
*/
   CachedRebindResult getCachedGeneratorResult();

-  /**
-   * Get source last modified time.
-   * p
-   * TODO(jbrosenberg): Implement in terms of a getVersion method yet to be
-   * added to TypeOracle, instead of looking for age of a java source file.
-   * This will soon be removed.
-   */
-  long getSourceLastModifiedTime(JClassType sourceType);
-
   /**
* Check whether generator result caching is currently enabled.
*/
===
---  
/trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExtWrapper.java	 
Wed Jun  1 13:28:28 2011
+++  
/trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExtWrapper.java	 
Tue Jun 14 12:19:31 2011

@@ -17,7 +17,6 @@

 import com.google.gwt.core.ext.linker.Artifact;
 import com.google.gwt.core.ext.linker.GeneratedResource;
-import com.google.gwt.core.ext.typeinfo.JClassType;
 import com.google.gwt.core.ext.typeinfo.TypeOracle;
 import com.google.gwt.dev.javac.rebind.CachedRebindResult;
 import com.google.gwt.dev.resource.ResourceOracle;
@@ -79,10 +78,6 @@
   public ResourceOracle getResourcesOracle() {
 return baseContext.getResourcesOracle();
   }
-
-  public long getSourceLastModifiedTime(JClassType sourceType) {
-return 0L;
-  }

   public TypeOracle getTypeOracle() {
 return baseContext.getTypeOracle();
===
---  
/trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java	 
Wed Feb  9 07:49:06 2011
+++  
/trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java	 
Tue Jun 14 12:19:31 2011

@@ -23,8 +23,7 @@
   /**
* EXPERIMENTAL and subject to change. Do not use this in production  
code.

*
-   * Generate a hash to be used as a signature for comparing versions of  
the

-   * structure of a type.
+   * Retrieve last modified time for this type.
*/
-  String getTypeStrongHash();
-}
+  long getLastModifiedTime();
+}
===
---  
/trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java	 
Wed Jun  1 13:28:28 2011
+++  
/trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java	 
Tue Jun 14 12:19:31 2011

@@ -27,7 +27,6 @@
 import com.google.gwt.core.ext.linker.ArtifactSet;
 import com.google.gwt.core.ext.linker.GeneratedResource;
 import com.google.gwt.core.ext.linker.impl.StandardGeneratedResource;
-import com.google.gwt.core.ext.typeinfo.JArrayType;
 import com.google.gwt.core.ext.typeinfo.JClassType;
 import com.google.gwt.core.ext.typeinfo.TypeOracle;
 import com.google.gwt.dev.cfg.ModuleDef;
@@ -35,7 +34,6 @@
 import com.google.gwt.dev.javac.rebind.RebindResult;
 import com.google.gwt.dev.javac.rebind.RebindRuleResolver;
 import com.google.gwt.dev.javac.rebind.RebindStatus;
-import com.google.gwt.dev.resource.Resource;
 import com.google.gwt.dev.resource.ResourceOracle;
 import com.google.gwt.dev.util.DiskCache;
 import com.google.gwt.dev.util.Util;
@@ -540,39 +538,6 @@
   public ResourceOracle getResourcesOracle() {
 return module.getResourcesOracle();
   }
-
-  /**
-   * EXPERIMENTAL and subject to change. Do not use this in 

[gwt-contrib] Reduce the use of old event bus classes. The only public api that (issue1446819)

2011-06-14 Thread rjrjr

Reviewers: robertvawter,

Description:
Reduce the use of old event bus classes. The only public api that
still mentions the gwt EventBus explicitly at this point is the
Activity interface. Not much to be done about that, and maybe
DrivesWidgets will grow to make the point moot.


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

Affected files:
  M user/src/com/google/gwt/activity/shared/ActivityManager.java
  M user/src/com/google/gwt/event/shared/LegacyHandlerWrapper.java
  M user/src/com/google/gwt/event/shared/ResettableEventBus.java
  M user/src/com/google/gwt/place/shared/PlaceController.java
  M user/src/com/google/gwt/place/shared/PlaceHistoryHandler.java
  M  
user/src/com/google/web/bindery/requestfactory/vm/RequestFactorySource.java



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


[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread scottb

Patch updated to fix GwtAstBuilderTest.

http://gwt-code-reviews.appspot.com/1449818/

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


[gwt-contrib] Add a compile-time check against provided UiFields for RenderablePanel. I want to add the same c... (issue1454812)

2011-06-14 Thread rdcastro

Reviewers: rjrjr, rchandia,

Description:
Add a compile-time check against provided UiFields for RenderablePanel.
I want to add the same check for HTMLPanel, but since that'll probably
break a lot of people, it'd be better to do it in a separate CL.


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

Affected files:
  M  
user/src/com/google/gwt/uibinder/elementparsers/RenderablePanelParser.java



Index:  
user/src/com/google/gwt/uibinder/elementparsers/RenderablePanelParser.java

===
---  
user/src/com/google/gwt/uibinder/elementparsers/RenderablePanelParser.java	 
(revision 10336)
+++  
user/src/com/google/gwt/uibinder/elementparsers/RenderablePanelParser.java	 
(working copy)

@@ -22,6 +22,7 @@
 import com.google.gwt.uibinder.rebind.XMLElement;
 import com.google.gwt.uibinder.rebind.messages.MessageWriter;
 import com.google.gwt.uibinder.rebind.messages.PlaceholderInterpreter;
+import com.google.gwt.uibinder.rebind.model.OwnerField;

 /**
  * Parses {@link com.google.gwt.user.client.ui.RenderablePanel} widgets.
@@ -32,6 +33,13 @@
   final UiBinderWriter writer) throws UnableToCompleteException {

 assert writer.useLazyWidgetBuilders();
+
+// Make sure that, if there is a UiField for this panel, it isn't
+// (provided = true), as that isn't supported.
+OwnerField uiField = writer.getOwnerClass().getUiField(fieldName);
+if (uiField != null  uiField.isProvided()) {
+  writer.die(Provided UiField for RenderablePanel is not supported.);
+}

 /*
  * Gathers up elements that indicate nested IsRenderable objects.


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


[gwt-contrib] Re: Reduce the use of old event bus classes. The only public api that (issue1446819)

2011-06-14 Thread rjrjr

http://gwt-code-reviews.appspot.com/1446819/

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


[gwt-contrib] Re: Reduce the use of old event bus classes. The only public api that (issue1446819)

2011-06-14 Thread rjrjr

http://gwt-code-reviews.appspot.com/1446819/

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


[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread jbrosenberg

Can you briefly describe the reason for this change?
If I understand correctly, the change is to extend handling of compile
time constants to Strings as well as base types?


http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java
File dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java (right):

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java#newcode573
dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java:573:
This same logic seems to be repeated in each file in this patch.  Can it
be made into a shared utility method somewhere?

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java#newcode574
dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java:574: boolean
isCompileTimeConstant =
extra parens in (binding.isFinal())

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2971
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2971:
boolean isCompileTimeConstant =
extra parens in (binding.isFinal())

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
File dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java#newcode245
dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java:245:
boolean isCompileTimeConstant =
extra parens in (binding.isFinal())

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java#newcode246
dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java:246:
binding.isStatic()  (binding.isFinal())  (binding.constant() !=
Constant.NotAConstant);
why no assert here (you have it in similar places elsewhere)?

http://gwt-code-reviews.appspot.com/1449818/

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


[gwt-contrib] Re: Reduce the use of old event bus classes. The only public api that (issue1446819)

2011-06-14 Thread rjrjr

http://gwt-code-reviews.appspot.com/1446819/

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


[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread scottb

Yes, according to the JLS, Strings are considered compiled time
constants, but we've been doing this wrong up to now.  (Not that it
mattered before now.)


http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java
File dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java (right):

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java#newcode573
dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java:573:
This copy will get deleted soon, but the problem is getting a reference
to java.lang.String.  I'll see what I can do.

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java#newcode574
dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java:574: boolean
isCompileTimeConstant =
On 2011/06/14 23:46:25, jbrosenberg wrote:

extra parens in (binding.isFinal())


Done.

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2971
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2971:
boolean isCompileTimeConstant =
On 2011/06/14 23:46:25, jbrosenberg wrote:

extra parens in (binding.isFinal())


Done.

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
File dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java#newcode245
dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java:245:
boolean isCompileTimeConstant =
On 2011/06/14 23:46:25, jbrosenberg wrote:

extra parens in (binding.isFinal())


Done.

http://gwt-code-reviews.appspot.com/1449818/diff/4001/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java#newcode246
dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java:246:
binding.isStatic()  (binding.isFinal())  (binding.constant() !=
Constant.NotAConstant);
Can't get a reference to java.lang.String from here; but I'll see what I
can do.

http://gwt-code-reviews.appspot.com/1449818/

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


[gwt-contrib] RE:Reduce the use of old event bus classes. The only public api that (issue1446819)

2011-06-14 Thread Ray Ryan
Ready for review.


On Tue, Jun 14, 2011 at 5:03 PM, rj...@google.com {subItem.from.uri}
wrote:

 http://gwt-code-reviews.appspot.com/1446819/http://www.google.com/url?sa=Dq=http://gwt-code-reviews.appspot.com/1446819/


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

[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread scottb

Okay, much nicer! :D

http://gwt-code-reviews.appspot.com/1449818/

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


[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread jbrosenberg

LGTM w/a couple questions


http://gwt-code-reviews.appspot.com/1449818/diff/2003/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/2003/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2837
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2837:
private static boolean isCompileTimeConstant(FieldBinding binding) {
I don't think it's legal/syntactically possible for a java field to be
both final and volatile, which would make this assertion tautologically
true, no?

http://gwt-code-reviews.appspot.com/1449818/diff/2003/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2840
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2840:
binding.isStatic()  binding.isFinal()  (binding.constant() !=
Constant.NotAConstant);
should this if test live inside the assert, maybe as a conditional, so
the if test doesn't get evaluated if assertions not enabled?

http://gwt-code-reviews.appspot.com/1449818/

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


[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread scottb


http://gwt-code-reviews.appspot.com/1449818/diff/2003/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
File dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
(right):

http://gwt-code-reviews.appspot.com/1449818/diff/2003/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2837
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2837:
private static boolean isCompileTimeConstant(FieldBinding binding) {
You would think, yep.  It's just an assertion check on the fact that we
don't model final and volatile independently.  We use a single enum
value for either.

http://gwt-code-reviews.appspot.com/1449818/diff/2003/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java#newcode2840
dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java:2840:
binding.isStatic()  binding.isFinal()  (binding.constant() !=
Constant.NotAConstant);
Doesn't matter, in byte code, the check for assertions being enabled is
itself an if test that is slower (as written) than the local variable
check.  If byte code optimizers are running, it should remove this
entirely.

http://gwt-code-reviews.appspot.com/1449818/

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


[gwt-contrib] [google-web-toolkit] r10337 committed - GwtAstBuilder better handling of JSNI refs to constants....

2011-06-14 Thread codesite-noreply

Revision: 10337
Author:   sco...@google.com
Date: Tue Jun 14 15:18:26 2011
Log:  GwtAstBuilder better handling of JSNI refs to constants.

Turns out the target GWT field is not always fully baked, as it was in  
GenerateJavaAST.  Using JDT to get the compile-time constant is the right  
approach.


http://gwt-code-reviews.appspot.com/1449818/

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

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java

===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java	Thu  
May 26 06:00:55 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java	Tue  
Jun 14 15:18:26 2011

@@ -34,7 +34,6 @@
 import com.google.gwt.dev.jjs.ast.JMethodBody;
 import com.google.gwt.dev.jjs.ast.JNullType;
 import com.google.gwt.dev.jjs.ast.JParameter;
-import com.google.gwt.dev.jjs.ast.JPrimitiveType;
 import com.google.gwt.dev.jjs.ast.JProgram;
 import com.google.gwt.dev.jjs.ast.JReferenceType;
 import com.google.gwt.dev.jjs.ast.JType;
@@ -63,7 +62,6 @@
 import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
 import org.eclipse.jdt.internal.compiler.ast.Statement;
 import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
-import org.eclipse.jdt.internal.compiler.impl.Constant;
 import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
 import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
@@ -570,27 +568,9 @@

   private JField createField(SourceInfo info, FieldBinding binding,  
JDeclaredType enclosingType) {

 JType type = getType(binding.type);
-
-boolean isCompileTimeConstant =
-binding.isStatic()  (binding.isFinal())   
(binding.constant() != Constant.NotAConstant)

- (binding.type.isBaseType());
-assert (type instanceof JPrimitiveType || !isCompileTimeConstant);
-
-assert (!binding.isFinal() || !binding.isVolatile());
-Disposition disposition;
-if (isCompileTimeConstant) {
-  disposition = Disposition.COMPILE_TIME_CONSTANT;
-} else if (binding.isFinal()) {
-  disposition = Disposition.FINAL;
-} else if (binding.isVolatile()) {
-  disposition = Disposition.VOLATILE;
-} else {
-  disposition = Disposition.NONE;
-}
-
 JField field =
 program.createField(info, String.valueOf(binding.name),  
enclosingType, type, binding

-.isStatic(), disposition);
+.isStatic(), GwtAstBuilder.getFieldDisposition(binding));
 typeMap.put(binding, field);
 info.addCorrelation(info.getCorrelator().by(field));
 return field;
===
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java	Tue  
Jun 14 05:20:58 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java	Tue  
Jun 14 15:18:26 2011

@@ -236,6 +236,7 @@
  * Resolves local references to function parameters, and JSNI  
references.

  */
 private class JsniResolver extends JsModVisitor {
+  private final GenerateJavaScriptLiterals generator = new  
GenerateJavaScriptLiterals();

   private final JsniMethodBody nativeMethodBody;

   private JsniResolver(JsniMethodBody nativeMethodBody) {
@@ -260,8 +261,23 @@
 JType type = typeMap.get((TypeBinding) binding);
 processClassLiteral(x, info, type, ctx);
   } else if (binding instanceof FieldBinding) {
-JField field = typeMap.get((FieldBinding) binding);
-processField(x, info, field, ctx);
+FieldBinding fieldBinding = (FieldBinding) binding;
+/*
+ * We must replace any compile-time constants with the constant
+ * value of the field.
+ */
+if (isCompileTimeConstant(fieldBinding)) {
+  assert !ctx.isLvalue();
+  JExpression constant = getConstant(info,  
fieldBinding.constant());

+  generator.accept(constant);
+  JsExpression result = generator.pop();
+  assert (result != null);
+  ctx.replaceMe(result);
+} else {
+  // Normal: create a jsniRef.
+  JField field = typeMap.get(fieldBinding);
+  processField(x, info, field, ctx);
+}
   } else {
 JMethod method = typeMap.get((MethodBinding) binding);
 processMethod(x, info, method);
@@ -276,25 +292,6 @@
   }

   private void processField(JsNameRef nameRef, SourceInfo info, JField  
field, JsContext ctx) {

-/*
- * We must replace any compile-time constants with the constant  
value of

- * the field.
- */
-if (field.isCompileTimeConstant()) {
- 

[gwt-contrib] Re: GwtAstBuilder better handling of JSNI refs to constants (issue1449818)

2011-06-14 Thread zundel

lgtm

http://gwt-code-reviews.appspot.com/1449818/

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