So, I have been trying to develop a frame scope. I have
tinkered with ideas to create such a scope, and realized that having a
"Who's calling" object would be best thing.
public class SwingScopes {
public static final Scope FRAME = new Scope() {
public <T> Provider<T> scope(final Key<T> key, final
Provider<T> creator, final Object source) { //Note: Source is the object
that is requesting the injection
return provider;
}
public String toString() {
return CustomScopes.class.getSimpleName()+".FRAME";
}
};
}
Reason for this is under swing development, we can determine the
object requiring it, and make appropriate decision as to what object
the Provider should provide. ;) There can be other reasons to make
this available. Let me know.
Original issue reported on code.google.com by dh.evolu...@gmail.com on 24 Apr 2008 at 6:23
Original issue reported on code.google.com by
dh.evolu...@gmail.com
on 24 Apr 2008 at 6:23