Re: how to inject ClientBundle using GIN to avoid GWT.create

2011-01-14 Thread David Chandler
The doc you referenced shows how you can make Resources available in a
UiBinder template, but you still need a call to GWT.create() somewhere,
whether you do it or GIN does it behind the scenes. If you don't need the
Resources in a UiBinder template, you can ignore that doc.

On Fri, Jan 14, 2011 at 5:33 PM, zixzigma  wrote:

> After a review of GWT documentation,[1]
> I came across two techniques for getting access to ClientBundle Resources,
> which seem to be better than using GIN injection ?
>
> what is the preferred of getting access to ClientBundle Resources ?
>
> I don't know whether I should use the techniques below, or use GIN
> Injection ?
>
>
> [1]
> http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Share_resource_instances
>
> @UiField(provided = true)
> final Resources resources;
>
> @UiFactory
> public Resources getResources() {return resources;}
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

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



Re: how to inject ClientBundle using GIN to avoid GWT.create

2011-01-14 Thread zixzigma
After a review of GWT documentation,[1]
I came across two techniques for getting access to ClientBundle Resources,
which seem to be better than using GIN injection ?

what is the preferred of getting access to ClientBundle Resources ?

I don't know whether I should use the techniques below, or use GIN Injection 
?


[1] 
http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Share_resource_instances

@UiField(provided = true)
final Resources resources;

@UiFactory
public Resources getResources() {return resources;}


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



Re: how to inject ClientBundle using GIN to avoid GWT.create

2011-01-13 Thread zixzigma
Thank You, it works now : )

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



Re: how to inject ClientBundle using GIN to avoid GWT.create

2011-01-13 Thread David Chandler
This will work as long as the class into which you're injecting the
ClientBundle is itself instantiated via GIN. For more info, see
http://turbomanage.wordpress.com/2009/10/02/gwt-easy-i18n-with-gin/

HTH,
/dmc

On Thu, Jan 13, 2011 at 9:54 PM, zixzigma  wrote:

>
> given we have a client bundle:
> public interface MyResource extends ClientBundle {}
>
> in our widget:
>
> public class MyWidget extends Composite {
>
> MyResource resource = GWT.create(MyResource.class);
>
> // resource.myresource
>
> how can we inject ClientBundle, so that we can do away with GWT.create
>
> for example:
>
> private final MyResource resource;
>
> @Inject
> public MyWidget(MyResource resource){
>
> this.resource = resource;
> }
>
> when I try this, I get exceptions.
> do I need to declare any bindings in gin module config ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>


-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

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



how to inject ClientBundle using GIN to avoid GWT.create

2011-01-13 Thread zixzigma

given we have a client bundle:
public interface MyResource extends ClientBundle {}

in our widget:

public class MyWidget extends Composite {

MyResource resource = GWT.create(MyResource.class);

// resource.myresource

how can we inject ClientBundle, so that we can do away with GWT.create

for example:

private final MyResource resource;

@Inject
public MyWidget(MyResource resource){

this.resource = resource;
}

when I try this, I get exceptions.
do I need to declare any bindings in gin module config ?

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