You don't need to write this Provider<DepartmentScreen>.

You can simply:

bind(DeparatmentScreen.class);

and inject Provider<DepartmentScreen>

Binding X.class, for free, gives you the ability to inject Provider<X>.

-Fred

On Sat, May 8, 2010 at 11:10 AM, yarco <[email protected]> wrote:

> If I have code like ...
>
> public class DepartmentScreenProvider implements
> Provider<DepartmentScreen> {
>
>        @Override
>        @Singleton
>        public DepartmentScreen get() {
>                return new DepartmentScreen();
>        }
>
> }
>
> If DepartmentScreen has @Inject dependenices of its own, how do I
> handle this.
>
> Note - I can not use Assisted Inject as this code is used in GWT.
> injectMembers is an an option too... but...  What happens if I have
> @Inject constructor dependencies?
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to