World map implementation in GWT

2015-04-02 Thread mohit
Hi All,

I am trying to implement a world map in GWT using Maps API  ver. 3 where I 
can do:

1) Click a country/region and related info. be popped up.
2) Color a country/region based on let's say, population density.
3) Zoom in/out.


So, far I have managed to implement the world map with zoom functionality 
but I am not sure how to achieve the first two features listed above.

Currently I am also looking into Google's GeoChart API to achieve this and 
I just wanted to know if I am on right track or
there are some better options available that I should look into.

I'd highly appreciate if anyone of you guys share the code.

Best Regards,
Mohit 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


World map in Google Maps API V3 in GWT

2015-04-02 Thread mohit
Hi All,

I am trying to implement a world map in GWT using Maps API where I can do:

1) Click a country/region and related info. be popped up.
2) Color a country/region based on let's say, population density.


So, far I have managed to implement the world map but I am not sure how to 
achieve the two features listed above.

Currently I am looking into Google's GeoChart API to achieve this and I 
just wanted to know if I am on right track or
there are some better options available that I should look into.

I'd highly appreciate if anyone of you guys share the code.

Best Regards,
Mohit 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Any chance of an InterfaceGenerator overhaul to support GSS?

2015-04-02 Thread Abraham Lin
Good to hear! I've opened an issue for 
this: https://code.google.com/p/google-web-toolkit/issues/detail?id=9171

On Thursday, April 2, 2015 at 9:24:41 AM UTC-4, Julien Dramaix wrote:
>
> This is in my todo list and will be done for GWT 2.8 (where GSS will 
> become the default syntax). Feel free to open an issue in order to track 
> this.
>
> On Thursday, April 2, 2015 at 4:24:03 AM UTC+2, Abraham Lin wrote:
>>
>> The GWT distribution currently contains an InterfaceGenerator tool for 
>> generating CssResource interfaces from a CSS source file; however, this 
>> tool is still using the old Flute parser and thus does not support CSS3 
>> syntax.
>>
>> Is there any chance that this tool will be overhauled/ported to support 
>> GSS as part of GWT proper?
>>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with sending to server ValueProxy which contains List of EntityProxy after has been decode by AutoBeanCodex

2015-04-02 Thread Anton Mityagin
I think that I've found right way to de/serialize such proxy:

I must use RequestFactory.getSerializer instead of AutoBeanCodex.decodeInto/
AutoBeanCodex.encode

kind of

public static  F 
deserialize(RequestFactory requestFactory, Class clazz, String payload)
{
String[] parts = payload.split(":", 2);
ProxyStore store = new DefaultProxyStore(parts[1]);
ProxySerializer ser = requestFactory.getSerializer(store);
F filter = ser.deserialize(clazz, parts[0]);

return filter;
}

public static  String serialize(RequestFactory 
requestFactory, F filter)
{
DefaultProxyStore store = new DefaultProxyStore();
ProxySerializer ser = requestFactory.getSerializer(store);
final String key = ser.serialize(filter);
String payload = key + ":" + store.encode();

return payload;
}


 
this is right?

On Thursday, April 2, 2015 at 6:53:47 PM UTC+3, Anton Mityagin wrote:
>
>
> Hi
>
> Assume I have following ValueProxy
>
>
> @ProxyFor(value = MailFilter.class)
> public interface MailFilterProxy extends ValueProxy
> {
> String getQuery();
> 
> void setQuery(String query);
> 
> List getFrom();
> 
> void setFrom(List from);
> }
>
>
> User edits this proxy in some Editor. After this this 
> proxy encoded to payload by AutoBeanCodex:
>
> AutoBean bean = AutoBeanUtils.getAutoBean(mailFilter);
>
> String payload = AutoBeanCodex.encode(bean).getPayload();
>
>
> encoding FilterProxy to string is needs to get right URL for list of 
> MailProxy, somthing like #ml:f={encoded filter payload}
>
> and representation filter for list as ValueProxy to be able to use GWT 
> Editor & Driver framework (don't know right name of this functionality)
>
> Next, users goes to list place with new filter payload:
>
> getPlaceController().goTo(new ListPlace(MailProxy.class, payload)
>
>
> in list Activity I trying to decode this payload into MailFilterProxy:
>
> MailRequest request = getRequestFactory(); // some request for mails
>
> MailFilterProxy *filter *= request.create(MailFilterProxy.class);
>
> AutoBean bean = AutoBeanUtils.getAutoBean(filter);
>
> AutoBeanCodex.decodeInto(StringQuoter.split(getPlace().getFilterPayload()), 
> bean);
>
> *filter *= bean.as();
>
>
> next I trying to fire list request with new MailFilterProxy
>
> request.getList(*filter*).with(getWith()).fire(new 
> Receiver>(...));
>
>
> And I catch an exception:
>
> Unfrozen bean with null RequestContext
>
>
>
> This occurs because AutoBeanCodex uses MailRequestImpl_FactoryImpl for 
> creation of ContactProxy - list items, but not MailRequest 
> and it was not set any tags (REQUEST_CONTEXT_STATE, STABLE_ID)
>
> What I'm doing wrong? How to do it right or some workaround?
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Problem with sending to server ValueProxy which contains List of EntityProxy after has been decode by AutoBeanCodex

2015-04-02 Thread Anton Mityagin

Hi

Assume I have following ValueProxy


@ProxyFor(value = MailFilter.class)
public interface MailFilterProxy extends ValueProxy
{
String getQuery();

void setQuery(String query);

List getFrom();

void setFrom(List from);
}


User edits this proxy in some Editor. After this this 
proxy encoded to payload by AutoBeanCodex:

AutoBean bean = AutoBeanUtils.getAutoBean(mailFilter);

String payload = AutoBeanCodex.encode(bean).getPayload();


encoding FilterProxy to string is needs to get right URL for list of 
MailProxy, somthing like #ml:f={encoded filter payload}

and representation filter for list as ValueProxy to be able to use GWT 
Editor & Driver framework (don't know right name of this functionality)

Next, users goes to list place with new filter payload:

getPlaceController().goTo(new ListPlace(MailProxy.class, payload)


in list Activity I trying to decode this payload into MailFilterProxy:

MailRequest request = getRequestFactory(); // some request for mails

MailFilterProxy *filter *= request.create(MailFilterProxy.class);

AutoBean bean = AutoBeanUtils.getAutoBean(filter);

AutoBeanCodex.decodeInto(StringQuoter.split(getPlace().getFilterPayload()), 
bean);

*filter *= bean.as();


next I trying to fire list request with new MailFilterProxy

request.getList(*filter*).with(getWith()).fire(new 
Receiver>(...));


And I catch an exception:

Unfrozen bean with null RequestContext



This occurs because AutoBeanCodex uses MailRequestImpl_FactoryImpl for 
creation of ContactProxy - list items, but not MailRequest 
and it was not set any tags (REQUEST_CONTEXT_STATE, STABLE_ID)

What I'm doing wrong? How to do it right or some workaround?


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Deferred binding consultation

2015-04-02 Thread Thomas Broyer


On Thursday, April 2, 2015 at 3:08:11 PM UTC+2, Vic wrote:
>
> Wow, Thomas, thanks for response. When I changed generator implementation 
> to 
>
>
> *String className = packageName + "." + simpleName;*
> if (printWriter != null) {
>
> 
> className = composer.getCreatedClassName();
> }
> return className;
>
>
> it started to work as expected. Thank you very much. Sometimes GWT sticks 
> me up by its unpredictable behavior.  
>

"unpredictable" ?! GWT's behavior is in 99.9% of the cases very much 
predictable, sometimes "unexpected", but predictable.
In this case, it's in the javadoc: 
http://www.gwtproject.org/javadoc/latest/com/google/gwt/core/ext/Generator.html#generate(com.google.gwt.core.ext.TreeLogger,
 
com.google.gwt.core.ext.GeneratorContext, java.lang.String)

*Returns:*

the name of a subclass to substitute for the requested class, or return null
>  to cause the requested type itself to be used 


You returned null in some cases, and in those cases,  GeneratedInterface 
was used, as predicted. 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Any chance of an InterfaceGenerator overhaul to support GSS?

2015-04-02 Thread Julien Dramaix
This is in my todo list and will be done for GWT 2.8 (where GSS will become 
the default syntax). Feel free to open an issue in order to track this.

On Thursday, April 2, 2015 at 4:24:03 AM UTC+2, Abraham Lin wrote:
>
> The GWT distribution currently contains an InterfaceGenerator tool for 
> generating CssResource interfaces from a CSS source file; however, this 
> tool is still using the old Flute parser and thus does not support CSS3 
> syntax.
>
> Is there any chance that this tool will be overhauled/ported to support 
> GSS as part of GWT proper?
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Deferred binding consultation

2015-04-02 Thread Vic
Wow, Thomas, thanks for response. When I changed generator implementation 
to 


*String className = packageName + "." + simpleName;*
if (printWriter != null) {


className = composer.getCreatedClassName();
}
return className;


it started to work as expected. Thank you very much. Sometimes GWT sticks 
me up by its unpredictable behavior.  

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Deferred binding consultation

2015-04-02 Thread Thomas Broyer
I'm not 100% sure as I don't remember the details (not having worked on 
generators for a while) but I believe you should *always* return a non-null 
value (in your case).
IIRC, things go like this:

   - you can only generate a given class (by name) per compile. That means 
   if you need to generate different classes depending on the permutation, you 
   have to give them different names, and you can detect whether a given class 
   has already been generated (by another permutation in the same compile) by 
   doing a null-check on tryCreate's return value.
   - the value returned by the generator is the class to use, whichever the 
   permutation it's been generated in (it doesn't even have to be generated, 
   you can also just use an existing implementation, but have the generator 
   dynamically select it rather than relying on –static– rebind rules in the 
   module's gwt.xml).

So I'd say that in your case, you compile several permutations, and given 
the above rules, only the first one will use the generated class, others 
will just use GeneratedInterface given that the generator returns 'null'.

On Thursday, April 2, 2015 at 2:17:33 PM UTC+2, Vic wrote:
>
> Hi All,
>
> I am trying to use deferred binding to generate implementation in run-time 
> and encountered with one problem. I created pretty simple generator and use 
> GWT.create to instantiate a class. I am expecting GWT will provide class 
> generated by my generator and it works as expected in dev mode. When I am 
> trying to make same in production, for some reason GWT does not provide 
> generated version. I have no idea what is wrong, maybe somebody have any 
> ideas? Thanks in advance!  
> *Class, modified by generator*
>
> public class GeneratedInterface {
>
> public String getValue(){
> return null;
> }
> }
>
>
> *Generator*
>
> public String generate(TreeLogger logger, GeneratorContext ctx, String 
> requestedClass) throws UnableToCompleteException {
> JClassType type = ctx.getTypeOracle().findType(requestedClass);
> String packageName = type.getPackage().getName();
> String simpleName = type.getSimpleSourceName() + "_Generated";
> logger.log(TreeLogger.Type.INFO, "Create adapter " + packageName + "." + 
> simpleName + " for " + type.getQualifiedSourceName());
> ClassSourceFileComposerFactory composer = new 
> ClassSourceFileComposerFactory(packageName, simpleName);
> composer.setSuperclass(GeneratedInterface.class.getName());
> PrintWriter printWriter = ctx.tryCreate(logger, packageName, simpleName);
> String className = null;
> if (printWriter != null) {
> SourceWriter writer = composer.createSourceWriter(ctx, printWriter);
> writer.println("public String getValue() {");
> writer.println("return \"Test interface\";");
> writer.println("}");
> writer.commit(logger);
> className = composer.getCreatedClassName();
> }
> return className;
> }
>
>
> *EntryPoint* 
>
> public class GeneratorTest implements EntryPoint {
>
>
> public void onModuleLoad() {
> GeneratedInterface intf = GWT.create(GeneratedInterface.class);
> log.info("deferred binding: " + intf.getClass().getName());
> log.info("Value = " + intf.getValue());
>
> }
> }
>
>
> *module.xml*
>
> 
>  class="com.xxx.xxx.gwt.generator.client.GeneratedInterface"/>
> 
>
>
> As you can see, generator just provides implementation for 
> GeneratedInterface.getValue() 
>
> In case of dev mode, in logs I GWT uses generated class 
> Thu Apr 02 15:14:23 MSK 2015 
> com.hp.usage.gwt.generator.client.GeneratorTest INFO: deferred binding: 
> com.hp.usage.gwt.generator.client.*GeneratedInterface_Generated*
> Thu Apr 02 15:14:23 MSK 2015 
> com.hp.usage.gwt.generator.client.GeneratorTest INFO: Value = Test interface
>
> In case of production mode, in logs I GWT does not use generated class 
> Thu Apr 02 15:15:53 GMT+300 2015 
> com.hp.usage.gwt.generator.client.GeneratorTest INFO: deferred binding: 
> com.hp.usage.gwt.generator.client.*GeneratedInterface*
> Thu Apr 02 15:15:53 GMT+300 2015 
> com.hp.usage.gwt.generator.client.GeneratorTest INFO: Value = null
>
>
>
>
>
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Deferred binding consultation

2015-04-02 Thread Vic
Hi All,

I am trying to use deferred binding to generate implementation in run-time 
and encountered with one problem. I created pretty simple generator and use 
GWT.create to instantiate a class. I am expecting GWT will provide class 
generated by my generator and it works as expected in dev mode. When I am 
trying to make same in production, for some reason GWT does not provide 
generated version. I have no idea what is wrong, maybe somebody have any 
ideas? Thanks in advance!  
*Class, modified by generator*

public class GeneratedInterface {

public String getValue(){
return null;
}
}


*Generator*

public String generate(TreeLogger logger, GeneratorContext ctx, String 
requestedClass) throws UnableToCompleteException {
JClassType type = ctx.getTypeOracle().findType(requestedClass);
String packageName = type.getPackage().getName();
String simpleName = type.getSimpleSourceName() + "_Generated";
logger.log(TreeLogger.Type.INFO, "Create adapter " + packageName + "." + 
simpleName + " for " + type.getQualifiedSourceName());
ClassSourceFileComposerFactory composer = new 
ClassSourceFileComposerFactory(packageName, simpleName);
composer.setSuperclass(GeneratedInterface.class.getName());
PrintWriter printWriter = ctx.tryCreate(logger, packageName, simpleName);
String className = null;
if (printWriter != null) {
SourceWriter writer = composer.createSourceWriter(ctx, printWriter);
writer.println("public String getValue() {");
writer.println("return \"Test interface\";");
writer.println("}");
writer.commit(logger);
className = composer.getCreatedClassName();
}
return className;
}


*EntryPoint* 

public class GeneratorTest implements EntryPoint {


public void onModuleLoad() {
GeneratedInterface intf = GWT.create(GeneratedInterface.class);
log.info("deferred binding: " + intf.getClass().getName());
log.info("Value = " + intf.getValue());

}
}


*module.xml*






As you can see, generator just provides implementation for 
GeneratedInterface.getValue() 

In case of dev mode, in logs I GWT uses generated class 
Thu Apr 02 15:14:23 MSK 2015 
com.hp.usage.gwt.generator.client.GeneratorTest INFO: deferred binding: 
com.hp.usage.gwt.generator.client.*GeneratedInterface_Generated*
Thu Apr 02 15:14:23 MSK 2015 
com.hp.usage.gwt.generator.client.GeneratorTest INFO: Value = Test interface

In case of production mode, in logs I GWT does not use generated class 
Thu Apr 02 15:15:53 GMT+300 2015 
com.hp.usage.gwt.generator.client.GeneratorTest INFO: deferred binding: 
com.hp.usage.gwt.generator.client.*GeneratedInterface*
Thu Apr 02 15:15:53 GMT+300 2015 
com.hp.usage.gwt.generator.client.GeneratorTest INFO: Value = null







-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: gwt-tour not working

2015-04-02 Thread Alain Ekambi
https://oss.sonatype.org/content/repositories/snapshots/com/ahome-it/gwt-tour/

On 2 April 2015 at 12:18, Alain Ekambi  wrote:

> We just release a new version of gwt tour. You can get it from our
> sonatype repository.
> On 1 Apr 2015 17:55, "marian lux"  wrote:
>
>> I can't get gwt-tour working with my project.
>>
>> As described
>> here https://github.com/eemi2010/Gwt-Tour
>> and here http://eemi2010.github.io/gwt-tour/
>>
>> I added in my pom.xml
>>
>> 
>> 
>> gwttour-mvn-repo
>> https://raw.github.com/kerbymart/gwt-tour/mvn-repo/
>> 
>> true
>> always
>> 
>> 
>> 
>>
>>
>> 
>> com.eemi.gwt
>> tour
>> 1.0-SNAPSHOT
>> 
>>
>>
>> Added in the gwt-project.xml the line
>> 
>>
>>
>> When I add the following line in the code
>> Tour tour = new Tour("myTour");
>>
>> Compiling in SDM returns an error "failed"
>> Console-Log:
>> Linking modules
>>Bootstrap link for command-line module 'at.mlux.oha'
>>   Linking module 'oha'
>>  Invoking Linker Cross-Site-Iframe
>> Ignoring the following script tags in the gwt.xml file
>> hopscotch-0.1.js
>> 
>> 
>> src='{feedAuthorAvatarURL}'> (:22)
>>  Computing all possible rebind results for
>> 'com.eemi.gwt.tour.client.resources.GwtTourResources'
>> Rebinding com.eemi.gwt.tour.client.resources.GwtTourResources
>>Invoking generator com.google.gwt.resources.rebind.context
>> .InlineClientBundleGenerator
>>   Creating assignment for css()
>>  Finding resources
>> [ERROR] Resource hopscotch.css not found. Is the
>> name specified as ClassLoader.getResource() would expect?
>>   Creating assignment for js()
>>  Finding resources
>> [ERROR] Resource hopscotsch-0.1.2.min.js not
>> found. Is the name specified as ClassLoader.getResource() would expect?
>>  [ERROR] Errors in 'com/eemi/gwt/tour/client/GwtTour.java'
>> [ERROR] Line 57: Failed to resolve
>> 'com.eemi.gwt.tour.client.resources.GwtTourResources' via deferred
>>
>> What went wrong?
>>
>>  --
>> 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.
>> For more options, visit https://groups.google.com/d/optout.
>>
>


-- 

Alain Ekambi

Co-Founder

Ahomé Innovation Technologies

http://www.ahome-it.com/ 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: gwt-tour not working

2015-04-02 Thread Alain Ekambi
We just release a new version of gwt tour. You can get it from our sonatype
repository.
On 1 Apr 2015 17:55, "marian lux"  wrote:

> I can't get gwt-tour working with my project.
>
> As described
> here https://github.com/eemi2010/Gwt-Tour
> and here http://eemi2010.github.io/gwt-tour/
>
> I added in my pom.xml
>
> 
> 
> gwttour-mvn-repo
> https://raw.github.com/kerbymart/gwt-tour/mvn-repo/
> 
> true
> always
> 
> 
> 
>
>
> 
> com.eemi.gwt
> tour
> 1.0-SNAPSHOT
> 
>
>
> Added in the gwt-project.xml the line
> 
>
>
> When I add the following line in the code
> Tour tour = new Tour("myTour");
>
> Compiling in SDM returns an error "failed"
> Console-Log:
> Linking modules
>Bootstrap link for command-line module 'at.mlux.oha'
>   Linking module 'oha'
>  Invoking Linker Cross-Site-Iframe
> Ignoring the following script tags in the gwt.xml file
> hopscotch-0.1.js
> 
> 
> src='{feedAuthorAvatarURL}'> (:22)
>  Computing all possible rebind results for
> 'com.eemi.gwt.tour.client.resources.GwtTourResources'
> Rebinding com.eemi.gwt.tour.client.resources.GwtTourResources
>Invoking generator com.google.gwt.resources.rebind.context.
> InlineClientBundleGenerator
>   Creating assignment for css()
>  Finding resources
> [ERROR] Resource hopscotch.css not found. Is the
> name specified as ClassLoader.getResource() would expect?
>   Creating assignment for js()
>  Finding resources
> [ERROR] Resource hopscotsch-0.1.2.min.js not found
> . Is the name specified as ClassLoader.getResource() would expect?
>  [ERROR] Errors in 'com/eemi/gwt/tour/client/GwtTour.java'
> [ERROR] Line 57: Failed to resolve
> 'com.eemi.gwt.tour.client.resources.GwtTourResources' via deferred
>
> What went wrong?
>
>  --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


JSNI and boilerplate code

2015-04-02 Thread Elias
Hi everyone,

Trying to work with overlays I often need to write extreme amount of 
boilerplate code just for transferring data between Java and Javascript.

(a) Take the following simple class as an example. I just want to run the 
JS function stored in the private variable setFunc for different object 
types. I understand that the Java objects (Double, Date, Integer etc.) 
could not have to be appropriately converted, but in the cases of Strings 
and the primitives it seems rather odd to have to repeat exactly the same 
code over and over again.

(b) In addition, even the Java Objects are actually used by the application 
as simple busses for transferring data from a JavaScript part to another 
through the Java code (e.g. JavaScript nullable number to Double and then 
back to JavaScript Number).

I suspect that the in both above cases (multiple identical methods and Java 
Objects as busses) the compiler is not able to optimize the code, so 
affecting the performance. One possible solution would be to use 
JavaScriptObject as a bus, but, unfortunately, it seems that it cannot 
store JS primitives.

I wonder if there is a better way for treating data transfers between JS 
and Java or if the upcoming next generation JS interoperability solves the 
problem. I’d appreciate any idea for better treating.

*public* *class* ViewPropWritable *extends* ViewProp {

  *private* JavaScriptObject setFunc;

  *private* JavaScriptObject data;

 

  *public* ViewPropWritable(Binder view, ValueChangeListener uiElement,
  String getExpr) {

*super*(view, uiElement, getExpr);

  }

 

  *public* ViewPropWritable(Binder view, ValueEditor uiElement,
  String getExpr, String setExpr, String validExpr) {

*super*(view, uiElement, getExpr);

setFunc = getSetFunc(setExpr, validExpr);

((ValueEditor)uiElement).bindChangeEvent(*this*);

  }

 

  *public* *void* setScope(Scope scope) {

*this*.data = scope.getData();

  }

 

  *public* *boolean* setValue(Double value) {

*return* value == *null* ? setNull() : set(value.doubleValue());

  }

 

  *public* *boolean* setValue(Boolean value) {

*return* value == *null* ? setNull() : set(value.booleanValue());

  }

   

  *public* *boolean* setValue(Date value) {

*return* value == *null* ? setNull() : set(value.getTime());

  }

   

  *public* *native* *boolean* setValue(String value) /*-{

var f = th...@net.qark.core.ViewPropWritable::setFunc;

return f(this.data, value);

  }-*/;

 

*  public* *native* *boolean* setValue(JavaScriptObject value) /*-{

var f = th...@net.qark.core.ViewPropWritable::setFunc;

   return f(this.data, value);

  }-*/;

 

  // Private methods

 

  *private* *native* *boolean* set(*double* value) /*-{

var f = th...@net.qark.core.ViewPropWritable::setFunc;

return f(this.data, value);

  }-*/;

 

  *private* *native* *boolean* set(*boolean* value) /*-{

var f = th...@net.qark.core.ViewPropWritable::setFunc;

return f(this.data, value);

  }-*/;

 

  *private* *native* *boolean* setNull() /*-{

var f = th...@net.qark.core.ViewPropWritable::setFunc;

return f(this.data, value);

  }-*/;

 

  *private* *native* JavaScriptObject getSetFunc(String setExpr, String 
validExpr) /*-{

return function() {

  var sf = new Function("$", "v", setExpr + "=v;");

  if (validExpr) {

var vf = new Function("$", "v", validExpr);

return function(d, v) {

  var b = v ? v(d, v) : true;

  if (b) sf(d, v);

  return b;

}

  } else {

return function(d, v) {

  return sf(d, v);

}

  }

}();

  }-*/;

}

BTW, the documentation of GWT 2.7 suggests that fully qualified class names 
are not necessary anymore, but Eclipse complains if I set this.
@ViewPropWritable::setFunc for example.

Thanks,
Elias

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Injecting JavaScript(JSNI) to Cell Table DOM

2015-04-02 Thread Frank Taffelt
can you try:
$wnd.$($doc).ready(
function(){
$wnd.jQuery("[rel=tooltipTop]").tooltip({ placement: 'top'});
});


or skip the ready block your dom is already there...


On Wednesday, April 1, 2015 at 6:22:36 PM UTC+2, Abdullah wrote:
>
> Hi,
> In my application i am using GWT Cell Table, for some of the Column Header 
> i want to add tooltip.Column Header is created by using SafeHtml and 
> Injecting JS to cell table header using JSNI. But that time the DOM is not 
> creating and JavaScript is not attaching to the column Header for 
> tooltip.If i use Timer then the Problem is goes off,I don't want to use 
> Timer.Is there any Way to inject JS?Any Clue?See below code,
>
> *Column Header SafeHtml:*
> SafeHtml="Total class='reqFull' data-original-title='{0}'> ";
>
> *JSNI:*
>  private static native void initTooltip() /*-{
> $wnd.$(document).ready(function(){
>  $wnd.jQuery("[rel=tooltipTop]").tooltip({ placement: 'top'});
> });
> 
> }-*/;
>
> I am Calling this JSNI after the table creation but still DOM is not ready.
> Even i tried calling this JSNI Script in onAttach() Method,
>
> @Override
> protected void onAttach() {
> super.onAttach();
> initTooltip();
>  }
>
> Any Suggestion?
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Debug GWT application in a remote browser

2015-04-02 Thread abdullah
Hi,
How to debug gwt application in remote browser? 

-- 
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.
For more options, visit https://groups.google.com/d/optout.