Skip to content

Instantly share code, notes, and snippets.

@andytill
Created September 4, 2012 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andytill/3620534 to your computer and use it in GitHub Desktop.
Save andytill/3620534 to your computer and use it in GitHub Desktop.
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
public class FXMLLoadingModule extends AbstractModule {
private final FXMLLoadingScope fxmlLoadingScope;
public FXMLLoadingModule() {
fxmlLoadingScope = new FXMLLoadingScope();
}
@Override
protected void configure() {
bindScope(FXMLLoadingScoped.class, fxmlLoadingScope);
}
@Provides
public ControllerLookup provideControllerLookup() {
return new ControllerLookup(fxmlLoadingScope.getControllers());
}
@Provides
public FXMLLoadingScope provideFxmlLoadingScope() {
return fxmlLoadingScope;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment