Class PredefinedValueComponentPart
- 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<PredefinedValueControlViewModel>
-
- com._1c.g5.v8.dt.md.ui.aef.components.value.PredefinedValueComponentPart
-
- All Implemented Interfaces:
IValueComponentPart<PredefinedValueControlViewModel,IValueModel,ReferenceValue>
public class PredefinedValueComponentPart extends AbstractReferenceValueComponentPart<PredefinedValueControlViewModel>
TheIValueComponentPart
implementation forReferenceValue
with innerCatalogPredefinedItem
orChartOfCharacteristicTypesPredefinedItem
.
-
-
Constructor Summary
Constructors Constructor Description PredefinedValueComponentPart()
Creates a new component part.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindViewModel(PredefinedValueControlViewModel viewModel, IValueModel valueModel, IMapper<ReferenceValue,?> mapper)
Binds the given view model to model.IMapper<ReferenceValue,?>
createMapper(PredefinedValueControlViewModel viewModel, IValueModel model)
Returns the newly created mapper that maps theValue
to view model.PredefinedValueControlViewModel
createViewModel(IValueModel 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(PredefinedValueControlViewModel viewModel, IValueModel model)
Handles the button events.boolean
hasClearAction(PredefinedValueControlViewModel viewModel, IValueModel model)
Returnstrue
if the value component should create clear action button for the given model.protected boolean
isSuitableContainer(MdObject mdObject)
Returnstrue
if the given object is suitable for component part.-
Methods inherited from class com._1c.g5.v8.dt.md.ui.aef.components.value.AbstractReferenceValueComponentPart
getContainer, getContainer, getTypeName, isSuitableValue
-
Methods inherited from class com._1c.g5.v8.dt.md.ui.aef.components.value.AbstractValueComponentPart
isEditable, isSuitable, isSuitableTypeName
-
-
-
-
Method Detail
-
createViewModel
public PredefinedValueControlViewModel createViewModel(IValueModel model)
Description copied from interface:IValueComponentPart
Creates a view model for the givenmodel
.- Parameters:
model
- theIValueModel
.- Returns:
- the newly created view model.
-
handleButtonPressed
public void handleButtonPressed(PredefinedValueControlViewModel viewModel, IValueModel model)
Description copied from interface:IValueComponentPart
Handles the button events.- Specified by:
handleButtonPressed
in interfaceIValueComponentPart<PredefinedValueControlViewModel,IValueModel,ReferenceValue>
- Overrides:
handleButtonPressed
in classAbstractValueComponentPart<PredefinedValueControlViewModel,ReferenceValue>
- Parameters:
viewModel
- the view model.model
- theIValueModel
.
-
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
.
-
bindViewModel
public void bindViewModel(PredefinedValueControlViewModel viewModel, IValueModel valueModel, 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<PredefinedValueControlViewModel,IValueModel,ReferenceValue>
- Overrides:
bindViewModel
in classAbstractValueComponentPart<PredefinedValueControlViewModel,ReferenceValue>
- Parameters:
viewModel
- the view model to bind.valueModel
- theIValueModel
.mapper
- theIMapper
instance.
-
createMapper
public IMapper<ReferenceValue,?> createMapper(PredefinedValueControlViewModel 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(PredefinedValueControlViewModel 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<PredefinedValueControlViewModel,IValueModel,ReferenceValue>
- Overrides:
hasClearAction
in classAbstractValueComponentPart<PredefinedValueControlViewModel,ReferenceValue>
- Parameters:
viewModel
- the view model.model
- theIValueModel
.- Returns:
true
if the clear action button is required.
-
isSuitableContainer
protected boolean isSuitableContainer(MdObject mdObject)
Description copied from class:AbstractReferenceValueComponentPart
Returnstrue
if the given object is suitable for component part.- Overrides:
isSuitableContainer
in classAbstractReferenceValueComponentPart<PredefinedValueControlViewModel>
- Parameters:
mdObject
- theMdObject
.- Returns:
true
if the given object is suitable for component part.
-
-