List of usage examples for com.google.gwt.inject.client.multibindings GinMultibinder newSetBinder
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, Class<T> type)
From source file:com.codenvy.ide.client.inject.GinModule.java
License:Open Source License
/** {@inheritDoc} */ @Override//from w w w . j a v a 2 s .c o m protected void configure() { install(new GinFactoryModuleBuilder().implement(ElementView.class, ElementViewImpl.class) .implement(BranchView.class, BranchViewImpl.class).build(ElementWidgetFactory.class)); install(new GinFactoryModuleBuilder().implement(ToolbarGroupView.class, ToolbarGroupViewImpl.class) .implement(ToolbarItemView.class, ToolbarItemViewImpl.class).build(ToolbarFactory.class)); install(new GinFactoryModuleBuilder().implement(PropertyGroupView.class, PropertyGroupViewImpl.class) .build(PropertiesGroupFactory.class)); GinMultibinder<Initializer> initializers = GinMultibinder.newSetBinder(binder(), Initializer.class); configurePropertiesPanels(initializers); configurePropertyTypes(initializers); configureValidators(initializers); configureCreators(initializers); configureToolbar(initializers); /* * TODO: this configuration was copied from CoreGinModule from ide-core project. It is important because this gin module is * separated from IDE injection circle. In order to update version of IDE one has to review this configuration and * synchronize it. */ bind(MessageDialogView.class).to(MessageDialogViewImpl.class); bind(ConfirmDialogView.class).to(ConfirmDialogViewImpl.class); bind(InputDialogView.class).to(InputDialogViewImpl.class); install(new GinFactoryModuleBuilder().implement(MessageDialog.class, MessageDialogPresenter.class) .implement(ConfirmDialog.class, ConfirmDialogPresenter.class) .implement(InputDialog.class, InputDialogPresenter.class).build(DialogFactory.class)); }
From source file:com.codenvy.ide.ext.php.client.inject.PHPGinModule.java
License:Open Source License
/** {@inheritDoc} */ @Override//from w ww . j a v a 2 s. co m protected void configure() { GinMultibinder.newSetBinder(binder(), ProjectWizardRegistrar.class).addBinding() .to(PHPProjectWizardRegistrar.class); }
From source file:com.codenvy.ide.extension.ant.client.inject.AntGinModule.java
License:Open Source License
/** {@inheritDoc} */ @Override/* w ww . j a v a 2s .com*/ protected void configure() { bind(AntPageView.class).to(AntPageViewImpl.class).in(Singleton.class); install(new GinFactoryModuleBuilder().build(AntNodeFactory.class)); GinMultibinder.newSetBinder(binder(), TreeStructureProvider.class).addBinding() .to(AntProjectTreeStructureProvider.class); }
From source file:com.codenvy.plugin.angularjs.core.client.inject.AngularJSModule.java
License:Open Source License
/** {@inheritDoc} */ @Override/* ww w . j av a2s .co m*/ protected void configure() { // Adds the Auto Edit Strategy (interpolation braces) // bind(AutoEditStrategyFactory.class).to(AngularJSInterpolationBraceStrategyFactory.class).in(Singleton.class); // GinMultibinder<AutoEditStrategyFactory> binder = GinMultibinder.newSetBinder(binder(), AutoEditStrategyFactory.class); // binder.addBinding().to(AngularJSInterpolationBraceStrategyFactory.class); // Add HTML completion processors (as being in a set) GinMultibinder<HTMLCodeAssistProcessor> binderHtmlProcessors = GinMultibinder.newSetBinder(binder(), HTMLCodeAssistProcessor.class); binderHtmlProcessors.addBinding().to(AngularJSHtmlCodeAssistProcessor.class); // Add JavaScript completion processors (as being in a set) GinMultibinder<JsCodeAssistProcessor> binderJsProcessors = GinMultibinder.newSetBinder(binder(), JsCodeAssistProcessor.class); binderJsProcessors.addBinding().to(JavaScriptCodeAssistProcessor.class); }
From source file:com.codenvy.plugin.contribution.vcs.client.inject.ContributorVcsModule.java
License:Open Source License
@Override protected void configure() { bind(VcsServiceProvider.class); bind(VcsHostingServiceProvider.class); final GinMultibinder<VcsHostingService> vcsHostingServiceBinder = GinMultibinder.newSetBinder(binder(), VcsHostingService.class); vcsHostingServiceBinder.addBinding().to(GitHubHostingService.class); vcsHostingServiceBinder.addBinding().to(BitbucketHostingService.class); }
From source file:com.gwtplatform.dispatch.rest.client.serialization.SerializationModule.java
License:Apache License
public static GinLinkedBindingBuilder<Serialization> registerSerializationBinding(GinBinder binder) { return GinMultibinder.newSetBinder(binder, Serialization.class).addBinding(); }
From source file:com.preferanser.client.gin.ClientModule.java
License:Open Source License
@Override protected void configure() { install(new DefaultModule()); install(new ApplicationModule()); // DefaultPlaceManager Places bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.DEALS); bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.ERROR); bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.UNAUTHORIZED); bind(I18nHelper.class).asEagerSingleton(); bind(Bootstrapper.class).to(AuthBootstrapper.class).in(Singleton.class); bind(User.class).asEagerSingleton(); GinMultibinder<RestyGwtRequestListener> requestListenerMultibinder = GinMultibinder.newSetBinder(binder(), RestyGwtRequestListener.class); // requestListenerMultibinder.addBinding().to(RestyGwtLoggingRequestListener.class); requestListenerMultibinder.addBinding().to(RequestLoaderRestyGwtListener.class); requestListenerMultibinder.addBinding().to(ErrorHandlingRestyGwtRequestListener.class); // bind(RequestLoader.class).to(StatusMessageRequestLoader.class).in(Singleton.class); bind(RequestLoader.class).to(DialogBoxRequestLoader.class).in(Singleton.class); bind(RestyGwtDispatcher.class).toProvider(RestyGwtDispatcher.Provider.class).asEagerSingleton(); bind(Editor.class).toProvider(GameBuilderProvider.class).in(Singleton.class); bind(ResourceLoader.class).asEagerSingleton(); }
From source file:examples.MyGinModule.java
License:Open Source License
@Override protected void configure() { GinMultibinder<Theme> themeBinder = GinMultibinder.newSetBinder(binder(), Theme.class); themeBinder.addBinding().to(MyTheme.class); }
From source file:my.plugin.ide.inject.JsonExampleModule.java
License:Open Source License
@Override protected void configure() { GinMultibinder.newSetBinder(binder(), ProjectWizardRegistrar.class).addBinding() .to(JsonExampleProjectWizardRegistrar.class); }
From source file:my.plugin.ide.inject.SampleWizardGinModule.java
License:Open Source License
/** {@inheritDoc} */ @Override//from www. jav a 2s. c om protected void configure() { GinMultibinder.newSetBinder(binder(), ProjectWizardRegistrar.class).addBinding() .to(SampleWizardRegistrar.class); bind(NewXFileView.class).to(NewXFileViewImpl.class).in(Singleton.class); }