Interface IValueComponentPart<VM extends ValueControlViewModel,M extends IValueModel,T extends Value>
-
- All Known Implementing Classes:
AbstractReferenceValueComponentPart
,AbstractValueComponentPart
,BooleanValueComponentPart
,BorderValueComponentPart
,ChartReferenceValueComponentPart
,ColorValueComponentPart
,DateValueComponentPart
,EmptyValueComponentPart
,EnumValueComponentPart
,FontValueComponentPart
,NumberValueComponentPart
,PredefinedValueComponentPart
,StringValueComponentPart
,SysEnumValueComponentPart
,TypeSelectionValueComponentPart
public interface IValueComponentPart<VM extends ValueControlViewModel,M extends IValueModel,T extends Value>
The contract for extension ofValueComponent
. The component part should be stateless.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bindViewModel(VM viewModel, M model, IMapper<T,?> mapper)
Binds the given view model to model.IMapper<T,?>
createMapper(VM viewModel, M model)
Returns the newly created mapper that maps theValue
to view model.VM
createViewModel(M model)
Creates a view model for the givenmodel
.org.eclipse.emf.ecore.EStructuralFeature
getViewModelBindingFeature()
Returns the view model feature that is binds by value component.void
handleButtonPressed(VM viewModel, M model)
Handles the button events.boolean
hasClearAction(VM viewModel, M model)
Returnstrue
if the value component should create clear action button for the given model.boolean
isSuitable(M model)
Returns thetrue
if the part is suitable for the givenmodel
.
-
-
-
Method Detail
-
isSuitable
boolean isSuitable(M model)
Returns thetrue
if the part is suitable for the givenmodel
.- Parameters:
model
- theIValueModel
.- Returns:
- the
true
if the part is suitable for the givenmodel
.
-
createViewModel
VM createViewModel(M model)
Creates a view model for the givenmodel
.- Parameters:
model
- theIValueModel
.- Returns:
- the newly created view model.
-
bindViewModel
void bindViewModel(VM viewModel, M model, IMapper<T,?> mapper)
Binds the given view model to model. It is the extra binding that is needed to fill view model with additional data.
NOTE: implement this functionality only if the default component binding usinggetViewModelBindingFeature()
and#createMapper()
is not enough.- Parameters:
viewModel
- the view model to bind.model
- theIValueModel
.mapper
- theIMapper
instance.
-
handleButtonPressed
void handleButtonPressed(VM viewModel, M model)
Handles the button events.- Parameters:
viewModel
- the view model.model
- theIValueModel
.
-
getViewModelBindingFeature
org.eclipse.emf.ecore.EStructuralFeature getViewModelBindingFeature()
Returns the view model feature that is binds by value component.- Returns:
- the view model feature that is binds by
value component or
null
.
-
createMapper
IMapper<T,?> createMapper(VM viewModel, M model)
Returns the newly created mapper that maps theValue
to view model.- Parameters:
viewModel
- the view model.model
- theIValueModel
.- Returns:
- the mapper.
-
hasClearAction
boolean hasClearAction(VM viewModel, M model)
Returnstrue
if the value component should create clear action button for the given model.- Parameters:
viewModel
- the view model.model
- theIValueModel
.- Returns:
true
if the clear action button is required.
-
-