VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class MvcModule<VR>
extends com.google.inject.AbstractModule
In an Eclipse UI-integration scenario this module is intended to be overwritten by the MVC.UI Guice module, which is provided by the MVC.UI bundle (or, in case of the MVC.FX module, by the MVC.FX.UI module, which is provided by the MVC.FX.UI bundle).
Generally, we recommended that all clients should create an own non-UI module, which extends this module (or the MVC.FX module), as well as an own UI module, which extends the MVC.UI (or the MVC.FX.UI module), being used to override the non-UI module in an Eclipse-UI integration scenario, as follows:
MVC <--extends-- MVC.FX <--extends-- Client-Non-UI-Module ^ ^ ^ | | | overrides overrides overrides | | | | | | MVC.UI <--extends-- MVC.FX.UI <--extends-- Client-UI-ModuleIn addition to 'normal' Guice bindings, the MVC modules makes use of AdapterMap bindings, which is used to inject class-key/adapter pairs into
IAdaptable
s. Therefore, it enables support for adapter map
injections within enableAdapterMapInjection()
, which gets called
from within configure()
. Clients extending the MVC or MVC.FX module
should make use this is not lost.AdapterMap
,
AdaptableTypeListener
Constructor and Description |
---|
MvcModule() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindAbstractContentPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
Adds (default)
AdapterMap bindings for
AbstractContentPart and all sub-classes. |
protected void |
bindAbstractDomainAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
Adds (default)
AdapterMap bindings for AbstractDomain and
all sub-classes. |
protected void |
bindAbstractFeedbackPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
Adds (default)
AdapterMap bindings for
AbstractFeedbackPart and all sub-classes. |
protected void |
bindAbstractHandlePartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
Adds (default)
AdapterMap bindings for AbstractHandlePart
and all sub-classes. |
protected void |
bindAbstractRootPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
Adds (default)
AdapterMap bindings for AbstractRootPart
and all sub-classes. |
protected void |
bindAbstractVisualPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
Adds (default)
AdapterMap binding for AbstractVisualPart
and all sub-classes. |
protected void |
bindIOperationHistory()
|
protected void |
bindIUndoContext()
|
protected void |
configure() |
protected void |
enableAdapterMapInjection()
Installs an
AdapterInjectionSupport module, which binds an
AdaptableTypeListener and ensures it gets properly injected. |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
protected void bindAbstractContentPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
AdapterMap
bindings for
AbstractContentPart
and all sub-classes. May be overwritten by
sub-classes to change the default bindings.adapterMapBinder
- The MapBinder
to be used for the binding registration.
In this case, will be obtained from
AdapterMaps.getAdapterMapBinder(Binder, Class)
using
AbstractContentPart
as a key.AdapterMaps.getAdapterMapBinder(Binder, Class)
protected void bindAbstractDomainAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
AdapterMap
bindings for AbstractDomain
and
all sub-classes. May be overwritten by sub-classes to change the default
bindings.adapterMapBinder
- The MapBinder
to be used for the binding registration.
In this case, will be obtained from
AdapterMaps.getAdapterMapBinder(Binder, Class)
using
AbstractDomain
as a key.AdapterMaps.getAdapterMapBinder(Binder, Class)
protected void bindAbstractFeedbackPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
AdapterMap
bindings for
AbstractFeedbackPart
and all sub-classes. May be overwritten by
sub-classes to change the default bindings.adapterMapBinder
- The MapBinder
to be used for the binding registration.
In this case, will be obtained from
AdapterMaps.getAdapterMapBinder(Binder, Class)
using
AbstractFeedbackPart
as a key.AdapterMaps.getAdapterMapBinder(Binder, Class)
protected void bindAbstractHandlePartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
AdapterMap
bindings for AbstractHandlePart
and all sub-classes. May be overwritten by sub-classes to change the
default bindings.adapterMapBinder
- The MapBinder
to be used for the binding registration.
In this case, will be obtained from
AdapterMaps.getAdapterMapBinder(Binder, Class)
using
AbstractHandlePart
as a key.AdapterMaps.getAdapterMapBinder(Binder, Class)
protected void bindAbstractRootPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
AdapterMap
bindings for AbstractRootPart
and all sub-classes. May be overwritten by sub-classes to change the
default bindings.adapterMapBinder
- The MapBinder
to be used for the binding registration.
In this case, will be obtained from
AdapterMaps.getAdapterMapBinder(Binder, Class)
using
AbstractRootPart
as a key.AdapterMaps.getAdapterMapBinder(Binder, Class)
protected void bindAbstractVisualPartAdapters(com.google.inject.multibindings.MapBinder<AdapterKey<?>,java.lang.Object> adapterMapBinder)
AdapterMap
binding for AbstractVisualPart
and all sub-classes. May be overwritten by sub-classes to change the
default bindings.adapterMapBinder
- The MapBinder
to be used for the binding registration.
In this case, will be obtained from
AdapterMaps.getAdapterMapBinder(Binder, Class)
using
AbstractVisualPart
as a key.AdapterMaps.getAdapterMapBinder(Binder, Class)
protected void bindIOperationHistory()
protected void bindIUndoContext()
protected void configure()
configure
in class com.google.inject.AbstractModule
protected void enableAdapterMapInjection()
AdapterInjectionSupport
module, which binds an
AdaptableTypeListener
and ensures it gets properly injected.Copyright (c) 2014 itemis AG and others. All rights reserved.