Class EnumValueComponentPart
- java.lang.Object
-
- com._1c.g5.v8.dt.md.ui.aef.components.value.AbstractValueComponentPart<VM,ReferenceValue>
-
- com._1c.g5.v8.dt.md.ui.aef.components.value.AbstractReferenceValueComponentPart<EnumValueControlViewModel>
-
- com._1c.g5.v8.dt.md.ui.aef.components.value.EnumValueComponentPart
-
- All Implemented Interfaces:
IValueComponentPart<EnumValueControlViewModel,IValueModel,ReferenceValue>
public class EnumValueComponentPart extends AbstractReferenceValueComponentPart<EnumValueControlViewModel>
-
-
Constructor Summary
Constructors Constructor Description EnumValueComponentPart()
Creates a new component part.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindViewModel(EnumValueControlViewModel viewModel, IValueModel model, IMapper<ReferenceValue,?> mapper)
Binds the given view model to model.IMapper<ReferenceValue,?>
createMapper(EnumValueControlViewModel viewModel, IValueModel model)
Returns the newly created mapper that maps theValue
to view model.EnumValueControlViewModel
createViewModel(IValueModel model)
Creates a view model for the givenmodel
.protected List<ReferenceValue>
getComboItems(IValueModel model)
Returns combo items for enum component.org.eclipse.emf.ecore.EStructuralFeature
getViewModelBindingFeature()
Returns the view model feature that is binds by value component.boolean
hasClearAction(EnumValueControlViewModel viewModel, IValueModel model)
Returnstrue
if the value component should create clear action button for the given model.protected boolean
showEmpty()
Returnstrue
if is needed to show empty value.-
Methods inherited from class com._1c.g5.v8.dt.md.ui.aef.components.value.AbstractReferenceValueComponentPart
getContainer, getContainer, getTypeName, isSuitableContainer, isSuitableValue
-
Methods inherited from class com._1c.g5.v8.dt.md.ui.aef.components.value.AbstractValueComponentPart
handleButtonPressed, isEditable, isSuitable, isSuitableTypeName
-
-
-
-
Method Detail
-
bindViewModel
public void bindViewModel(EnumValueControlViewModel viewModel, IValueModel model, IMapper<ReferenceValue,?> mapper)
Description copied from interface:IValueComponentPart
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 usingIValueComponentPart.getViewModelBindingFeature()
and#createMapper()
is not enough.- Specified by:
bindViewModel
in interfaceIValueComponentPart<EnumValueControlViewModel,IValueModel,ReferenceValue>
- Overrides:
bindViewModel
in classAbstractValueComponentPart<EnumValueControlViewModel,ReferenceValue>
- Parameters:
viewModel
- the view model to bind.model
- theIValueModel
.mapper
- theIMapper
instance.
-
createViewModel
public EnumValueControlViewModel createViewModel(IValueModel model)
Description copied from interface:IValueComponentPart
Creates a view model for the givenmodel
.- Parameters:
model
- theIValueModel
.- Returns:
- the newly created view model.
-
getViewModelBindingFeature
public org.eclipse.emf.ecore.EStructuralFeature getViewModelBindingFeature()
Description copied from interface:IValueComponentPart
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
public IMapper<ReferenceValue,?> createMapper(EnumValueControlViewModel viewModel, IValueModel model)
Description copied from interface:IValueComponentPart
Returns the newly created mapper that maps theValue
to view model.- Parameters:
viewModel
- the view model.model
- theIValueModel
.- Returns:
- the mapper.
-
hasClearAction
public boolean hasClearAction(EnumValueControlViewModel viewModel, IValueModel model)
Description copied from interface:IValueComponentPart
Returnstrue
if the value component should create clear action button for the given model.- Specified by:
hasClearAction
in interfaceIValueComponentPart<EnumValueControlViewModel,IValueModel,ReferenceValue>
- Overrides:
hasClearAction
in classAbstractValueComponentPart<EnumValueControlViewModel,ReferenceValue>
- Parameters:
viewModel
- the view model.model
- theIValueModel
.- Returns:
true
if the clear action button is required.
-
showEmpty
protected boolean showEmpty()
Returnstrue
if is needed to show empty value.- Returns:
true
if is needed to show empty value.
-
getComboItems
protected List<ReferenceValue> getComboItems(IValueModel model)
Returns combo items for enum component.- Parameters:
model
- the value model- Returns:
- combo items for enum component
-
-