Re: Using the hibernate4gwt?

2008-10-07 Thread noon

Hi,

As far as I know, the Dozer solution suffers of the following issues :
- The service class must know how the entity has been loaded to
use the proper clone configuration (not a very good encapsulation),
- Each configuration is associated to one XML file, which can be
expensive for real application with dozen of classes,
- Class sent to GWT via Dozer cannot be reused when back on
server !!!

In fact, the Dozer solution remains simple only if you use very simple
db schema, with no lazy loading at all.

Regards
Bruno

On 6 oct, 23:26, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 I used JPA.

 I found there the config way to complex in hibernate4gwt for a simple
 relational db.

 yes there are type problems but that can be fixed with literally 1
 line using a library called dozer.

 On Oct 3, 12:43 pm, ton [EMAIL PROTECTED] wrote:

  Hello, anyone of you this Using the hibernate4gwt?

  it is worth?

  it really solves the problem with many such relationships to a list?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



getting to servlet (non rpc) in hosted mode vs. Tomcat

2008-10-07 Thread Michel

Hi,

I need to call a servlet from my GWT application. It all works fine,
except that I appear to need different code for hosted mode versus
deployment in Tomcat. In hosted mode, this works:


RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL
.encode(/IDServlet));

And when I deploy my application to Tomcat, only this works:


RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL
.encode(IDServlet));


The difference is the '/' before IDServlet.


This is rather a nuisance. What can I do about it?

Thank you for your help, and with kind regards,



Michel
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: getting to servlet (non rpc) in hosted mode vs. Tomcat

2008-10-07 Thread Isaac Truett
Those are two different URLs. /IDServlet means http://host/IDServlet while
IDServlet means http://host/WhereEverTheCurrentPageIs/IDServlet. In hosted
mode, your servlet is mapped to http://localhost:/IDServlet. In web
mode, your servlet is probably mapped to something like
http://localhost/myApp/IDServlet which means that /IDServlet won't work.


On Tue, Oct 7, 2008 at 7:05 AM, Michel [EMAIL PROTECTED] wrote:


 Hi,

 I need to call a servlet from my GWT application. It all works fine,
 except that I appear to need different code for hosted mode versus
 deployment in Tomcat. In hosted mode, this works:


 RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL
.encode(/IDServlet));

 And when I deploy my application to Tomcat, only this works:


 RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL
.encode(IDServlet));


 The difference is the '/' before IDServlet.


 This is rather a nuisance. What can I do about it?

 Thank you for your help, and with kind regards,



 Michel
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Firebug tells me that __gwt_initHandlers is not defined

2008-10-07 Thread doubtintom

I've been editing a GWT 1.4.x project to run with GWT 1.5.2. The
application works fine in hosted mode. But deployed in Tomcat, it
recently started showing only a blank screen in Firefox.

Firebug tells me that  __gwt_initHandlers is not defined
Here is a snapshot of the full Firebug error:
http://dl.getdropbox.com/u/118825/gwt_initHandlers_not_defined.png

Seems obvious that I did something while doing the extensive edits in
hosted mode. Any ideas about where to look or how to debug?

Thx,
Tom

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



chat GWT webapp on Android: why do I sometimes lose messages ??

2008-10-07 Thread Steven

Hallo everybody,

I have just programmed a chat application to be applied to Android
(SDK m5-rc15) and to as many browsers as possible.

At present I am exploiting only the GWT (1.5.1) API, with the 'smack'
library which allows connection to a xmpp server. (For now I'm using
just Firefox as XMPP server and a Spark client).

I have a big problem: my application works perfectly with many
browsers (Chrome, IE, Mozilla, Opera), but it does not work so well on
Android.
In fact, on Android I cannot send and receive real-time messages:
sometimes I lose message, sometimes the message I send from one side
(for example from the Spark client) appears on the other side, that is
on my application running on Android, only after sending a further
message from my application itself.

My question is : why does my application not work only with Android??
Do I have to change any configuration parameter on Android for that?


Some further information about the webapp architecture:
1)  In my application the application server opens a connection to a
XMPP server, before opening a chat to any
 Spark client.
2)  On my server-side I have 4 chat methods,which I invoke from the
client by  means of RPC calls.
 Since no flush is allowed by the http protocol, actually I am
appending all received message to a inbox list
 (by means of a message listener in the chat method). The client
receives this messages invoking the receive
 method on server-side.

  Here I attach the four chat methods:


public boolean connect() {
   try {
   connection.connect();
   connection.login(username,psw);
   } catch (XMPPException e) {
   e.printStackTrace();
   return false;
   }
   return true;
}

public boolean chat(String participant){
   participantName = participant.substring(0,
participant.lastIndexOf('@'));
   this.chat1 =
connection.getChatManager().createChat(participant, new
MessageListener() {
   public void processMessage(Chat chat1,
Message message) {
   msg =  participantName + :  +
message.getBody();
   System.out.println(Received
message --  + msg);
   synchronized(messageList){
   messageList.add(msg);
   messageList.notify();
   }
   }
   });
   return true;
}

public String send(String textIn) {
   try {
   chat1.sendMessage(textIn);
   } catch (XMPPException e) {
   e.printStackTrace();
   }
   textOutMod = username + :  +  textIn;
   return textOutMod;
}

public String receive() {
   synchronized (messageList){
 while (messageList.size() == 0){
 try{
   messageList.wait();
  } catch (InterruptedException
ignore){
  }
   }

   textInMod = ;
   for (int j = 0; j  messageList.size(); j++) {
  if (textInMod.length()  0) textInMod = textInMod +
\n + messageList.elementAt(j);
 else textInMod =
(String)messageList.elementAt(j);
   }
   messageList.clear();
   }
   return textInMod;
}

thks in advance and sorry for bad English,
Steve
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



My project can't use browser back/forward!

2008-10-07 Thread hooly.jia

hello!
I created a project and add a lot of panels. Completion of the basic
operation of the panel to switch between, but my project can not use
the browser's back/forward button. What is the problem?
History is not just for the link.
How should I do?
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



MenuBarImages problem on mac os x

2008-10-07 Thread Massimiliano Masi

Hello,

I'm using Gwt on mac os x on ppc. I created a simple MenuBar with
separator (no MenuBarImages), but I got this error in the shell:

ERROR] Uncaught exception escaped
java.lang.RuntimeException: Deferred binding failed for
'com.google.gwt.user.client.ui.MenuBar$MenuBarImages' (did you forget
to inherit a required module?)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:
43)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.google.gwt.user.client.ui.MenuBar.init(MenuBar.java:146)
at
com.spirit.pki.ui.client.SpiritPKIUserInterface._createMenu(SpiritPKIUserInterface.java:
95)
at
com.spirit.pki.ui.client.SpiritPKIUserInterface._createRootPanel(SpiritPKIUserInterface.java:
82)
at com.spirit.pki.ui.client.SpiritPKIUserInterface.access
$0(SpiritPKIUserInterface.java:62)
at com.spirit.pki.ui.client.SpiritPKIUserInterface
$1.onSuccess(SpiritPKIUserInterface.java:47)
at com.spirit.pki.ui.client.login.Login$4.onSuccess(Login.java:127)
at com.spirit.pki.ui.client.login.Login$4.onSuccess(Login.java:1)
at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:
215)
at
com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:
254)
at
com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:
226)
at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:
217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
103)
at
com.google.gwt.dev.shell.mac.MethodDispatch.invoke(MethodDispatch.java:
71)
at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native Method)
at org.eclipse.swt.widgets.Display.sleep(Display.java:3801)
at com.google.gwt.dev.GWTShell.sleep(GWTShell.java:749)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:721)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)
Caused by: java.lang.NoClassDefFoundError: com/sun/media/imageio/
stream/StreamSegmentMapper
at
org.dcm4cheri.imageio.plugins.DcmImageReaderSpi.canDecodeInput(DcmImageReaderSpi.java:
111)
at javax.imageio.ImageIO$CanDecodeInputFilter.filter(ImageIO.java:
526)
at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:793)
at javax.imageio.spi.FilterIterator.next(ServiceRegistry.java:811)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:487)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:472)
at javax.imageio.ImageIO.read(ImageIO.java:1397)
at javax.imageio.ImageIO.read(ImageIO.java:1364)
at
com.google.gwt.user.rebind.ui.ImageBundleBuilder.addImage(ImageBundleBuilder.java:
391)
at
com.google.gwt.user.rebind.ui.ImageBundleBuilder.assimilate(ImageBundleBuilder.java:
303)
at
com.google.gwt.user.rebind.ui.ImageBundleGenerator.generateImplClass(ImageBundleGenerator.java:
301)
at
com.google.gwt.user.rebind.ui.ImageBundleGenerator.generate(ImageBundleGenerator.java:
159)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
51)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:116)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:61)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
166)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
114)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:468)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
359)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:
39)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.google.gwt.user.client.ui.MenuBar.init(MenuBar.java:146)
at
com.spirit.pki.ui.client.SpiritPKIUserInterface._createMenu(SpiritPKIUserInterface.java:
95)
at
com.spirit.pki.ui.client.SpiritPKIUserInterface._createRootPanel(SpiritPKIUserInterface.java:
82)
at com.spirit.pki.ui.client.SpiritPKIUserInterface.access
$0(SpiritPKIUserInterface.java:62)
at com.spirit.pki.ui.client.SpiritPKIUserInterface
$1.onSuccess(SpiritPKIUserInterface.java:47)
at com.spirit.pki.ui.client.login.Login$4.onSuccess(Login.java:127)
at com.spirit.pki.ui.client.login.Login$4.onSuccess(Login.java:1)
at

Re: GWT Active Menu Item Highlighted - Please help

2008-10-07 Thread karmela

Still having the same problem.
I need to make the selected link from the menu to be in a different
color. When the user goes to a specific page, that page on the menu is
in a different color.
How can I add a class/id to the menu items?

In MenuItem class there is private static final String
DEPENDENT_STYLENAME_SELECTED_ITEM = selected; which is a style for
the item that is hovered over. I need to make the same thing for an
active MenuItem.

Any help would be greatly appreciate it.


Thanks,
Karmela

On Oct 3, 8:18 am, karmela [EMAIL PROTECTED] wrote:
 Hi Sumit,
 Thank you so much for getting back to me.
 The hovering works just fine. When hover over the menu item the class
 changes to gwt-MenuItem-selected. But when an actual item is selected,
 the class/id does not change.
 So I'm not sure how to change the class so that I can give it specific
 style.
 I'd really appreciate it if you could help.

 Thanks again Sumit.
 Karmela

 On Oct 2, 9:54 am, Sumit Chandel [EMAIL PROTECTED] wrote:

  Hi Karmela,
  Have you taken a look at the latest Menu Bar widget in the Showcase sample
  application? It provides default CSS styles for menu items to be highlighted
  whenever the cursor is hovering over them.

  You can check it out here:

 http://gwt.google.com/samples/Showcase/Showcase.html#CwMenuBar

  Note that you can see both the Java source and the CSS code for the Menu Bar
  in the same display. You should be able to use this and tweak the styles for
  the purpose of your application.

  Hope that helps,
  -Sumit Chandel

  On Tue, Sep 30, 2008 at 4:45 PM, karmela [EMAIL PROTECTED] wrote:

   Hi all,
   Hope someone can help me with this.
   I want to have the active menu item to be highlighted. Basically when
   an item gets selected and goes to a page, i want that link (menu item)
   to be in a different color.
   Is that possible to do with GWT?

   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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Memory leak with DOM method ?

2008-10-07 Thread Thomas Broyer



On 7 oct, 15:38, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Thanks.

 Is there recommandation to use DOM ? how must i use
 DOM.seteventlistener ?

You have to call DOM.setEventListener(elt, null) whenever elt is
detached from the document (that's what Widget.onDetach does) or at
least at unload time (RootPanels are detached at on unload, and thus
detach their children in cascade; same goes for widgets created with
their static wrap() method, as they automatically register themselves
for RootPanel.detachOnWindowClose).

Actually, you'd rather create a Widget and follow the static
wrap(Element) pattern found on other widgets (Button, TextBox, etc.)
than directly play with DOM.setEventListener. Or just be careful to
reset event listeners to null before unload for each element
you've attached a listener to.

 Is it possible to have memory leak when using DOM.getElementAttribute
 or DOM.getParent for example ?

I don't think so. Actually, memory leaks are mostly caused by DOM
elements referencing javascript objects referencing back the DOM
element (which is easily done when attaching events in pure
JavaScript). You shouldn't suffer from memory leaks with GWT except
if you start playing with DOM.setEventListener and/or JSNI.

That being said, I'm not a JavaScript expert wrt memory leaks, so
you'd better check before taking my word for it :-P
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: ScrollTable scroll position

2008-10-07 Thread Thomas Broyer



On 7 oct, 14:04, ivovnenko [EMAIL PROTECTED] wrote:
 Hello everyone.
 Is there any way to set scroll position in incubator's ScrollTable?
 The use case:
 I'm adding the element to the bottom(top) of the ScrollTable, and I
 want it to be selected and visible - need to scroll to its position.

Did you gave a look at the ScrollPanel's javadoc (or your IDE's auto-
complete suggestions)?
 - ensureVisible(UIObject)
 - scrollToBottom / scrollToTop
 - setScrollPosition(int)


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: getting to servlet (non rpc) in hosted mode vs. Tomcat

2008-10-07 Thread Thomas Broyer



On 7 oct, 14:26, Isaac Truett [EMAIL PROTECTED] wrote:
 Those are two different URLs. /IDServlet meanshttp://host/IDServletwhile
 IDServlet meanshttp://host/WhereEverTheCurrentPageIs/IDServlet. In hosted
 mode, your servlet is mapped tohttp://localhost:/IDServlet. In web
 mode, your servlet is probably mapped to something 
 likehttp://localhost/myApp/IDServletwhich means that /IDServlet won't work.

...which means you should use GWT.getModuleBaseURL() or
GWT.getHostPageBaseURL() as a prefix to the servlet URL:
 RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
GWT.getModuleBaseURL() + IDServlet);

(n.b.: you're guaranteed that getModuleBaseURL and getHostPageBaseURL
end with a /)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Severe performance problem after upgrading to GWT 1.5.2 (final)

2008-10-07 Thread Manuel

Actually yes.  This seems to be slow down in FF3 on my mac.  I have
asked people to test using ff3 on Windows and they say its slower but
not as sever as on the mac.

Thanks,
Manuel

On Oct 6, 5:51 am, Sumit Chandel [EMAIL PROTECTED] wrote:
 Hi Manuel,
 Thanks for the follow-up. As far as I can tell, there isn't anything
 introduced between 1.5 RC2 and 1.5.2 that would cause slowdowns on RPC calls
 in FF.

 I noticed you mentioned this is especially prevalent in Firefox 3. Do the
 RPC calls also slowdown in Firefox 2? It would be good to know if this is a
 problem related to changes in FF rather than in GWT.

 Cheers,
 -Sumit Chandel

 On Fri, Oct 3, 2008 at 4:09 PM, Manuel [EMAIL PROTECTED] wrote:

  We noticed a slow down by just switching from 1.5RC2 to 1.5.2  more
  specifically on FireFox 3.  I recently tested on Chrome and Safari 3
  and the performance there is significantly better it seems to be well
  over 10x faster.  I think there might be a bug using the scripting
  engine on FireFox and also IE.  Or it could be the java scripting
  engine on Safari is really that much better.

  The overall app is much faster on Safari, but i would say the biggest
  issue is with RPC calls.

  On Oct 3, 7:22 am, Sumit Chandel [EMAIL PROTECTED] wrote:
   Hi Manuel,
   It seems hbatista's slowdown in performance was related to a database
   change.

   In your case, are you still experiencing slowdowns on your RPC calls?
  Also,
   did these slowdowns occur when you went from 1.4.x to 1.5.2, or were you
   always facing slow RPC calls in your GWT application?

   Thanks,
   -Sumit Chandel

   On Tue, Sep 30, 2008 at 8:26 PM, Manuel [EMAIL PROTECTED] wrote:

Has anyone figgured this out.  I am having sever performance problems
with this.  accross the board all 1.5.2 compiled apps are a lot slower

On Sep 18, 4:59 am, hbatista [EMAIL PROTECTED] wrote:
 Thanks for the suggestion, but changing data types didn't help.
 I did not profile my code, but the observed behavior is:
 1. RPC call is made
 2. server side method runs and returns (quickly!)
 3. ... huge delay with no CPU activity ...
 4. finally client side onSuccess() RPC callback runs

 What could be happening on step 3 ?

 I took a quick look at the serializer source code, but it's too
 different from 1.4.60 to compare side by side.

 On Sep 18, 2:06 am, Tim [EMAIL PROTECTED] wrote:

  not sure, but maybe there are some datatype penalty issues (long vs
  double etc). Did you profile your server side code?

  On Sep 17, 10:28 am, hbatista [EMAIL PROTECTED] wrote:

   Hi,
   I've just upgraded one of my projects from 1.4.60 to1.5.2, and
   everything went very smoothly, but...
   when my application tries to fetch a large number of objects from
  the
   server (via RPC, returns HashMapInteger,xxx, about 6000
  entries) it
   takes a very very long time!

   Before the upgrade this was very fast (at least in Firefox and
Chrome,
   not in IE).

   Strangely, while waiting for the RPC call to return there is NO
  cpu
   activity...

   For me this seems related to some deep changes in the
  serialization
   code (taking a guess here), before the upgrade trying to fetch so
many
   records from the server would crash IE with 'JavaScript
  SyntaxError
   exception: Out of memory', while now it works (good!) but is
  veryslow
   in all browsers (bad!).

   Can someone help me debug this problem?- Hide quoted text -

  - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: colorating a tab

2008-10-07 Thread Zied Hamdi

Hi Thomas and Alex,

Thanks for your fast reply, I was Ill these last days so sorry for my
delay.

 this is
because you don't have the required styles names in your CSS file
(main.css). Otherwise, GWT would load the styles from your file.
Alex: Belive me they are there and firefox shows them as
overriden :-).

If I were you however, I'd file a bug to have the injected stylesheet
come *before* the existing ones so that the ones already present in
the page override the injected stylesheets...
Thomas: thanks, your answer was really relevant since you pointed out
the problem and even how to work around it. I'll submit a bug as you
adviced me, this is frustrating for newbees to think they've
understood the tutorial and to find unexpected results this way.
Thanks also for the hint about StandardResources (I was asking my self
also about how much work it implies to add new skins (or play with the
existing ones), so you're good at reading between the lines ;-) )

Best Regards,
Zied


On Oct 3, 3:01 pm, Thomas Broyer [EMAIL PROTECTED] wrote:
 On 3 oct, 12:12, Zied Hamdi [EMAIL PROTECTED] wrote:



  Hi folks,

  I'm new to GWT (but I read the tutorial). I need to give my tabs a
  different color, and this is what I see in my firebug:

  .gwt-TabBar .gwt-TabBarItem {standard.css (line 870)
  background:#D0E4F6 none repeat scroll 0%;
  color:black;
  cursor:pointer;
  font-weight:bold;
  margin-left:6px;
  padding:3px 6px;
  text-align:center;}

  .gwt-TabBar-Into .gwt-TabBarItem {main.css (line 55)
  background:#EE none repeat scroll 0%;
  color:#6F6F6F;

  }

  so the standard css background and color are overriding my locally
  defined attrs in main.css.

  Is it due to a bad configuration? or is it the way it is supposed to
  work?

 How is the main.css included? It might be a priority problem: if
 main.css is loaded before standard.css (which will probably be the
 case if main.css is not GWT-injected with a stylesheet in your
 module's gwt.xml), given that the two selectors have the same
 specificity [1], their rules are evaluated in the order they've been
 loaded, so the background and color set in standard.css will override
 the one set in your main.css.

 Try adding an !important to your rules and see if they're applied
 (with !important, the rules in standard.css won't override your own !
 important rules, even though they are evaluated after them).
 If that's the case, try to find a way for your stylesheet to be loaded
 after standard.css (and remove the !important, which is bad practice
 and recommended for user-stylesheets only [2]), either by getting your
 main.css injected by GWT, or by inheriting StandardResources (instead
 of Standard) and calling the standard.css by yourself...
 If I were you however, I'd file a bug to have the injected stylesheet
 come *before* the existing ones so that the ones already present in
 the page override the injected stylesheets...

 [1]http://www.w3.org/TR/CSS21/cascade.html#specificity
 [2]http://www.w3.org/TR/CSS21/cascade.html#important-rules
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: JSONP Server Side - Dan Morrill Article

2008-10-07 Thread eggsy84

I expect thats what I'm missing then!

My calling method is as follows:

public native static void getJson(int requestId, String url, CallModel
handler)
/*-{
var callback = callback + requestId;

var script = document.createElement(script);
script.setAttribute(src, url+callback);
script.setAttribute(type, text/javascript);

window[callback] = function(jsonObj)
{
[EMAIL PROTECTED]::handleJsonResponse(Lcom/google/
gwt/core/client/JavaScriptObject;)(jsonObj);
window[callback + done] = true;
}

// JSON download has 1-second timeout
setTimeout(function()
{
if (!window[callback + done])
{
[EMAIL PROTECTED]::handleJsonResponse(Lcom/
google/gwt/core/client/JavaScriptObject;)(null);
}

// cleanup
document.body.removeChild(script);
delete window[callback];
delete window[callback + done];
 }
 , 1000);

 document.body.appendChild(script);
}-*/;

I have adapted it from a useful guide here:

http://giantflyingsaucer.com/blog/?p=126

Eggsy

On Oct 7, 12:24 pm, Adam T [EMAIL PROTECTED] wrote:
 I think what you are missing is the function name in your output from
 the servlet.  From what I see, you just return:

 [{color: \red\,value: \#f00\}]

 when I would expect a response something like:

 mycallback([{color: \red\,value: \#f00\}])

 where the mycallback is the name of the function you add to the DOM
 which calls your handleJSONResponse method - without returning a
 function from your servlet, I'm not sure how your handle method is
 being called.

 Also, are you defining your callback code to pick up the parameter,
 e.g.

 public native static void setup(YourHandlerClass h, String callback) /
 *-{
     window[callback] = function(someData) {
       [EMAIL PROTECTED]::handleJSONResponse(Lcom/
 google/gwt/core/client/JavaScriptObject;)(someData);
     }
   }-*/;

 without the (Lcom/google/gwt/core/client/JavaScriptObject;)(someData)
 part it won't pick up the returned data

 //Adam

 On 7 Okt, 10:14, eggsy84 [EMAIL PROTECTED] wrote:

  Hi Adam,

  Thank you for the reply it definately helps! when you say it needs to
  be well-formed javascript I have implemented a method that performs
  the following:

  /* (non-Javadoc)
  * @see
  javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest,
  javax.servlet.http.HttpServletResponse)
  */
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse
  resp) throws ServletException, IOException
  {
      String output =[{color: \red\,value: \#f00\}];
      resp.setContentType(text/javascript);
      resp.addHeader(Pragma, no-cache);
      resp.setStatus(200);
      PrintWriter out = resp.getWriter();
      out.println(output);

  }

  Would that be sufficient? Well I ask the question but I assume not as
  with my implementation I successfully go back to my client handle
  method now but the JavascriptObject passed in is always null.

  My client side handle method is very basic as a test (shown below) and
  I can confirm that when the claa is complete is definately hits this
  method so the glue between is wrong somehow?

  public void handleJsonResponse(JavaScriptObject jso)
  {
      if (jso == null)
      {
          Window.alert(Unable to parse JSON);
          return;
      }
      else
      {
          Window.alert(Well done Woohoo!!);
      }

  }

  eggsy

  On Oct 6, 9:28 pm, Adam T [EMAIL PROTECTED] wrote:

   Eggsy,

   To get it to work you need to get the plumbing right, and it's not
   quite the same way as calling from code - btw, the example on that
   page is aimed at client side not server side.  The server is any
   language you want as long as it returns a well-formed JavaScript
   segment of the form:

   mycallback({some json content})

   So your servlet would work as long as it returns something like the
   above.

   In this approach you don't call the servlet in the normal way from the
   program code, rather it gets called as a consequence of adding a
   script tag to the DOM - this is what the addScript() method in the
   example code does.  Once the script is added to the DOM the browser
   accesses the defined url of your service and expects a response.  As
   the response is a JavaScript function, it will get evaluated in the
   browser.

   If you also define a function in the DOM with the same name you expect
   back in the server response, e.g. mycallback, and that function calls
   the GWT handle() function then the loop is closed.  The example code
   adds such a function using the setUp() method.

   The example code reserves a new function name for each call made to
   the server, adds that new function to the DOM and then the script
   tag.

   Where things usually go wrong are if the server returns a function
   name not set up, or the response is not a valid javascript expression.

   Hope that helps in some small way!

   //Adam

   this then 

ScrollTable scroll position

2008-10-07 Thread ivovnenko

Hello everyone.
Is there any way to set scroll position in incubator's ScrollTable?
The use case:
I'm adding the element to the bottom(top) of the ScrollTable, and I
want it to be selected and visible - need to scroll to its position.
Thnx
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



i18n, hosted mode with noserver : strange crash

2008-10-07 Thread philippe

Hi all,

I'm using i18n for the first time in a GWT app. When I add the
following line in my gwt.xml file :

extend-property name=locale values=en,fr /

The app crash in hosted mode (stack trace below). I'm using a noserver
configuration (PHP backend). The problem seems to be that GWT can't
find the default locale. I tried to specify it in the URL (with ?
locale=en), or in the HTML page (with meta name=gwt:property
content=locale=en), with no success. I found a couple of threads
with the same exception, but none of them really helped me (in both
cases the hosted mode was working) : I'm aware it could be beacuse of
my noserver configuration, and my nocache files, but I can't find
where...

Thank you for your help.

the stack trace :

[ERROR] Error while executing the JavaScript provider for property
'locale'
java.lang.RuntimeException: Failed to invoke native method:
__gwt_getProperty with 1 arguments.
at com.google.gwt.dev.shell.mac.LowLevelSaf.invoke(LowLevelSaf.java:
160)
at
com.google.gwt.dev.shell.mac.ModuleSpaceSaf.doInvoke(ModuleSpaceSaf.java:
98)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
447)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
228)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:
95)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getPropertyValue(ModuleSpacePropertyOracle.java:
59)
at
com.google.gwt.i18n.rebind.LocaleInfoGenerator.generate(LocaleInfoGenerator.java:
88)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
51)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:116)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:61)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
166)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
114)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:468)
(...)

[ERROR] Error while executing the JavaScript provider for property
'locale'
java.lang.RuntimeException: Failed to invoke native method:
__gwt_getProperty with 1 arguments.
at com.google.gwt.dev.shell.mac.LowLevelSaf.invoke(LowLevelSaf.java:
160)
at
com.google.gwt.dev.shell.mac.ModuleSpaceSaf.doInvoke(ModuleSpaceSaf.java:
98)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
447)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
228)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:
95)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getPropertyValue(ModuleSpacePropertyOracle.java:
59)
at
com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:
97)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
51)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:116)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:61)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
166)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
114)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:468)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
359)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:
39)
(...)

[ERROR] Could not parse specified locale
com.google.gwt.core.ext.BadPropertyValueException: Property 'locale'
cannot be set to unexpected value 'failed to compute'
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:
103)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getPropertyValue(ModuleSpacePropertyOracle.java:
59)
at
com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:
97)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
51)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:116)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:61)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
166)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
114)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:468)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
359)
at 

Re: ScrollTable scroll position

2008-10-07 Thread ivovnenko

Well, haven't noticed such methods in ScrollTable...

On Oct 7, 5:32 pm, Thomas Broyer [EMAIL PROTECTED] wrote:
 On 7 oct, 14:04, ivovnenko [EMAIL PROTECTED] wrote:

  Hello everyone.
  Is there any way to set scroll position in incubator's ScrollTable?
  The use case:
  I'm adding the element to the bottom(top) of the ScrollTable, and I
  want it to be selected and visible - need to scroll to its position.

 Did you gave a look at the ScrollPanel's javadoc (or your IDE's auto-
 complete suggestions)?
  - ensureVisible(UIObject)
  - scrollToBottom / scrollToTop
  - setScrollPosition(int)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: ScrollTable scroll position

2008-10-07 Thread ivovnenko69
I'm using gwt1.5, and don't see such methods in ScrollTable.
On Tue, Oct 7, 2008 at 8:19 PM, Peter D. [EMAIL PROTECTED] wrote:


 They were added in GWT 1.5. So if you are using a 1.4 version or lower
 they do not exist.

 On Oct 7, 1:11 pm, ivovnenko [EMAIL PROTECTED] wrote:
  Well, haven't noticed such methods in ScrollTable...
 
  On Oct 7, 5:32 pm, Thomas Broyer [EMAIL PROTECTED] wrote:
 
   On 7 oct, 14:04, ivovnenko [EMAIL PROTECTED] wrote:
 
Hello everyone.
Is there any way to set scroll position in incubator's ScrollTable?
The use case:
I'm adding the element to the bottom(top) of the ScrollTable, and I
want it to be selected and visible - need to scroll to its position.
 
   Did you gave a look at the ScrollPanel's javadoc (or your IDE's auto-
   complete suggestions)?
- ensureVisible(UIObject)
- scrollToBottom / scrollToTop
- setScrollPosition(int)
 



-- 
Regards, Vanya Vovnenko

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: getting to servlet (non rpc) in hosted mode vs. Tomcat

2008-10-07 Thread Michel

Thank you both for the responses. I haven't tried it out yet, because
I am right now stuck with another problem. I wonder if it is caused by
a similar misunderstanding on my part.

My application needs several files on the server
(myproject.properties, log4j.properties, hibernate.cfg.xml and so on).
Now in hosted mode, I have most of those in in the src folder, or in
the project base folder. I can open a file by: File f = new
File(myproject.properties) That works fine.

When it comes to deploying in Tomcat, this no longer works. It seems
now that in hosted mode, I must read a file with these statements:

InputStream fstream =
this.getClass().getResourceAsStream(myproject.properties);
props.load(fstream);


and now the property file must now sit in the same folder as the class
with these statements in it.


My question is: How can I best organise my resource files, such that
it works in both hosted and deployed modes. Must I perhaps do
something similar with GWT.getHostPageBaseURL()?

Thank you very much for your help, and with kind regards,


Michel
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: ListBox: Drop-Down Images using CSS?

2008-10-07 Thread Kevin

Hi Isaac,

I went to this URL,
http://code.google.com/docreader/#p=google-web-toolkit-incubators=google-web-toolkit-incubatort=MakingIncubatorBetter,
however I could not SVN to either 
http://google-web-toolkit.googlecode.com/svn/tools/
or http://google-web-toolkit-incubator.googlecode.com/svn/trunk/.

I've tried to SVN multiple times to no avail.

Any idea what I can do?

Thanks,
Kevin

On Oct 6, 5:08 pm, Isaac Truett [EMAIL PROTECTED] wrote:
 Those downloads get built to provide baselines for compatibility with major
 GWT releases. Newer features, such as DropDownListBox, are available in SVN.
 You'll need to have a look at Making GWT Incubator
 Betterhttp://code.google.com/docreader/#p=google-web-toolkit-incubators=go...
 for
 instructions on how to build an Incubator jar from trunk.



 On Mon, Oct 6, 2008 at 4:52 PM, Kevin [EMAIL PROTECTED] wrote:

  Hmm. I downloaded both JARs from http://code.google.com/p/google-web-
  toolkit-incubator/downloads/listhttp://code.google.com/p/google-web-toolkit-incubator/downloads/list
  and checked the JAR using the
  Project View in Eclipse, however I have not found the DropDownListBox.

  What should I do?

  Thanks,
  Kevin

  On Oct 6, 12:21 pm, Isaac Truett [EMAIL PROTECTED] wrote:
   You can find a complete example in the Incubator project source
   here
 http://code.google.com/p/google-web-toolkit-incubator/source/browse/t...
   .
   In brief:

   1. Add this to your module definition:
   inherits name='com.google.gwt.gen2.selection.Selection' /

   2. Enjoy:

   DropDownListBoxString listBox = new DropDownListBoxString(Fruit);
   // Add an item
   listBox.addItem(iApple/i, apple);
   // Add an item with a tooltip
   listBox.addItem(bBanana/b, banana, A yellow fruit);

   On Mon, Oct 6, 2008 at 12:03 PM, Kevin [EMAIL PROTECTED]
  wrote:

Thanks again, Isaac!

By the way, could you please show me where to find example code to use
this custom widget in Incubator?

Thanks,
Kevin

On Oct 6, 8:29 am, Isaac Truett [EMAIL PROTECTED] wrote:
 Actually, no, you don't have to deploy it. Just add the jar to your
 classpath when compiling or starting hosted mode. Also be sure to
  have
your
 module inherit the Incubator module that you want to use
 (com.google.gwt.gen2.selection.Selection
 in this case).

 On Sun, Oct 5, 2008 at 8:55 PM, Kevin [EMAIL PROTECTED]
wrote:

  Hi Isaac,

  Thanks for the tip.

  I'm guessing that I just download the JAR for this type of ListBox,
  then deploy it to my WEB-INF/lib folder when deploying?

  On Oct 2, 7:51 am, Isaac Truett [EMAIL PROTECTED] wrote:
   Kevin,

   There's a DropDownListBox widget in the Incubator that might be
  more
   in line with what you're trying to achieve here. It uses a
  PushButton
   and a PopupPanel to simulate the behavior of a standard select
   element. The use of widgets gives you a lot more control over
   appearance and function.

   - Isaac

   On Wed, Oct 1, 2008 at 3:58 PM, Kevin 
  [EMAIL PROTECTED]
  wrote:

Hi,

I hope your day's going well.

In my GWT client code, I have a ListBox that has text
  representing
cars. If you pick Sedan, it should bring up a picture of a
  sedan.
If
you select SUV, it should bring up a picture of an SUV.

I know that you can't add images as inputs to a GWT ListBox,
however I
know that you can add background-images in a CSS.

  ---

Consider my client code:

ListBox lb = new ListBox(); // you need to instantiate a
  ListBox so
you can use it

lb.addItem(Sedan); // you need to populate
lb.addItem(SUV);   // the ListBox options

if ( item.selected == 0 )
   lb.setStyleName(sedan);
else
   lb.setStyleName(SUV);

  ---

  ---

Now look at my HTML code

style type = text/css

.Sedan { background-image: URL(.../images/Sedan.jpg) }
.SUV{ background-image: URL(.../images/SUV.jpg) }

/style

  ---

After, when I select a ListBox option, only text appears - no
image.

My ultimate goal is to have a ListBox with images that when you
select
one, its picture becomes the selected, i.e. only visible,
  image.

Thanks,
Kevin- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 

Approximate release time for GWT 2.0

2008-10-07 Thread jbdhl

Can anyone give an estimate for when GWT 2.0 will be released? Will it
be within a year? Or two years?

I ask because we have decided to move our fairly large application to
GWT as soon as the i18n-part becomes sufficiently mature and we need
to know how to prioritize our resources. That is, we will perform the
re-implementation when GWT supports XLIFF which is a standard for
internationalization message exchange, but in contrast to property
files XLIFF supports metadata. According to the issue tracker [1] GWT
will support XLIFF from version 2.0. From release to release we need
to provide our translators with information on which messages that
have been added, deleted and modified similar to the information the
translators are provided in gettext (which we currently use). This is
easier accomplished with XLIFF.

Regards

References:
[1] http://code.google.com/p/google-web-toolkit/issues/detail?id=2926
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: getting to servlet (non rpc) in hosted mode vs. Tomcat

2008-10-07 Thread Michel

Hi again,

I tried this now:

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL
.encode(GWT.getHostPageBaseURL() 
+IDServlet));

as you suggested, and it works fine, both in hosted mode as well as in
Tomcat.

Thank you very much for your help. Perhaps I should have asked the
question about the files (see above) in a separate thread. My
apologies.

Cheers,


Michel






--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Problem import class external path /client/ HELP!

2008-10-07 Thread Shi

Hi! Mine is a project with the classes (in the package DAO) that
communicate with the database. The problem is that GWT apparently does
not recognize the classes out of /src/client.
The struct of my project is:
/src/
/src/dao/
/src/to/
/src/client/
/src/server/
/src/public/

The compilation of my GWT application from this result:
[ERROR] Errors in '~/src/gwt/client/ComunicationService.java'
  [ERROR] Line 6:  The import to cannot be resolved
  [ERROR] Line 18:  ProgrammerTO cannot be resolved to a type
  [ERROR] Line 18: GWT does not yet support the Java 5.0 language
enhancements; only 1.4 compatible source may be used
.
 [ERROR] Build failed




If I move with a refactoring to.ProgrammerTO in / src / client / to
get another type of error:

[ERROR] Line 19:  The type List is not generic; it cannot be
parameterized with arguments ProgrammerTO
  [ERROR] Line 19: GWT does not yet support the Java 5.0 language
enhancements; only 1.4 compatible source may be used




I tried to make a refactoring moving packages to and dao in /
src / client / but appeared several errors due to incompatibility with
the GWT java.sql * e * java.text.


How can I fix these problems? Thanks in advance! I hope someone can
help me!



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem import class external path /client/ HELP!

2008-10-07 Thread Lothar Kimmeringer

Shi schrieb:
 Hi! Mine is a project with the classes (in the package DAO) that
 communicate with the database. The problem is that GWT apparently does
 not recognize the classes out of /src/client.

How do you come to that conclusion?

 The compilation of my GWT application from this result:
 [ERROR] Errors in '~/src/gwt/client/ComunicationService.java'
   [ERROR] Line 6:  The import to cannot be resolved

Here it's mockering about to not being resolvable

   [ERROR] Line 18:  ProgrammerTO cannot be resolved to a type

The direct result is that ProgrammerTO can't be found.

   [ERROR] Line 18: GWT does not yet support the Java 5.0 language
 enhancements; only 1.4 compatible source may be used

Should be self-exlanating. You're using GWT 1.4 where you
have to restrict yourself to Java 1.4

 I tried to make a refactoring moving packages to and dao in /
 src / client / but appeared several errors due to incompatibility with
 the GWT java.sql * e * java.text.
 
 
 How can I fix these problems? Thanks in advance! I hope someone can
 help me!

You have to write a RemoteServiceServlet that does the communication
with the database and transfer data using data-classes residing
in the client-package or another one that is declared as source-package.


Regards, Lothar

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How can a GWT application dynamically invoke another GWT application?

2008-10-07 Thread Sumit Chandel
Hi David,
Alternatively, until something like the GWT.runAsync() feature comes out,
you could design your GWT components as two separate entities, where one can
be painted into the main display or main root panel at a time so you can
control which component you want to load up and display.

I'm not sure about the exact details of how GWT.runAsync() will work, but I
believe the idea is to pass in separate components that you want to load up
asynchronously to the runAsync() method, so designing your application into
components now would probably benefit you once the runAsync() feature is
available as well.

Hope that helps,
-Sumit Chandel

On Mon, Oct 6, 2008 at 4:26 AM, David [EMAIL PROTECTED] wrote:


 I developed a GWT application, for instance, mail sample. I want to
 load another GWT application (SimpleXML sample) into the main
 application's panel dynamically (i.e., later binding without design
 time information, like pure java reflection).

 How can I do this?

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Exception while dispatching incoming RPC call

2008-10-07 Thread Thad

My GWT application is using a native function to call another GWT app
embedded in my main app:

native JavaScriptObject openWindow(String param) /*-{
$wnd.open('./ProjectB.html?param='+param, '_blank');
return true;
}-*/;

The ProjectB window opens and it's app runs perfectly.  However, I get
an error alert, call failed on server.  Why?

The error is coming from GTW, as Tomcat's localhost logfile shows

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:
617)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readInt(ServerSerializationStreamReader.java:
432)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepareToRead(AbstractSerializationStreamReader.java:
38)
...

(I asked this late last Friday.  Maybe no one knows why this error
comes up, maybe it  but I'm desperate to find a solution.  There more
details at 
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/e8e7924527a4a1d4#).


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem import class external path /client/ HELP!

2008-10-07 Thread Shi

Thank you for reply me!
How should specify the source package in the file .gwt.xml?
I changed the file .gwt.xml:

module

  inherits name=com.google.gwt.user.User/
  inherits name=com.gwtext.GwtExt/
  entry-point class=gwt.client.GwtApplication/
  source path=to/
  stylesheet src=js/ext/resources/css/ext-all.css/
  script src=js/ext/adapter/ext/ext-base.js/
  script src=js/ext/ext-all.js/
  servlet class=gwt.server.ComunicationServiceImpl path=/
comunication/
  stylesheet src=GwtApplication.css/
/module

and the error is:

Compiling module gwt.GwtApplication
Computing all possible rebind results for 'gwt.client.GwtApplication'
   Rebinding gwt.client.GwtApplication
  Checking rule generate-with
class='com.google.gwt.user.rebind.ui.ImageBundleGenerator'/
 [ERROR] Unable to find type 'gwt.client.GwtApplication'
[ERROR] Hint: Previous compiler errors may have made this
type unavailable
[ERROR] Hint: Check the inheritance chain from your
module; it may not be inheriting a required module or a module may not
be adding its source path entries properly
[ERROR] Build failed


My version GWT is: 1.5.2
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem import class external path /client/ HELP!

2008-10-07 Thread Lothar Kimmeringer

Shi schrieb:
 How should specify the source package in the file .gwt.xml?
 I changed the file .gwt.xml:
[...]
   source path=to/

That's correct, but you need to add all source-paths if you
specify source-paths. So now, client is missing.



Regards, Lothar

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Memory leak with DOM method ?

2008-10-07 Thread jay

In a few cases, I've found that the Widget I'm working with isn't
getting events as I expected. Fixing this entails something like this:
  class MyWidget extends Widget {
. . .
 protected void onAttach() {
  super.onAttach();
  DOM.setEventListener( getElement(), this );
 }

Can someone tell me if I'm at risk of a memory leak by doing this?

(For completeness, one place I had to do this was in a class I
created, ResizablePanel, which captures mouse events to allow the user
to click  drag an edge of the panel to resize it. [You'd never guess
that functionality from the class name, huh? :-) I don't remember now
where the mouse events were going, but the only way I could figure out
for this class to get them was to set itself as the event listener...]

Thanks,

jay

On Oct 7, 7:29 am, Thomas Broyer [EMAIL PROTECTED] wrote:
 On 7 oct, 15:38, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Thanks.

  Is there recommandation to use DOM ? how must i use
  DOM.seteventlistener ?

 You have to call DOM.setEventListener(elt, null) whenever elt is
 detached from the document (that's what Widget.onDetach does) or at
 least at unload time (RootPanels are detached at on unload, and thus
 detach their children in cascade; same goes for widgets created with
 their static wrap() method, as they automatically register themselves
 for RootPanel.detachOnWindowClose).

 Actually, you'd rather create a Widget and follow the static
 wrap(Element) pattern found on other widgets (Button, TextBox, etc.)
 than directly play with DOM.setEventListener. Or just be careful to
 reset event listeners to null before unload for each element
 you've attached a listener to.

  Is it possible to have memory leak when using DOM.getElementAttribute
  or DOM.getParent for example ?

 I don't think so. Actually, memory leaks are mostly caused by DOM
 elements referencing javascript objects referencing back the DOM
 element (which is easily done when attaching events in pure
 JavaScript). You shouldn't suffer from memory leaks with GWT except
 if you start playing with DOM.setEventListener and/or JSNI.

 That being said, I'm not a JavaScript expert wrt memory leaks, so
 you'd better check before taking my word for it :-P
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Firebug tells me that __gwt_initHandlers is not defined

2008-10-07 Thread doubtintom

Well, the explanation, in case it is any use to someone else, is this.

I had been paring down my previous multiple entry point app to
having just one entry point. As I wanted only a log in dialog at the
outset, I had nothing, or almost nothing, in the RootPanel. I had not
planned on instantiating the application window at all until someone
validly logged in. All of this worked just swell in the hosted mode.

But the GWT compiler took it to mean that I didn't want to use GWT
windows at all, so, I got no initHandlers defined and a blank window
when running the app in Tomcat.

So I'm refactoring my startup layout. A lesson learned.

I figured this out by diff'ing the
com.thing.client.EntryPointClass.nocache.js file from my full blown
app, and one from a simpler app that was working in Tomcat.
__gwt_initHandlers not defined means that if you don't request at
least one window to exist in RootPanel at startup, the compiler will
not define any code to initialize windows, even if you might be
wanting to add them later in your app's workflow. In hindsight, makes
perfect sense.

Might be nice if we had a GWT.dwit() method. Stands for compiler, do
what I'm thinking.

Tom
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Own class-generation and repeated call of GWT.create

2008-10-07 Thread Ian Petersen

It's by design that the second and subsequent calls to tryCreate
return null.  The null return value indicates that the generator has
already created an implementation for the given type.  You should just
bail out early in that case.  I usually write my generators like this:

public String generate(TreeLogger logger, GeneratorContext context,
String typeName) throws UnableToCompleteException {

  // setup code

  String packageName = ...;
  String className = ...;

  PrintWriter pw = context.tryCreate(logger, packageName, className);

  if (pw != null) {
writeClass(pw, ...);
  }

  return packageName + . + className;
}

The writeClass method contains all the logic for actually generating
an implementation, but I only invoke it if it hasn't been invoked
before.  The reason for this is that generate() is invoked once per
permutation.  If you wanted to generate a different AboutData
implementation for different user agents, different locales, or some
other axis of deferred binding, you'd have to pick a different name
for each implementation and you'd generate more than one file.  As it
is, you only need one implementation for all the axes, so you can just
bail early on every call to generate() after the first.

Ian

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Hosted Mode won't load my app, just sits there at http://localhost:8888

2008-10-07 Thread Matt Bishop

I have run into a strange problem with an existing project I have been
working on. It runs on GWT 1.5.2, OS X, 10.5.5, Java5. The project I
am working on has been in development for the last 4 months on this
configuration. I debug it daily, make changes, etc.

Yesterday I was starting up the application in Hosted Mode and found
that the browser window would not load my module!  It would pop the
dev shell, then the browser pointing at http://localhost: but then
it would never fill in my module/index.html path.

If I manually enter the module/index.html path, nothing happens when I
hit GO. No error messages, no slowdowns.

if I rt-click on the empty browser window and Inspect Element, it
comes up completely empty; however, the Documents list has my module/
index.html file selected, so it does seem to get partly there.

When I WAR up my build product and drop it on Tomcat, everything runs
fine.

I've been developing on GWT since 1.3, and I would consider myself an
expert at it, but this one has me stumped. Any way to generate verbose
logging on the shell? Any Hosted Mode preferences/settings tucked away
somewhere I can blow away? I have tried reinstalling GWT, no luck.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Hosted Mode won't load my app, just sits there at http://localhost:8888

2008-10-07 Thread Matt Bishop

I forgot to mention, the only logging I can find is in system.log:

Oct  7 15:11:33 vanjma12 /System/Library/Frameworks/JavaVM.framework/
Versions/1.5.0/Home/bin/java[423]: CPSSetForegroundOperationState():
This call is deprecated and should not be called anymore.
Oct  7 15:11:35 vanjma12 java[423]: [Java CocoaComponent compatibility
mode]: Enabled
Oct  7 15:11:35 vanjma12 java[423]: [Java CocoaComponent compatibility
mode]: Setting timeout for SWT to 0.10


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: I am not a JAVA developer

2008-10-07 Thread Guy Rouillier

SID wrote:
 Dear experts,
 
 I have come across this GWT recently and I need to know more about it
 and its usage. I need to develop some intranet applications like
 Contact Manager, Activity Manager, Some workflow for ESS (like leave
 request, business travel request, etc), and some other modules.
 
 In the past, I have been using ASP.NET for application developments. I
 have never used JAVA for any of my applications.
 
 If I decide to use GWT and JAVA, how much time will it take to learn
 and use it for my this project? Will it be tough? Do you think it is a
 good idea to use GWT for my current requirement?
 
 Though I have never used, but I have learned C, C++ during my studies.

Well, you are biting off a very large chunk at once.  We just finished 
our first GWT application, and we are pretty seasoned Java developers. 
The app is pretty simple, and it still took us about 2 months to figure 
out how we wanted to standardize our approach.  I suppose since you'll 
be doing this yourself, you won't have much discussion on building a 
platform for your company.  But still, just understanding the concepts 
new to GWT is quite a challenge.  In our case, we are persisting data to 
a relation DB, so we had to figure out how to retrieve that, transform 
it into something GWT could use, serialize to browser, etc.  All 
standard GWT stuff, but quite a learning curve.

Since you've never written programs in C++ either, I'd say you should 
probably give yourself 6 months for your first Java/GWT app.

-- 
Guy Rouillier

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: My project can't use browser back/forward!

2008-10-07 Thread hooly.jia

Thank you! I know how should I do!

On 10月7日, 下午10时32分, Isaac Truett [EMAIL PROTECTED] wrote:
 Hi!
 Are you using History.newItem() and HistoryListener(s) to switch between
 panels? Can you show us that code?



 On Tue, Oct 7, 2008 at 4:32 AM, hooly.jia [EMAIL PROTECTED] wrote:

  hello!
  I created a project and add a lot of panels. Completion of the basic
  operation of the panel to switch between, but my project can not use
  the browser's back/forward button. What is the problem?
  History is not just for the link.
  How should I do?
  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: ListBox: Drop-Down Images using CSS?

2008-10-07 Thread Kevin

Hey Isaac!

It looks like it was a firewall error. You were spot on!

Anyway, I'm at home trying to make this JAR so I can ship it to work.
I tried to import using Tortoise SVN to http://google-web-toolkit-
incubator.googlecode.com/svn/trunk/ but it was asking for a username
and password. I tried a few usual default passwords, but it didn't
work.

Then I tried http://google-web-toolkit-incubator.googlecode.com/svn/
trunk/ in Mozilla Firefox and it worked without a password.

What do I do?

Thanks,
Kevin

On Oct 7, 1:51 pm, Isaac Truett [EMAIL PROTECTED] wrote:
 What sort of error are you getting? Can you access any SVN repositories
 outside of your local network? It could be a firewall on your network that
 is preventing access.

 On Tue, Oct 7, 2008 at 1:43 PM, Kevin [EMAIL PROTECTED] wrote:

  Hi Isaac,

  I went to this URL,

 http://code.google.com/docreader/#p=google-web-toolkit-incubators=go...
  ,
  however I could not SVN to either
 http://google-web-toolkit.googlecode.com/svn/tools/
  orhttp://google-web-toolkit-incubator.googlecode.com/svn/trunk/.

  I've tried to SVN multiple times to no avail.

  Any idea what I can do?

  Thanks,
  Kevin

  On Oct 6, 5:08 pm, Isaac Truett [EMAIL PROTECTED] wrote:
   Those downloads get built to provide baselines for compatibility with
  major
   GWT releases. Newer features, such as DropDownListBox, are available in
  SVN.
   You'll need to have a look at Making GWT Incubator
   Better
 http://code.google.com/docreader/#p=google-web-toolkit-incubators=go...
   for
   instructions on how to build an Incubator jar from trunk.

   On Mon, Oct 6, 2008 at 4:52 PM, Kevin [EMAIL PROTECTED]
  wrote:

Hmm. I downloaded both JARs from http://code.google.com/p/google-web-
toolkit-incubator/downloads/list
 http://code.google.com/p/google-web-toolkit-incubator/downloads/list
and checked the JAR using the
Project View in Eclipse, however I have not found the DropDownListBox.

What should I do?

Thanks,
Kevin

On Oct 6, 12:21 pm, Isaac Truett [EMAIL PROTECTED] wrote:
 You can find a complete example in the Incubator project source
 here
   http://code.google.com/p/google-web-toolkit-incubator/source/browse/t..
  .
 .
 In brief:

 1. Add this to your module definition:
 inherits name='com.google.gwt.gen2.selection.Selection' /

 2. Enjoy:

 DropDownListBoxString listBox = new
  DropDownListBoxString(Fruit);
 // Add an item
 listBox.addItem(iApple/i, apple);
 // Add an item with a tooltip
 listBox.addItem(bBanana/b, banana, A yellow fruit);

 On Mon, Oct 6, 2008 at 12:03 PM, Kevin [EMAIL PROTECTED]
wrote:

  Thanks again, Isaac!

  By the way, could you please show me where to find example code to
  use
  this custom widget in Incubator?

  Thanks,
  Kevin

  On Oct 6, 8:29 am, Isaac Truett [EMAIL PROTECTED] wrote:
   Actually, no, you don't have to deploy it. Just add the jar to
  your
   classpath when compiling or starting hosted mode. Also be sure to
have
  your
   module inherit the Incubator module that you want to use
   (com.google.gwt.gen2.selection.Selection
   in this case).

   On Sun, Oct 5, 2008 at 8:55 PM, Kevin 
  [EMAIL PROTECTED]
  wrote:

Hi Isaac,

Thanks for the tip.

I'm guessing that I just download the JAR for this type of
  ListBox,
then deploy it to my WEB-INF/lib folder when deploying?

On Oct 2, 7:51 am, Isaac Truett [EMAIL PROTECTED] wrote:
 Kevin,

 There's a DropDownListBox widget in the Incubator that might
  be
more
 in line with what you're trying to achieve here. It uses a
PushButton
 and a PopupPanel to simulate the behavior of a standard
  select
 element. The use of widgets gives you a lot more control over
 appearance and function.

 - Isaac

 On Wed, Oct 1, 2008 at 3:58 PM, Kevin 
[EMAIL PROTECTED]
wrote:

  Hi,

  I hope your day's going well.

  In my GWT client code, I have a ListBox that has text
representing
  cars. If you pick Sedan, it should bring up a picture of
  a
sedan.
  If
  you select SUV, it should bring up a picture of an SUV.

  I know that you can't add images as inputs to a GWT
  ListBox,
  however I
  know that you can add background-images in a CSS.

  ---

  Consider my client code:

  ListBox lb = new ListBox(); // you need to instantiate a
ListBox so
  you can use it

  lb.addItem(Sedan); // you need to populate
  lb.addItem(SUV);   // the ListBox options

  if ( item.selected == 0 )
     lb.setStyleName(sedan);
  else
     lb.setStyleName(SUV);

  

[gwt-contrib] Code Review: gwt-google-apis maps Status Code not translated - issue 189

2008-10-07 Thread Eric Ayers
Hello Miguel,

Here is another patch I'd like for you to review.  It addresses issue 189 in
the issue tracker:

  http://code.google.com/p/gwt-google-apis/issues/detail?id=189

The problem was very easy to solve, but I went ahead and added some more
unit testing and eliminated some warnings from a couple of other tests.
Note that I moved the StatusCodesTest.java file to the correct package in
the test source tree as well.

M  maps/test/com/google/gwt/maps/MapsTestSuite.java
M  maps/test/com/google/gwt/maps/client/impl/MinimumMapVersionTest.java
D  maps/test/com/google/gwt/maps/client/StatusCodesTest.java
A  maps/test/com/google/gwt/maps/client/geocode/StatusCodesTest.java
M  maps/test/com/google/gwt/maps/client/MapWidgetEventsTest.java
M  maps/test/com/google/gwt/maps/client/geom/BoundsTest.java
M  maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java

-Eric.
-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

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

M  maps/test/com/google/gwt/maps/MapsTestSuite.java
M  maps/test/com/google/gwt/maps/client/impl/MinimumMapVersionTest.java
D  maps/test/com/google/gwt/maps/client/StatusCodesTest.java
A  maps/test/com/google/gwt/maps/client/geocode/StatusCodesTest.java
M  maps/test/com/google/gwt/maps/client/MapWidgetEventsTest.java
M  maps/test/com/google/gwt/maps/client/geom/BoundsTest.java
M  maps/src/com/google/gwt/maps/client/geocode/StatusCodes.java

Index: maps/test/com/google/gwt/maps/MapsTestSuite.java
===
--- maps/test/com/google/gwt/maps/MapsTestSuite.java	(revision 865)
+++ maps/test/com/google/gwt/maps/MapsTestSuite.java	(working copy)
@@ -21,7 +21,7 @@
 import com.google.gwt.maps.client.MapWidgetEventsTest;
 import com.google.gwt.maps.client.MapWidgetTest;
 import com.google.gwt.maps.client.MapsNotInstalledTest;
-import com.google.gwt.maps.client.StatusCodesTest;
+import com.google.gwt.maps.client.geocode.StatusCodesTest;
 import com.google.gwt.maps.client.control.ControlTest;
 import com.google.gwt.maps.client.geocode.DirectionsTest;
 import com.google.gwt.maps.client.geocode.GeocodeTest;
@@ -54,6 +54,7 @@
 suite.addTestSuite(MapWidgetTest.class);
 suite.addTestSuite(ControlTest.class);
 suite.addTestSuite(GeocodeTest.class);
+suite.addTestSuite(StatusCodesTest.class);
 suite.addTestSuite(DirectionsTest.class);
 suite.addTestSuite(InfoWindowEventsTest.class);
 suite.addTestSuite(MarkerEventsTest.class);
@@ -66,7 +67,6 @@
 suite.addTestSuite(PolygonTest.class);
 suite.addTestSuite(PolylineTest.class);
 suite.addTestSuite(CopyrightEventTest.class);
-suite.addTestSuite(StatusCodesTest.class);
 suite.addTestSuite(LatLngTest.class);
 suite.addTestSuite(LatLngBoundsTest.class);
 suite.addTestSuite(ProjectionTest.class);
Index: maps/test/com/google/gwt/maps/client/impl/MinimumMapVersionTest.java
===
--- maps/test/com/google/gwt/maps/client/impl/MinimumMapVersionTest.java	(revision 865)
+++ maps/test/com/google/gwt/maps/client/impl/MinimumMapVersionTest.java	(working copy)
@@ -95,12 +95,14 @@
   }
 
   public void testConcreteOverlayImpl() {
+@SuppressWarnings(unused)
 ConcreteOverlay concreteOverlay = new ConcreteOverlay(
 nativeMakeConcreteOverlay());
   }
 
   public void testControl() {
 ControlPosition pos = new ControlPosition(ControlAnchor.BOTTOM_LEFT, 0, 0);
+@SuppressWarnings(unused)
 CustomControl c = new CustomControl(pos) {
 
   @Override
@@ -135,10 +137,12 @@
   return result;
 }
   }
+@SuppressWarnings(unused)
 MyGeocodeCache customGc = new MyGeocodeCache();
   }
 
   public void testMapImpl() {
+@SuppressWarnings(unused)
 MapWidget w = new MapWidget();
   }
 
@@ -146,15 +150,18 @@
 initTileLayer();
 TileLayer[] layers = new TileLayer[1];
 layers[0] = tileLayer;
+@SuppressWarnings(unused)
 MapType t = new MapType(layers, new MercatorProjection(1),
 versionTestLayer);
   }
 
   public void testMercatorProjection() {
+@SuppressWarnings(unused)
 MercatorProjection m = new MercatorProjection(2);
   }
 
   public void testOverlayImpl() {
+@SuppressWarnings(unused)
 Overlay o = new Overlay() {
 
   @Override
@@ -179,6 +186,7 @@
 
   public void testProjection() {
 initTileLayer();
+@SuppressWarnings(unused)
 Projection projection = new Projection() {
 
   @Override
@@ -206,6 +214,7 @@
 
   public void testTileLayerOverlay() {
 initTileLayer();
+@SuppressWarnings(unused)
 TileLayerOverlay overlay = new TileLayerOverlay(tileLayer);
   }
 
Index: maps/test/com/google/gwt/maps/client/StatusCodesTest.java

[gwt-contrib] Re: data binding framework for GWT

2008-10-07 Thread Arthur Kalmenson

Hello Ian,

I had a coworker take a look at the data binding framework. It looks
really good so far, but we had a couple of questions:

- Is it possible to run the binding on demand instead of automatically
with the attached listeners? Say I want to only run the binding after
the user pressed the submit button, is that possible?
- the converters are useful for general data mapping, but they also
seem to be performing the role of validator. Is it possible to use the
validation framework from the incubator or the one proposed here:
http://code.google.com/p/google-web-toolkit/issues/detail?id=343#c30.
Or, should the converters continue to perform the role of converting
the data to match the binded data type? The converters wouldn't be a
problem if the binding could be delayed and allow validation to run
it's course.
- when executing Integer.parseInt() in the converters on non Integers,
an exception should be thrown, but it seems to be getting caught
somewhere. Where is that happening?

This framework looks very promising and well thought out. A less
verbose binding mechanism would be nice, but I'm not entirely sure how
it would be done. Thanks for the great work, I hope that this makes it
into the incubator soon.

Regards,
Arthur Kalmenson

On Oct 3, 11:09 pm, Ian Petersen [EMAIL PROTECTED] wrote:
 Here's a sample project.  The .tgz includes an updated
 data_binding.jar because I found a few bugs while working on the
 example.  The new JAR also includes .class files as generated by Sun's
 javac version 1.5.something.  The .tgz includes Sandy McArthur's
 PropertyChange stuff, so you _should_ be able to import the Eclipse
 project and run it.  Let me know if you have problems.

 Ian

  data_binding_example.tgz
 196KViewDownload
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---



[gwt-contrib] Re: A rose by any other name (what to call addHandlersAndSink)

2008-10-07 Thread Emily Crutcher

 Would it be typical to addHandler() for a DOM event and *not* want to sink?
 If so, then it makes more sense for the names to be uniform, perhaps even
 left as is.


It would typically be the case that you would want to sink, however this is
not always true, so we want users to have the option of whether to sink or
not.



 While we're talking about names, the term key as in event key sounds
 confusingly like key as in my keyboard has keys. Perhaps there's another
 term?


Here are some random suggestions to see if they spark others:

   1. Type/TYPE --  addHandler(ClickEvent.TYPE, handler)
   2. Meta/meta -- addHandler(ClickEvent.meta, handler)
   3.  Info/INFO -- addHandler(ClickEvent.INFO, handler)





 On Mon, Oct 6, 2008 at 5:36 PM, Emily Crutcher [EMAIL PROTECTED] wrote:

 Here is the current doc on it, to give context:

   /**
* Adds a native event handler to the widget and sinks the corresponding
* native event.
*
* @param HandlerType the type of handler to add
* @param key the event key
* @param handler the handler
* @return [EMAIL PROTECTED] HandlerRegistration} used to remove the 
 handler
*/
   protected HandlerType extends EventHandler HandlerRegistration
 addHandlerAndSink(
   DomEvent.Key?, HandlerType key, final HandlerType handler) {
 sinkEvents(key.getNativeEventType());
 return addHandler(key, handler);

   }

 On Mon, Oct 6, 2008 at 5:35 PM, Emily Crutcher [EMAIL PROTECTED] wrote:

 The purpose of the new method addHandlersAndSink is to allow users to
 add a DOM handler and sink the necessary event in one easy step.

 The reason we, the GWT team, care about this is because traditionally,
 with the two call separated everyone, including us, will tend to sink the
 events in the constructor rather then when a handler is actually added. This
 can degrade performance significantly for small widgets, so we'd like to
 encourage our developers to do the fast/efficient thing instead.

 addHandlersAndSink has the advantage that when you autocomplete to find
 your widget methods, it appears directly under addHandlers.  However, it
 sounds somewhat awkward, so a better name might be in order, hence this
 post...





 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't




 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't




 



-- 
There are only 10 types of people in the world: Those who understand
binary, and those who don't

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



[gwt-contrib] [google-web-toolkit commit] r3724 - trunk/user/src/com/google/gwt/user/client/ui

2008-10-07 Thread codesite-noreply

Author: [EMAIL PROTECTED]
Date: Tue Oct  7 07:54:14 2008
New Revision: 3724

Modified:
trunk/user/src/com/google/gwt/user/client/ui/DialogBox.java
trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java

Log:
Let users drag DialogBoxes off the screen in any direction, but only as  
long as
the mouse pointer stays in the window -- so you can't totally lose a  
DialogBox.

patch by: ajr
review by: rdayal
suggested by: jgw


Modified: trunk/user/src/com/google/gwt/user/client/ui/DialogBox.java
==
--- trunk/user/src/com/google/gwt/user/client/ui/DialogBox.java (original)
+++ trunk/user/src/com/google/gwt/user/client/ui/DialogBox.java Tue Oct  7  
07:54:14 2008
@@ -15,9 +15,12 @@
   */
  package com.google.gwt.user.client.ui;

+import com.google.gwt.dom.client.Document;
  import com.google.gwt.user.client.DOM;
  import com.google.gwt.user.client.Element;
  import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.WindowResizeListener;

  /**
   * A form of popup that has a caption area at the top and can be dragged  
by the
@@ -69,6 +72,10 @@
private boolean dragging;
private int dragStartX, dragStartY;
private MouseListenerCollection mouseListeners = new  
MouseListenerCollection();
+  private WindowResizeListener resizeListener;
+  private int windowWidth;
+  private int clientLeft;
+  private int clientTop;

/**
 * Creates an empty dialog box. It should not be shown until its child  
widget
@@ -114,6 +121,10 @@
  // Set the style name
  setStyleName(DEFAULT_STYLENAME);
  sinkEvents(Event.MOUSEEVENTS);
+
+windowWidth = Window.getClientWidth();
+clientLeft = Document.get().getBodyOffsetLeft();
+clientTop = Document.get().getBodyOffsetTop();
}

public String getHTML() {
@@ -125,6 +136,12 @@
}

@Override
+  public void hide() {
+Window.removeWindowResizeListener(resizeListener);
+super.hide();
+  }
+
+  @Override
public void onBrowserEvent(Event event) {
  super.onBrowserEvent(event);

@@ -178,6 +195,14 @@
  if (dragging) {
int absX = x + getAbsoluteLeft();
int absY = y + getAbsoluteTop();
+
+  // if the mouse is off the screen to the left, right, or top, don't
+  // move the dialog box. This would let users lose dialog boxes, which
+  // would be bad for modal popups.
+  if (absX  clientLeft || absX = windowWidth || absY  clientTop) {
+return;
+  }
+
setPopupPosition(absX - dragStartX, absY - dragStartY);
  }
}
@@ -209,6 +234,19 @@
 */
public void setText(String text) {
  caption.setText(text);
+  }
+
+  @Override
+  public void show() {
+if (resizeListener == null) {
+  resizeListener = new WindowResizeListener() {
+public void onWindowResized(int width, int height) {
+  windowWidth = width;
+}
+  };
+}
+Window.addWindowResizeListener(resizeListener);
+super.show();
}

@Override

Modified: trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java
==
--- trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.java
(original)
+++ trunk/user/src/com/google/gwt/user/client/ui/PopupPanel.javaTue Oct 
 7  
07:54:14 2008
@@ -573,17 +573,6 @@
 * @param top the top position, in pixels
 */
public void setPopupPosition(int left, int top) {
-// Keep the popup within the browser's client area, so that they can't  
get
-// 'lost' and become impossible to interact with. Note that we don't  
attempt
-// to keep popups pegged to the bottom and right edges, as they will  
then
-// cause scrollbars to appear, so the user can't lose them.
-if (left  0) {
-  left = 0;
-}
-if (top  0) {
-  top = 0;
-}
-
  // Save the position of the popup
  leftPosition = left;
  topPosition = top;

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



[gwt-contrib] Re: Code Review Request - PopupPanel modal and autoHide accessors

2008-10-07 Thread Ray Ryan
It might be good for the javadoc on the setter methods to mention that they
have no immediate effect if called while the dialog is showing. In fact,
should we encourage people to hide the dialog before using the new setters?

It looks like we have no test coverage for the panel's behavior in its four
states? (modal x autohide.) You could factor out the guts of testPopup and
run it four times, once in each combination.

For that matter, we don't test auto-hide or modality at all, beyond your new
check that the bits get set. Is that possible?

rjrjr

On Tue, Oct 7, 2008 at 9:52 AM, John LaBanca [EMAIL PROTECTED] wrote:

 Ray -

 Please do a code review on this patch that adds getters and setters for
 modal and autoHide properties to PopupPanel.

 Description:
 =
 It would be nice to have getters and setters for moal and autoHide
 properties in PopupPanel.

 Fix:
 ===
 Added them.

 Testing:
 ==
 Manually verified that changing the properties while the popup is visible
 does not cause any state problems.  The booleans are checked on
 onEventPreview() at the time of an event, and no special setup/teardown is
 done as a result of them being set.  I also added a unit test for the
 setters and getters.

 Thanks,
 John LaBanca
 [EMAIL PROTECTED]


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

Index: user/test/com/google/gwt/user/client/ui/PopupTest.java
===
--- user/test/com/google/gwt/user/client/ui/PopupTest.java	(revision 3723)
+++ user/test/com/google/gwt/user/client/ui/PopupTest.java	(working copy)
@@ -50,6 +50,18 @@
 assertFalse(popup.isAnimationEnabled());
 popup.setAnimationEnabled(true);
 assertTrue(popup.isAnimationEnabled());
+
+// Modal
+popup.setModal(true);
+assertTrue(popup.isModal());
+popup.setModal(false);
+assertFalse(popup.isModal());
+
+// AutoHide enabled
+popup.setAutoHideEnabled(true);
+assertTrue(popup.isAutoHideEnabled());
+popup.setAutoHideEnabled(false);
+assertFalse(popup.isAutoHideEnabled());
   }
 
   /**
Index: user/src/com/google/gwt/user/client/ui/PopupPanel.java
===
--- user/src/com/google/gwt/user/client/ui/PopupPanel.java	(revision 3723)
+++ user/src/com/google/gwt/user/client/ui/PopupPanel.java	(working copy)
@@ -435,6 +435,26 @@
 return isAnimationEnabled;
   }
 
+  /**
+   * Returns codetrue/code if the popup should be automatically hidden when
+   * the user clicks outside of it.
+   * 
+   * @return true if autoHide is enabled, false if disabled
+   */
+  public boolean isAutoHideEnabled() {
+return autoHide;
+  }
+
+  /**
+   * Returns codetrue/code if keyboard or mouse events that do not target
+   * the PopupPanel or its children should be ignored.
+   * 
+   * @return true if popup is modal, false if not
+   */
+  public boolean isModal() {
+return modal;
+  }
+
   public boolean onEventPreview(Event event) {
 Element target = DOM.eventGetTarget(event);
 
@@ -542,6 +562,16 @@
   }
 
   /**
+   * Enable or disable the autoHide feature. When enabled, the popup will be
+   * automatically hidden when the user clicks outside of it.
+   * 
+   * @param autoHide true to enable autoHide, false to disable
+   */
+  public void setAutoHideEnabled(boolean autoHide) {
+this.autoHide = autoHide;
+  }
+
+  /**
* Sets the height of the panel's child widget. If the panel's child widget
* has not been set, the height passed in will be cached and used to set the
* height immediately after the child widget is set.
@@ -566,6 +596,16 @@
   }
 
   /**
+   * When the popup is modal, keyboard or mouse events that do not target the
+   * PopupPanel or its children will be ignored.
+   * 
+   * @param modal true to make the popup modal
+   */
+  public void setModal(boolean modal) {
+this.modal = modal;
+  }
+
+  /**
* Sets the popup's position relative to the browser's client area. The
* popup's position may be set before calling [EMAIL PROTECTED] #show()}.
* 


[gwt-contrib] Re: data binding framework for GWT

2008-10-07 Thread Ian Petersen

On Tue, Oct 7, 2008 at 10:56 AM, Arthur Kalmenson [EMAIL PROTECTED] wrote:
 Yes, I'm looking to avoid updating the bean automatically. I want to
 specify when the bean should be updated.

I see.  I hadn't thought of that use case.  As it stands, no, you
can't do that.  BoundFieldImplB, P has a nested class Listener that
implements EditorChangeListenerP.  BoundFieldImpl's getEditor() adds
an instance of Listener as a change listener to the editor before
returning it.  That listener takes care of updating the bean when the
editor changes and, as it stands, you can't not add the listener.

When I designed the library, I thought of bound widgets as views on
fields in a bean.  If the bean changes, the widget is updated and if
the widget changes, the bean is updated.  If you created a detached
editor that didn't automatically update the bean, what would you want
to happen if the bean were to change behind the scenes?  Right now, if
the bean SourcesPropertyChangeEvents, the editors and viewers are
updated onPropertyChange.  Would you want a detached editor to ignore
property change events from the associated bean?

 It'll also be interesting to see what the performance implications are
 of having the bean updated on any change. Does it work fine for forms
 of 100+ fields?

I haven't explicitly tested it with that many fields, but I'd expected
it to be okay--only the property bound to a given widget will be
updated when that widget changes.  In the example I posted, the Person
class has firstName and lastName properties.  When you edit a given
person, the firstName and lastName properties are bound to text boxes.
 If you edit the first name, only the firstName property is updated
and likewise for the last name.  Where there could be performance
considerations is if you have lots of viewers and/or calculated
fields all depending on the same property and then you edit that
property.  I don't know what would happen then--the UI would probably
freeze until the updates were all complete.  I'd be surprised if a
real application had a single field with 100+ dependent viewers,
though.

 Hmm, that's a good point. However, the way the current Converters work
 is that they remove the value that is entered by the user if it
 doesn't convert properly. As you mentioned, this probably has to do
 with the way exceptions are handled (putting back the previous value,
 which happened to be empty).

I don't mean to nitpick, but it's actually the editor that puts back
the previous value, not the converter.  The converter just throws a
ConversionException if the String couldn't be converted.  It's up to
the editor to decide what to do with the ConversionException.  The
existing implementation of HasTextEditorT, W aims to be
convertable at all times, so a conversion exception in
widgetChanged() leads to redisplaying the previous value.  You could
do something else, like leave the invalid input but mark the field
somehow.  It's up to the application how it chooses to implement the
EditorT interface.

 I think that the validation that you have in mind is bean based
 validation, which is being discussed already (http://code.google.com/p/
 google-web-toolkit/issues/detail?id=343). This is different from the
 widget based validation which is currently in the incubator. Things
 are all over the place right now, and I think we need some direction
 from the GWT team.

I have a lunch appointment earlier than I expected, so I haven't had a
chance to look into validators or the link you just provided, but I'll
look into them this afternoon.

Ian

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



[gwt-contrib] Re: A rose by any other name (what to call addHandlersAndSink)

2008-10-07 Thread Emily Crutcher
On Tue, Oct 7, 2008 at 11:30 AM, Ray Ryan [EMAIL PROTECTED] wrote:



 On Tue, Oct 7, 2008 at 10:51 AM, Emily Crutcher [EMAIL PROTECTED] wrote:



 Would it be typical to addHandler() for a DOM event and *not* want to
 sink? If so, then it makes more sense for the names to be uniform, perhaps
 even left as is.


 It would typically be the case that you would want to sink, however this
 is not always true, so we want users to have the option of whether to sink
 or not.


 addDomHandlerAndSink()?


I'm worried people might not realize  that they can add dom handlers using
addHandler as well.






 While we're talking about names, the term key as in event key sounds
 confusingly like key as in my keyboard has keys. Perhaps there's another
 term?


 Here are some random suggestions to see if they spark others:

1. Type/TYPE --  addHandler(ClickEvent.TYPE, handler)
2. Meta/meta -- addHandler(ClickEvent.meta, handler)
3.  Info/INFO -- addHandler(ClickEvent.INFO, handler)

 +1 for type. It's a shame you can't just use the class literal

ClickEvent.type or ClickEvent.TYPE?





 On Mon, Oct 6, 2008 at 5:36 PM, Emily Crutcher [EMAIL PROTECTED] wrote:

 Here is the current doc on it, to give context:

   /**
* Adds a native event handler to the widget and sinks the
 corresponding
* native event.
*
* @param HandlerType the type of handler to add
* @param key the event key
* @param handler the handler
* @return [EMAIL PROTECTED] HandlerRegistration} used to remove the 
 handler
*/
   protected HandlerType extends EventHandler HandlerRegistration
 addHandlerAndSink(
   DomEvent.Key?, HandlerType key, final HandlerType handler) {
 sinkEvents(key.getNativeEventType());
 return addHandler(key, handler);

   }

 On Mon, Oct 6, 2008 at 5:35 PM, Emily Crutcher [EMAIL PROTECTED] wrote:

 The purpose of the new method addHandlersAndSink is to allow users to
 add a DOM handler and sink the necessary event in one easy step.

 The reason we, the GWT team, care about this is because traditionally,
 with the two call separated everyone, including us, will tend to sink the
 events in the constructor rather then when a handler is actually added. 
 This
 can degrade performance significantly for small widgets, so we'd like to
 encourage our developers to do the fast/efficient thing instead.

 addHandlersAndSink has the advantage that when you autocomplete to find
 your widget methods, it appears directly under addHandlers.  However, it
 sounds somewhat awkward, so a better name might be in order, hence this
 post...





 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't




 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't








 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't




 



-- 
There are only 10 types of people in the world: Those who understand
binary, and those who don't

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



[gwt-contrib] Re: A rose by any other name (what to call addHandlersAndSink)

2008-10-07 Thread Ray Ryan
On Tue, Oct 7, 2008 at 11:36 AM, Emily Crutcher [EMAIL PROTECTED] wrote:



 On Tue, Oct 7, 2008 at 11:30 AM, Ray Ryan [EMAIL PROTECTED] wrote:



 On Tue, Oct 7, 2008 at 10:51 AM, Emily Crutcher [EMAIL PROTECTED] wrote:



 Would it be typical to addHandler() for a DOM event and *not* want to
 sink? If so, then it makes more sense for the names to be uniform, perhaps
 even left as is.


 It would typically be the case that you would want to sink, however this
 is not always true, so we want users to have the option of whether to sink
 or not.


 addDomHandlerAndSink()?


 I'm worried people might not realize  that they can add dom handlers using
 addHandler as well.


I'd think JavaDoc can take care of that. This name makes it clear that this
is the preferred way to deal with Dom handlers (and that it's irrelevant to
other kinds), and the doc can provide the fine print.








 While we're talking about names, the term key as in event key sounds
 confusingly like key as in my keyboard has keys. Perhaps there's 
 another
 term?


 Here are some random suggestions to see if they spark others:

1. Type/TYPE --  addHandler(ClickEvent.TYPE, handler)
2. Meta/meta -- addHandler(ClickEvent.meta, handler)
3.  Info/INFO -- addHandler(ClickEvent.INFO, handler)

 +1 for type. It's a shame you can't just use the class literal

 ClickEvent.type or ClickEvent.TYPE?


If it's a constant, it should be upper.







 On Mon, Oct 6, 2008 at 5:36 PM, Emily Crutcher [EMAIL PROTECTED] wrote:

 Here is the current doc on it, to give context:

   /**
* Adds a native event handler to the widget and sinks the
 corresponding
* native event.
*
* @param HandlerType the type of handler to add
* @param key the event key
* @param handler the handler
* @return [EMAIL PROTECTED] HandlerRegistration} used to remove the 
 handler
*/
   protected HandlerType extends EventHandler HandlerRegistration
 addHandlerAndSink(
   DomEvent.Key?, HandlerType key, final HandlerType handler) {
 sinkEvents(key.getNativeEventType());
 return addHandler(key, handler);

   }

 On Mon, Oct 6, 2008 at 5:35 PM, Emily Crutcher [EMAIL PROTECTED] wrote:

 The purpose of the new method addHandlersAndSink is to allow users
 to add a DOM handler and sink the necessary event in one easy step.

 The reason we, the GWT team, care about this is because traditionally,
 with the two call separated everyone, including us, will tend to sink the
 events in the constructor rather then when a handler is actually added. 
 This
 can degrade performance significantly for small widgets, so we'd like to
 encourage our developers to do the fast/efficient thing instead.

 addHandlersAndSink has the advantage that when you autocomplete to
 find your widget methods, it appears directly under addHandlers.  
 However,
 it sounds somewhat awkward, so a better name might be in order, hence 
 this
 post...





 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't




 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't








 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't








 --
 There are only 10 types of people in the world: Those who understand
 binary, and those who don't

 


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



[gwt-contrib] Re: RR: make PopupPanels stay on the screen, even in RTL situations

2008-10-07 Thread Rajeev Dayal
Thanks for keeping us honest, Ray! Alex and I will add a test for this
behavior to DialogBoxTest and reply back on this thread with the code
review.

On Tue, Oct 7, 2008 at 11:26 AM, Ray Ryan [EMAIL PROTECTED] wrote:

 Shouldn't there be a change to PopupTest to go along with this?

 On 10/7/08, Alex Rudnick [EMAIL PROTECTED] wrote:
 
  Hey Rajeev :)
 
  Thanks for the quick review!
 
  Responses inline.
 
  On Mon, Oct 6, 2008 at 7:08 PM, Rajeev Dayal [EMAIL PROTECTED] wrote:
  DialogBox.java
  199: Spelling: sceen -- screen
  OK
 
  243: @Overrides on an a method that implements an interface only works
 in
  Java 1.6. While GWT on the the trunk currently support JDK 1.6, the code
  base still compiles under GWT 1.5. If this change goes in, then GWT will
  no
  longer be able to compile under JDK 1.5. Let's get rid of the
 annotation.
  OK
 
  245: Do you need to recompute clientLeft and clientTop on window resize?
  Can
  these change based on a window resize?
 
  I don't think they can change on resize. For example, in RTL mode for
  IE, clientLeft is the width of a scrollbar.
 
  General:
  I did some testing and it looks good. Dragging in IE6 in RTL mode is
 still
  somewhat odd with the jumpiness, but workable. I wonder if we could
  improve
  RTL dragging in general in IE6/IE7. It might be worth filing a bug for.
 If
  I
  had to suspect something, it might be the use of CSS expressions and a
  hidden IFRAME to prevent scrollbar shine-through. This isn't needed in
  IE7,
  as they've fixed this at the rendering level, so it might be worth
  exploring
  at least an improvement for IE7 at some point.
  After addressing the above nits, feel free to hit the commit switch.
 
  Committed r3724, put in issue 2957.
 
  --
  Alex Rudnick
  swe, gwt, atl
 
   
 


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



[gwt-contrib] Code Review: gwt-google-apis gears fix typo in method name.

2008-10-07 Thread Eric Ayers
Hi Miguel,

This patch addresses issue 183, a typo in a method name:

http://code.google.com/p/gwt-google-apis/issues/detail?id=183

I renamed the method in the library class and updated the test.

M  test/com/google/gwt/gears/client/localserver/LocalServerTest.java
M
src/com/google/gwt/gears/client/localserver/ResourceStoreUrlCaptureHandler.java
-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

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

Index: src/com/google/gwt/gears/client/localserver/ResourceStoreUrlCaptureHandler.java
===
--- src/com/google/gwt/gears/client/localserver/ResourceStoreUrlCaptureHandler.java	(revision 869)
+++ src/com/google/gwt/gears/client/localserver/ResourceStoreUrlCaptureHandler.java	(working copy)
@@ -52,7 +52,7 @@
  * 
  * @return codetrue/code if the capture succeeded
  */
-public native boolean isSucceess() /*-{
+public native boolean isSuccess() /*-{
   return this.success;
 }-*/;
   }
Index: test/com/google/gwt/gears/client/localserver/LocalServerTest.java
===
--- test/com/google/gwt/gears/client/localserver/LocalServerTest.java	(revision 869)
+++ test/com/google/gwt/gears/client/localserver/LocalServerTest.java	(working copy)
@@ -82,7 +82,7 @@
 assertFalse(ls.canServeLocally(requestedURL));
 rs.capture(new ResourceStoreUrlCaptureHandler() {
   public void onCapture(ResourceStoreUrlCaptureEvent event) {
-assertTrue(event.isSucceess());
+assertTrue(event.isSuccess());
 assertEquals(requestedURL, event.getUrl());
 try {
   assertTrue(ls.canServeLocally(requestedURL));


[gwt-contrib] Re: data binding framework for GWT

2008-10-07 Thread Ian Petersen

Hi Arthur,

On Tue, Oct 7, 2008 at 1:51 PM, Arthur Kalmenson [EMAIL PROTECTED] wrote:
 I don't mean to nitpick, but it's actually the editor that puts back
 the previous value, not the converter.  The converter just throws a
 ConversionException if the String couldn't be converted.  It's up to
 the editor to decide what to do with the ConversionException.

 Ah, sorry, I misunderstood how it was working. Thanks for clearing
 that up. This also deals with the original use case I proposed above
 (not updating the model right away). I only thought of that case
 because it kept trying to convert and reverting the field to it's
 previous value, which prevented validation from running its course.
 I'll just create my own editor and leave the field the way it was.

I read your comment on issue 343
(http://code.google.com/p/google-web-toolkit/issues/detail?id=343#c31).
 I haven't finished reading the Bean Validation JSR yet, and I haven't
looked at Chris Ruffalo's code, but I have dipped my toe into using
Hibernate validation in my own server-side code.  I *think* validation
could be tied into the data binding framework in a pretty
straightforward way by extending EditorT and ViewerT to be
validation-aware.

At the moment, ViewerT and EditorT just provide simple interfaces
to view (and edit) a value of type T.  If there was some way to talk
about the validity of a given value, ViewerT (and, by extension,
EditorT) could be extended to provide feedback to the user when the
value it's displaying changes from invalid to valid or valid to
invalid.

I assume that Hibernate validation-style validation requires some kind
of validation service that is external to the beans being validated.
 (As opposed to the beans themselves somehow performing validation and
reporting the results.)  If that's the case, a BoundField could listen
to its editor for EditorChangeEvents and filter the new value through
validation before/after/around updating the related bean.  If you
perform validation at that time, you have access to the editor that
changed, the bean that's (in)valid, the property that's (in)valid, and
the validation state.  You could probably give very rich feedback to
the user about that particular property, and there are a number of
rational ways to handle an invalid value.  Handling multi-property
validation is a little more complex but, assuming the validation
service can provide enough feedback, the bound field may be able to
co-ordinate with its containing BoundForm to manage the related
fields, or it could just punt and disallow the field change that
prompted the switch from valid to invalid, depending on what works in
context.  As for validation events that happen behind the scenes,
perhaps bound fields could somehow observe the validation service
using their knowledge of bean type and property name.

I think data binding and validation probably need to be aware of each
other (or, at least, data binding needs to be aware of validation),
but I think they're separate concerns.  To me, data binding is just a
way of automating the display and update of a bean's properties via
some widgets.  Validation, on the other hand, is a way of making sure
that a property is within some bounds, or some combination of
properties together follow some rules.  Data binding impacts
validation because the user could transform a bean into or out of a
valid state, and validation impacts data binding because you usually
need to give the user feedback about the validity of the bean being
edited, but I think the relationship between data binding and
validation is probably best mediated through a thin interface that
keeps things loosely coupled.

What do you think?  (Or anyone else, for that matter.)

 Ian, I think this data binding framework is really excellent. It's
 really well thought out and I think it'll be a major contribution to
 GWT. I hope it makes it into the incubator soon. Thanks for your hard
 work.

Thank you for the compliments and for taking the time to look into the
code and come up with questions and concerns--I'm sure you'll find
more as you dig deeper.

Ian

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



[gwt-contrib] [google-web-toolkit commit] r3726 - changes/jat/oophm-branch/dev/core/src/com/google/gwt/dev/util/log

2008-10-07 Thread codesite-noreply

Author: [EMAIL PROTECTED]
Date: Tue Oct  7 15:35:36 2008
New Revision: 3726

Modified:
 
changes/jat/oophm-branch/dev/core/src/com/google/gwt/dev/util/log/SwingLoggerPanel.java

Log:
Don't display stubbed-out filtering controls.


Modified:  
changes/jat/oophm-branch/dev/core/src/com/google/gwt/dev/util/log/SwingLoggerPanel.java
==
---  
changes/jat/oophm-branch/dev/core/src/com/google/gwt/dev/util/log/SwingLoggerPanel.java
  
(original)
+++  
changes/jat/oophm-branch/dev/core/src/com/google/gwt/dev/util/log/SwingLoggerPanel.java
  
Tue Oct  7 15:35:36 2008
@@ -266,39 +266,44 @@
}
  });
  topPanel.add(collapsButton);
-topPanel.add(new JLabel(Filter Log Messages: ));
-levelComboBox = new JComboBox();
-for (TreeLogger.Type type : TreeLogger.Type.instances()) {
-  if (type.compareTo(maxLevel)  0) {
-break;
+if (true) {
+  // temporarily avoid showing parts that aren't implemented.
+  topPanel.add(new JLabel(Log filtering controls will go here));
+} else {
+  topPanel.add(new JLabel(Filter Log Messages: ));
+  levelComboBox = new JComboBox();
+  for (TreeLogger.Type type : TreeLogger.Type.instances()) {
+if (type.compareTo(maxLevel)  0) {
+  break;
+}
+levelComboBox.addItem(type);
}
-  levelComboBox.addItem(type);
+  levelComboBox.setEditable(false);
+  levelComboBox.setSelectedIndex(levelComboBox.getItemCount() - 1);
+  topPanel.add(levelComboBox);
+  levelComboBox.addActionListener(new ActionListener() {
+public void actionPerformed(ActionEvent e) {
+  setLevelFilter((TreeLogger.Type)  
levelComboBox.getSelectedItem());
+}
+  });
+  regexField = new JTextField(20);
+  topPanel.add(regexField);
+  JButton applyRegexButton = new JButton(Apply Regex);
+  applyRegexButton.addActionListener(new ActionListener() {
+public void actionPerformed(ActionEvent e) {
+  setRegexFilter(regexField.getText());
+}
+  });
+  topPanel.add(applyRegexButton);
+  JButton clearRegexButton = new JButton(Clear Regex);
+  clearRegexButton.addActionListener(new ActionListener() {
+public void actionPerformed(ActionEvent e) {
+  regexField.setText();
+  setRegexFilter();
+}
+  });
+  topPanel.add(clearRegexButton);
  }
-levelComboBox.setEditable(false);
-levelComboBox.setSelectedIndex(levelComboBox.getItemCount() - 1);
-topPanel.add(levelComboBox);
-levelComboBox.addActionListener(new ActionListener() {
-  public void actionPerformed(ActionEvent e) {
-setLevelFilter((TreeLogger.Type) levelComboBox.getSelectedItem());
-  }
-});
-regexField = new JTextField(20);
-topPanel.add(regexField);
-JButton applyRegexButton = new JButton(Apply Regex);
-applyRegexButton.addActionListener(new ActionListener() {
-  public void actionPerformed(ActionEvent e) {
-setRegexFilter(regexField.getText());
-  }
-});
-topPanel.add(applyRegexButton);
-JButton clearRegexButton = new JButton(Clear Regex);
-clearRegexButton.addActionListener(new ActionListener() {
-  public void actionPerformed(ActionEvent e) {
-regexField.setText();
-setRegexFilter();
-  }
-});
-topPanel.add(clearRegexButton);
  add(topPanel, BorderLayout.NORTH);
  root = new DefaultMutableTreeNode();
  treeModel = new DefaultTreeModel(root);

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