Skip to content

Instantly share code, notes, and snippets.

View gleb-s's full-sized avatar

gleb-s gleb-s

  • Minsk
View GitHub Profile
@andytill
andytill / GuiceControllerFactory.java
Created July 1, 2012 17:53
Creating JavaFX Controllers using Guice
/**
* A JavaFX controller factory for constructing controllers via Guice DI. To
* install this in the {@link FXMLLoader}, pass it as a parameter to
* {@link FXMLLoader#setControllerFactory(Callback)}.
* <p>
* Once set, make sure you do <b>not</b> use the static methods on
* {@link FXMLLoader} when creating your JavaFX node.
*/
class GuiceControllerFactory implements Callback<Class<?>, Object> {