Re: Java 7

2013-04-02 Thread Max Völkel
How well does this play together with AppEngine 1.7.7? From their release 
notes: "The Java runtime now defaults to Java7. If you still need to use 
the Java6
  runtime, please use the --use_java6 flag when deploying your app. We 
encourage
  you to move to Java7 as soon as possible."

It sounds I should compile for a 1.7 target. So I should *not* set 
maven.compiler.source to 1.6, right?

I hope AppEngine and GWT remain compatible. Do you know more on this?

On Thursday, February 21, 2013 2:55:24 PM UTC+1, Thomas Broyer wrote:
>
>
>
> On Thursday, February 21, 2013 1:32:44 PM UTC+1, Seamus McMorrow wrote:
>>
>> Hi, 
>>
>> Sorry for resurrecting a slightly old thread. 
>> JDK 1.6 is EOL end of this month, so I am thinking of migrating my GWT 
>> project to JDK7
>>
>> I am using GWT 2.5, and wondering if many people are using JDK7 in their 
>> GWT projects. Is it okay to do so and if so, what are the gotchas?
>>>
>>>
>
> GWT 2.5 is fully compatible with JDK 7 (see 
> https://developers.google.com/web-toolkit/release-notes#Release_Notes_2_5_0_RC2
> ).
> Just make sure you only use Java 6 constructs in your client code (in 
> Eclipse, Project properties → Java Compiler, set “JDK Compliance” to 1.6; 
> in Maven, set “maven.compiler.source” and “maven.compiler.target” to 1.6 or 
> 6).
>

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




Re: How to embed HTML from TextResource using UiBinder

2013-04-02 Thread Thomas Broyer


On Wednesday, April 3, 2013 12:34:06 AM UTC+2, Pat wrote:
>
> I found something that works, even though I think that should be possible 
> with less glue code...
>

It should be possible to create a SafeHtmlResource, that could validate the 
content of the resource at build-time.
Otherwise, your solution below is the only one I could think about.
 

> interface TextsBundle extends ClientBundle { @Source("text.txt") 
> TextResource myText(); }
>
> class SafeHtmlTexts { 
>   @Inject TextBundle texts;
>   public SafeHtml myText() { return 
> SafeHtmlUtils.fromSafeConstant(texts.myText().getText()); }
> }
>
> class ViewImpl {
>   private final SafeHtmlTexts texts;
>   @Inject public ViewImpl(..., SafeHtmlTexts texts) { this.texts = texts; 
> ... }
>   ...
>   @UiFactory SafeHtmlTexts create() { return texts; }


You could simply use a @UiField for 'texts' rather than the @UiFactory. If 
you want the SafeHtmlTexts to be provided (by GIN apparently), use 
@UiField(provided=true) (and you can then have your field 'final').
 

> }
>
> ViewImpl.ui.xml:
>   
>   ...
>   
>

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




Re: How to embed HTML from TextResource using UiBinder

2013-04-02 Thread Pat
I found something that works, even though I think that should be possible 
with less glue code...

interface TextsBundle extends ClientBundle { @Source("text.txt") 
TextResource myText(); }

class SafeHtmlTexts { 
  @Inject TextBundle texts;
  public SafeHtml myText() { return 
SafeHtmlUtils.fromSafeConstant(texts.myText().getText()); }
}

class ViewImpl {
  private final SafeHtmlTexts texts;
  @Inject public ViewImpl(..., SafeHtmlTexts texts) { this.texts = texts; 
... }
  ...
  @UiFactory SafeHtmlTexts create() { return texts; }
}

ViewImpl.ui.xml:
  
  ...
  


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




Re: Literal Array Creation in JSNI

2013-04-02 Thread tomsn
Hallo Thomas,

thank you for the answer! Was able to fix the problem by adapting the 
Rickshaw code.

(For anyone interested in how, please see the issue description in Rickshaw 
repository on Github - here
)

Best regards
tomsn


Am Donnerstag, 28. März 2013 23:02:55 UTC+1 schrieb Thomas Broyer:
>
>
>
> On Thursday, March 28, 2013 8:08:14 PM UTC+1, tomsn wrote:
>>
>> Hallo,
>>
>> within my GWT Application I try to execute the following method:
>>
>> @Override 
>> public native void drawChart(Element parent)/*-{ 
>> var series = [{ 
>> data: [ { x: 0, y: 40 }, { x: 1, y: 49 } ], 
>> color: 'steelblue', 
>> name: 'Dataset_1' 
>> }]; 
>> var graph = new $wnd.Rickshaw.Graph( { 
>> element: parent, 
>> width: 600, 
>> height: 200, 
>> series: series, 
>> renderer: 'bar' 
>> }); 
>> graph.render(); 
>> }-*/; 
>>
>> The series array initialized at the beginning of the implementation is 
>> passed to the Rickshaw.Graph constructor.
>> The Rickshaw module tests whether the input object *series *is of *type 
>> Array* and - *fails*.
>>
>>  if (!(series instanceof Array)) throw 
>>
>> I have no explanation for that behavior. I thought it's native JavaScript 
>> code, executed within the browser, so that there should be 
>> no difference. But indeed, the array created in the method above does not 
>> pass that instanceof check.
>>
>>
> GWT code runs in an iframe, so its Array is not the same as the Array in 
> $wnd, which is why "instanceof Array" fails.
> Rickshaw.Graph is simply broken.
> See 
> https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/isArray
>  and 
> http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/
>
>

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




How to embed HTML from TextResource using UiBinder

2013-04-02 Thread Pat
Embedding plain text from a TextResource using UiBinder is no problem at 
all:

In my .ui.xml I have: 

and: 


In mypackage.MyBundle extends ClientBundle: 
@Source("myText.txt")
TextResource myText();

and of course the myText.txt with the text to be embedded.

I know there is a  in order to embed HTML without escaping 
anything. But somehow I missed the link how to get a SafeHtml from a 
TextResource.

Can anyone provide the missing piece?

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




Re: clear browser cache automatically?

2013-04-02 Thread Jens


> What is the impact performance wise?
>
Probably the same as if you would add a new if statement to any of your 
servlets. Just test it in your development environment if you are concerned 
about it.

We dont do it via a filter as we serve our static content from dedicated 
web servers. So we configured them to add no-cache headers.

-- J.

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




Re: clear browser cache automatically?

2013-04-02 Thread Alexandre Joyal
What is the impact performance wise?
Le 2 avr. 2013 13:38, "Jens"  a écrit :

> The filter will be executed when the url-pattern matches. The example uses
> "/*" as url-pattern which matches all URLs so it will always be executed.
>
> -- J.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/zToxfg1Rp-o/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: clear browser cache automatically?

2013-04-02 Thread Jens
The filter will be executed when the url-pattern matches. The example uses 
"/*" as url-pattern which matches all URLs so it will always be executed.

-- J.

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




Re: clear browser cache automatically?

2013-04-02 Thread JoyaleXandre
I had the exact same problem this morning and a few other times. If I 
understand well the Stack Overflow solution, I only have to add a filter in 
my code and link to it in my web.xml file?
Will it be called automatically or do I need to do something else?

Le lundi 1 avril 2013 10:18:33 UTC-4, Jens a écrit :
>
> http://stackoverflow.com/questions/4274053/how-to-clear-cache-in-gwt
>
> -- J.
>

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




Re: GWT UI widgets auto-alignment inside different Panels proper solution needed.

2013-04-02 Thread Jens
Why dont you extend the GWT classes and give them your desired default 
values? E.g. instead of HorizontalPanel you would create a 
"CenteredContentPanel" that extends HorizontalPanel and sets its own size 
to 100% along with the desired alignment?

Alternatively you can also look at @UiChild for custom widgets if you want 
to define some "slots" in your custom widget that you want to fill using 
UiBinder tags. Using @UiChild you could do something like


  
 
  


class CustomWidget .. {
  @UiChild
  public void addLeftAligned(Widget w) {
leftAlignedContainer.add(w);
  }
  ..
}

http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/uibinder/client/UiChild.html

Or as already mentioned, create some common CSS and apply the CSS class to 
the HorizontalPanel.

-- J.

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




Re: GWT UI widgets auto-alignment inside different Panels proper solution needed.

2013-04-02 Thread BM
I am just worried about depending on a third party library and loosing 
support from actual Google. So with new updates to GWT, things won't be 
compatible for immediate upgrade or we would need to wait for this Twitter 
Bootstrap to update and compatible with every new GWT. 

On Monday, April 1, 2013 11:26:29 AM UTC-5, subhro wrote:
>
> "...handle consistently looking GWT forms"=> Twitter bootstrap gives 
> a very consistent lnf to forms.
>
>
> For html based "templates" try this concept from a larger framework-Errai.
> https://docs.jboss.org/author/display/ERRAI/Errai+UI
>
>
>
>
>
>
> On Mon, Apr 1, 2013 at 9:00 PM, BM >wrote:
>
>> Interesting. Thanks for that. Is it compatible with GWT 2.5? 
>>
>> What my real goal is to have global way to handle consistently looking 
>> GWT forms on UI binder for each different GWT Views. 
>>
>> Since you worked on it, would love to see if you have further explanation 
>> on the example I gave how can this get incorporated.. 
>>
>> Thanks again.
>>
>> On Monday, April 1, 2013 10:06:08 AM UTC-5, subhro wrote:
>>>
>>> i had sorted these issues by using 
>>> http://gwtbootstrap.github.**com/ 
>>>
>>> Basically letting the CSS do the aligning. 
>>>  
>>> its dependent on your app of-course!
>>>
>>> HTH,
>>> Subhro.
>>>
>>>
>>>
>>> On Mon, Apr 1, 2013 at 8:04 PM, BM  wrote:
>>>
 We use GWT inside every other panels like VerticalPanel, 
 HorizontalPanel, DockLayoutPanel, etc.

 The thing I feel it is cumbersome in assigning alignment (both 
 horizontal and vertical) for each elements in those panels. 

 One way is :
 >>> horizontalAlignment="ALIGN_**CENTER" verticalAlignment="ALIGN_**
 MIDDLE">
 Hello Center
 

 
 The problem is that if we have several UI binder template files, this 
 get hard-coded inside the XML file. Plus if there is a pretty good chance 
 of forgetting to apply alignment when we are dealing with several template 
 files.

 I would like to have a better way to create my UI through UI Binder by 
 having alignment center and middle already taken care of. Some kind of 
 template wherein I can just insert GWT UI elements (Textbox, Radio, 
 Checkboxes, ListBox, etc) and labels. Since our views can use 
 DockLayoutPanel, Or HorizontalPanel and VerticalPanel inside 
 DockLayoutPanel, there is no constant source of template how all my UI 
 (basically UI entry form) should look like consistently)


 One way I thought would be to use custom CellPanel (Not Cell List) but 
 not sure if it is the best way.

 xmlns:i="urn:import:com.**project.client.widgets.input"
 
 
 Hello Center
 

 
 
 

 

 Where properAlignmentCell extends Cell and it contains 
 horizontalAlignment="**ALIGN_CENTER" verticalAlignment="ALIGN_**MIDDLE" 
 declared inside programmatically. 

 What other ways anyone can recommend? 



  -- 
 You received this message because you are subscribed to the Google 
 Groups "Google Web Toolkit" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to google-web-toolkit+**unsubscr...@googlegroups.com.
 To post to this group, send email to google-we...@**googlegroups.com.
 Visit this group at http://groups.google.com/**
 group/google-web-toolkit?hl=en
 **.
 For more options, visit 
 https://groups.google.com/**groups/opt_out
 .
  
  

>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Web Toolkit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to 
>> google-we...@googlegroups.com
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

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




Re: Complex JSON and overlay types

2013-04-02 Thread sebastien . ribeil
Thank you for your answers.
 
- Thomas:
Yes, it works. But the problem is that I don't know John. It can be 
anything else. For example the JSON can be: *{"records": [{"names": 
{"Cedric": ["50", "H", "US"], "Jean": ["50", "H", "US"]}, "style": "TR"}]} *or 
{"records": *[{"names": {"Blabla": ["50", "H", "US"]}, "style": "TR"}]}. *To 
get the lists, I have to get the names first. And I don't know how to do.
 
- Stefan:
I try to do that but I get *null *even for *bean.as().getStyle().* I don't 
understand how this method can get the properties..
*interface Message {
   List getRecords();
 }*
*interface Person {
  Map> getNames();
   String getStyle();
 }*
* // Declare the factory type
 interface MyFactory extends AutoBeanFactory {
   AutoBean message();
   AutoBean person();
 }*

*public class HelloWorld implements IsWidget,EntryPoint {
 
 
  public Widget asWidget() {
   String url="data.json";
   RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, 
url); 
 try {
   Request response = builder.sendRequest(null, new RequestCallback() {
 public void onError(Request request, Throwable exception) {
   // Code omitted for clarity
 }*
* public void onResponseReceived(Request request, Response 
response) {
   MyFactory factory = GWT.create(MyFactory.class);
   
  AutoBean bean = AutoBeanCodex.decode(factory, 
Person.class, response.getText());
  
  System.out.println("oui "+ bean.as().getNames());
  *
* }*
*   });
 } catch (RequestException e) {
 }
  return null;
  
   }*

*@Override
public void onModuleLoad() {
 
 asWidget();
}
 
}
*

Le mardi 2 avril 2013 04:00:02 UTC-4, Thomas Broyer a écrit :
>
>
>
> On Monday, April 1, 2013 5:51:26 PM UTC+2, sebastie...@isen-lille.frwrote:
>>
>> Thank you for your answer. If I do that: 
>>  
>> *public final native JsArray getTest()
>>  /*-{
>>  return this.records[0].names.John;
>>  }-*/;*
>> *
>>   *I get *50,H,US, *so it's OK for that. But I'm not supposed to know 
>> "John" or "Jack", so how can I get them?
>>
>
> Does *this.records[0].names["John"]* works? If so, there shouldn't be any 
> problem replacing the "John" with a method argument.
>

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




Re: Get mouse position in Canvas on keyPress?

2013-04-02 Thread Jens
You could probably track the mouse movement globally in your app and 
remember its position somewhere.

-- J.

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




CellTable Multiselction Model with Checkbox and Onclick

2013-04-02 Thread Dominic Warzok
Hey, 

I'm trying to implement a CellTable where you can click on checkboxes to 
select some rows and you should also can Crlt + click on the cells to 
select some rows. 

But that doesn't work :(. 

I am able to implement the checkboxes oder the clicks but not both 
together. 

Does anyone knows a way to do that?

Thanks in advance. 

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




Re: Guava Iterators not working?

2013-04-02 Thread membersound
OK, but that's not very suitable as this would return a ArrayList, 
but I'd need a List to be returned of course, otherwise it would not 
make sense to filter on a specific instance.
So probably I cannot use Guava here...

Am Dienstag, 2. April 2013 11:07:37 UTC+2 schrieb Thomas Broyer:
>
>
> On Tuesday, April 2, 2013 10:49:55 AM UTC+2, membersound wrote:
>>
>> Hi,
>>
>> I'm trying to use Guava on the client side. But I'm getting errors for 
>> both Iterators and Iterables.
>> Whereas Iterables.filter() is annotated with @GwtIncompatible, but 
>> Iterators is not, so should be supported.
>>
>> class Base;
>> class Foo extends Base;
>>
>> List list;
>> Lists.newArrayList(Iterators.filter(list.iterator(), Foo.class));
>> Lists.newArrayList(Iterables.filter(list, Foo.class));
>>
>> The method filter(Iterator, Predicate) in the type 
>> Iterators is not applicable for the arguments (Iterator, Class)
>>
>
> filter(Iterator,Class) is not supported in GWT: 
> http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/collect/Iterators.html#filter(java.util.Iterator,
>  
> java.lang.Class)
>
> You have to use filter(Iterator,Predicate) with a predicate that uses the 
> "instanceof" operator:
>
> x = Lists.newArrayList(Iterables.filter(list, new Predicate() {
>   @Override
>   public boolean apply(@Nullable Base input) {
> return input instanceof Foo;
>   }
> }));
>

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




Get mouse position in Canvas on keyPress?

2013-04-02 Thread membersound
Hi,

on a MouseDownEvent it is easy to get the mouse coordinates 
like:evt.getRelativeX(canvas.getElement());

But what about a KeyDownEvent? How can I get the current mouseXY on a 
KeyEvent, as this does of course not provide a evt.getRelativeX()...

Thanks

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




Re: Create log file

2013-04-02 Thread Jens
You would need to send your client log to the server where it can be logged 
into a file. 

GWT emulates a subset of java.util.logging: 

https://developers.google.com/web-toolkit/doc/latest/DevGuideLogging
http://stackoverflow.com/questions/5812035/setup-a-remoteloggingservlet-in-gwt

-- J.

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




Create log file

2013-04-02 Thread Crease
Hi,

I had created an app GWT, but I want to create "log" for debug my code. I 
want to have a log file where it leave all trace and after I can open this 
file with some text editor.

Can somebody help me? Does somebody have some examples?

Thanks. 

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




Re: Guava Iterators not working?

2013-04-02 Thread Thomas Broyer

On Tuesday, April 2, 2013 10:49:55 AM UTC+2, membersound wrote:
>
> Hi,
>
> I'm trying to use Guava on the client side. But I'm getting errors for 
> both Iterators and Iterables.
> Whereas Iterables.filter() is annotated with @GwtIncompatible, but 
> Iterators is not, so should be supported.
>
> class Base;
> class Foo extends Base;
>
> List list;
> Lists.newArrayList(Iterators.filter(list.iterator(), Foo.class));
> Lists.newArrayList(Iterables.filter(list, Foo.class));
>
> The method filter(Iterator, Predicate) in the type Iterators 
> is not applicable for the arguments (Iterator, Class)
>

filter(Iterator,Class) is not supported in GWT: 
http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/collect/Iterators.html#filter(java.util.Iterator,
 
java.lang.Class)

You have to use filter(Iterator,Predicate) with a predicate that uses the 
"instanceof" operator:

x = Lists.newArrayList(Iterables.filter(list, new Predicate() {
  @Override
  public boolean apply(@Nullable Base input) {
return input instanceof Foo;
  }
}));

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




Re: Guava Iterators not working?

2013-04-02 Thread Jens
Iterators/Iterables.filter(..., Class type) methods are both 
incompatible to GWT as both implementations use Class.isInstance() which is 
not emulated by GWT.

All you can use is the Iterators/Iterables.filter(..., Predicate 
predicate) version.

-- J.

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




Re: Replacing classes during custom serialization

2013-04-02 Thread Thomas Broyer


On Sunday, March 31, 2013 10:49:07 PM UTC+2, Jeff Schnitzer wrote:
>
> When doing custom serialization, is it possible to swap out one class 
> for another? 
>
> This would fix a _lot_ of problems using Objectify's Ref and Key 
> client-side, including, I think, being able to instantiate Refs and 
> Keys intelligently. 
>
> But I have an immediate problem I'm trying to fix - which is that 
> Ref is a class hierarchy on the server side, but I'd really like to 
> simplify this to a single concrete Ref class client-side.  So even 
> though the sever might return StdRef or NullRef, these should be 
> converted to a simplified, concrete Ref on the client side. 
>
> Is this possible?  It would be even better if I could somehow just 
> define one custom serializer that handles all Ref subclasses instead 
> of having to make separate custom serializers for each.
>

I don't think it's possible, because the type signature is written 
independently from the custom serializers, so serializing a StdRef on the 
server-side will put the StdRef type signature in the stream, to be decoded 
on the client-side.
You can however just make StdRef and NullRef "super-source" classes that 
simply inherit from Ref without adding anything, and have their respective 
custom serializers call the Ref_CustomFieldSerializer methods (at least for 
the client-side implementation)

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




Re: Replacing classes during custom serialization

2013-04-02 Thread Thomas Broyer


On Sunday, March 31, 2013 11:14:28 PM UTC+2, Jeff Schnitzer wrote:
>
> As a second question, is there any document anywhere which describes 
> how custom serializers actually work?


I don't think so; at least not outside Google.
There's 
https://docs.google.com/document/d/1eG0YocsYYbNAtivkLtcaiEE5IOF5u4LUol8-LL0TIKU/edit
 
about GWT-RPC serialization, but it's really light when it comes to custom 
serializers and simply defer to the DevGuide.
 

> The tiny section in 
> DevGuideServerCommunication is not helpful. Some basic questions: 
>
>  * Are custom serializers server-side only? Or do they get executed on 
> the client-side too?
>

Custom serializers are used on both sides (isn't this clear from the doc?). 
If you need different implementations for the client and server, you can 
either have a Ref_ServerCustomFieldSerializer or use super-sources 
(EnumMap and LinkedHashMap uses this, actually in addition to a 
ServerCustomFieldSerializer: the CustomFieldSerializer from "sources" is 
used in DevMode, the one from super-sources is annotated with 
@GwtScriptOnly and thus only used when compiled to JS, and the 
ServerCustomFieldSerializer is used on the server-side).

 * What's the relationship between the static methods and the instance 
> methods? I presume we have both for some sort of historical reason, 
> but can we get rid of the static methods? (last time I tried it didn't 
> work)
>

Actually, the static methods are used on client-side, while the instance 
methods are used on server-side (when they generally just defer to the 
static methods). Historically, custom serializers were only 
convention-based: must be named with the _CustomFieldSerializer suffix and 
have the serialize and deserialize static methods and optionally an 
instantiate static method. The CustomFieldSerializer interface was added in 
GWT 2.3, and the ServerCustomFieldSerializer added in GWT 2.5.0. The 
CustomFieldSerializer interface was added as an optimization, to avoid too 
much reflection at runtime on the server-side.

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




Guava Iterators not working?

2013-04-02 Thread membersound
Hi,

I'm trying to use Guava on the client side. But I'm getting errors for both 
Iterators 
and Iterables.
Whereas Iterables.filter() is annotated with @GwtIncompatible, but Iteratorsis 
not, so should be supported.

class Base;
class Foo extends Base;

List list;
Lists.newArrayList(Iterators.filter(list.iterator(), Foo.class));
Lists.newArrayList(Iterables.filter(list, Foo.class));

The method filter(Iterator, Predicate) in the type Iterators 
is not applicable for the arguments (Iterator, Class)

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




Re: gin field injection

2013-04-02 Thread Jens
Fields can only be injected after the class has been instantiated. Thus all 
injected fields are still null during constructor execution. Either 
refactor your code so you don't need to access the field right away in the 
constructor or use constructor injection instead. IMHO constructor 
injection pretty much always wins against field injection. This makes 
dependencies explicit and you can still use the class without any injection 
framework.

If you don't want to type all the "this.var = injectedVar" inside the 
constructor then first type your fields and then let your IDE generate the 
constructor.

-- J.

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




Re: Complex JSON and overlay types

2013-04-02 Thread Thomas Broyer


On Monday, April 1, 2013 5:51:26 PM UTC+2, sebastie...@isen-lille.fr wrote:
>
> Thank you for your answer. If I do that: 
>  
> *public final native JsArray getTest()
>  /*-{
>  return this.records[0].names.John;
>  }-*/;*
> *
>   *I get *50,H,US, *so it's OK for that. But I'm not supposed to know 
> "John" or "Jack", so how can I get them?
>

Does *this.records[0].names["John"]* works? If so, there shouldn't be any 
problem replacing the "John" with a method argument.

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




Offline/online Synchronisation

2013-04-02 Thread Tim Hill
Hi All,

I am attempting to write a new GWT application. One of the requirements for 
this is being able to use the app when not connected to the web. When the 
connection is restored, any changes are applied to the server from the client. 
This therefore means that there will need to be a copy of the server data 
maintained on the client. In addition, the application should sync back to the 
server every X minutes when in use. 

>From what I have read, I think it should be possible to do this using the 
>following:

> PHP on the server to interface with a MySQL database
> RestyGWT to make the calls to the server PHP and handle passing/receiving of 
> JSON

So first question is, is my understanding correct? If not, how would I be able 
to accomplish what I want to do?

However, if my understanding is correct, would someone be kind enough to a 
brief explanation/outline of how this would be accomplished as I am a bit of a 
GWT newbie and the stuff that I have found by my own searches has left me 
somewhat confused!

Many Thanks

Tim

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