@@ -0,0 +1,2462 @@
+package com.cathive.fx.guice;%0A%0Aimport com.google.inject.AbstractModule;%0Aimport com.google.inject.Injector;%0A%0Aimport javafx.application.Application;%0A%0A/**%0A * @author Benjamin P. Jung%0A */%0Apublic abstract class GuiceApplication extends Application %7B%0A%0A    /**%0A     * The Guice Injector instance that is being used within%0A     * the context of this application.%0A     * @see #createInjector()%0A     * @see #getInjector()%0A     */%0A    private Injector injector;%0A%0A    /**%0A     * To make sure that the initialization of Guice-based JavaFX application%0A     * works flawlessly, the original init method of the base JavaFX Application%0A     * class is overwritten here. All of the %0A     */%0A    @Override%0A    public final void init() throws Exception %7B%0A%0A        super.init();%0A%0A        final Class%3CGuiceApplication%3E clazz = GuiceApplication.class;%0A        final GuiceApplication instance = this;%0A%0A        final Injector inj = createInjector();%0A        if (inj == null) %7B%0A            throw new IllegalStateException(%22Injector has not been created (yet).%22);%0A        %7D%0A%0A        // Inject all fields annotated with @Inject into this GuiceApplication instance.%0A        inj.injectMembers(instance);%0A%0A        // Create a child injector and bind the instance of this GuiceApplication%0A        // to any instances of GuiceApplication.class.%0A        // Note: this means that you cannot have two different subclasses of GuiceApplication%0A        //       within the same context. A limitation that should usually be not a problem,%0A        //       though.%0A        injector = inj.createChildInjector(new AbstractModule() %7B%0A            @Override%0A            protected void configure() %7B%0A                bind(clazz).toInstance(instance);%0A            %7D%0A        %7D);%0A%0A    %7D%0A%0A    /**%0A     * This method initializes the Guice Injector to be used for%0A     * dependency injection in the context of this application instance.%0A     * %3Cp%3EThis method %3Cstrong%3Emust not%3C/strong%3E return %3Ccode%3Enull%3C/code%3E.%0A     * @return%0A     *     The injector to be used in context of this application.%0A     */%0A    public abstract Injector createInjector();%0A%0A    /**%0A     * Returns the Google Guice Injector that is used within the context%0A     * of this JavaFX Application.%0A     * @return%0A     *     The Guice Injector that has been created during the initialization%0A     *     of this JavaFX Application.%0A     * @see #createInjector()%0A     */%0A    public final Injector getInjector() %7B%0A        return this.injector;%0A    %7D%0A%0A%7D%0A

Add first version of new GuiceApplication class