All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.techad.edc.popover.injector.EdcPopoverModule Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
/*
 * Copyright (c) 2017. All rights reserved
 */

package fr.techad.edc.popover.injector;

import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.TypeLiteral;
import fr.techad.edc.popover.browser.Browser;
import fr.techad.edc.popover.builder.ContextualComponentBuilder;
import fr.techad.edc.popover.builder.ContextualContentComponentBuilder;
import fr.techad.edc.popover.injector.provider.HelpListenerProvider;
import fr.techad.edc.popover.internal.browser.SwingBrowser;
import fr.techad.edc.popover.internal.model.HelpConfigurationImpl;
import fr.techad.edc.popover.internal.swing.EdcSwingHelpImpl;
import fr.techad.edc.popover.internal.swing.builder.ContextualComponentBuilderImpl;
import fr.techad.edc.popover.internal.swing.builder.ContextualContentComponentBuilderImpl;
import fr.techad.edc.popover.internal.swing.components.Popover;
import fr.techad.edc.popover.model.HelpConfiguration;
import fr.techad.edc.popover.swing.EdcSwingHelp;
import fr.techad.edc.popover.swing.HelpListener;

import javax.swing.*;

/**
 * The guice module to configure injection
 */
public class EdcPopoverModule extends AbstractModule {
    @Override
    protected void configure() {
        // Model
        bind(HelpConfiguration.class).to(HelpConfigurationImpl.class).in(Scopes.SINGLETON);

        // Builder
        bind(new TypeLiteral>() {}).to(ContextualComponentBuilderImpl.class);
        bind(new TypeLiteral>() {}).to(ContextualContentComponentBuilderImpl.class);

        // Provider
        bind(HelpListener.class).toProvider(HelpListenerProvider.class);

        // The Helper
        bind(EdcSwingHelp.class).to(EdcSwingHelpImpl.class).in(Scopes.SINGLETON);
        bind(Popover.class).in(Scopes.SINGLETON);
        bind(Browser.class).to(SwingBrowser.class).in(Scopes.SINGLETON);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy