Class EditorsVisitor
- java.lang.Object
-
- com.hybris.cockpitng.widgets.common.dynamicforms.impl.visitors.AbstractComponentsVisitor<Editor,DynamicAttribute>
-
- com.hybris.cockpitng.widgets.common.dynamicforms.impl.visitors.EditorsVisitor
-
- All Implemented Interfaces:
ComponentsVisitor
- Direct Known Subclasses:
EditorAreaEditorsVisitor
public class EditorsVisitor extends AbstractComponentsVisitor<Editor,DynamicAttribute>
Visitor ofEditorform UI elements. Uses as a configurationDynamicForms.getAttribute()
-
-
Field Summary
-
Fields inherited from interface com.hybris.cockpitng.widgets.common.dynamicforms.ComponentsVisitor
COMPONENT_CTX, MODEL_ROOT, NULL
-
-
Constructor Summary
Constructors Constructor Description EditorsVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyDisabledIf(java.util.Collection<Editor> editors, DynamicAttribute dynamicAttribute, java.lang.Object target)protected voidapplyVisibleIf(java.util.Collection<Editor> editors, DynamicAttribute dynamicAttribute, java.lang.Object target)protected booleancanHandle(org.zkoss.zk.ui.Component component)Decides if component can be handled by the visitor.protected java.lang.ObjectcomputeValue(java.lang.Object target, DynamicAttribute dynamicAttribute)protected voiddisableEditor(Editor editor, boolean disabled)protected java.lang.StringgetComponentKey(Editor component)Gets component's name key which is used to map components with dynamic forms throughAbstractDynamicElement.getQualifier().protected java.util.List<DynamicAttribute>getDynamicElements()Extracts elements of typefrom DynamicForms.java.lang.StringgetElementQualifierKey(DynamicAttribute dynamicElement)Gets qualifier of. protected java.util.Set<java.util.Locale>getLanguagesToSetValue(DynamicAttribute dynamicAttribute, java.lang.Object target)protected booleanisAttributeLocalized(DynamicAttribute dynamicAttribute)protected booleanisDisabled(DynamicAttribute element, java.lang.Object target)Checks configuration fromAbstractDynamicElement.disabledIfagainst target object.protected voidmodifyEditorsParameter(java.util.Collection<Editor> editors, java.lang.String paramName, java.lang.Object computedValue)protected voidsetAttributeValue(java.lang.Object target, DynamicAttribute dynamicAttribute, java.lang.Object computedValue)protected voidvisitComponents(DynamicAttribute dynamicAttribute, java.lang.Object target, boolean initial)Visits components for dynamic element.-
Methods inherited from class com.hybris.cockpitng.widgets.common.dynamicforms.impl.visitors.AbstractComponentsVisitor
canChangeProperty, canReadProperty, cleanUp, cleanUpInternal, getComponentKeyComponentsMap, getDataType, getDefaultScriptingConfig, getDynamicForms, getExpressionEvaluator, getPathToAttributeInModel, getPathToAttributeInModel, getPermissionFacade, getTargetObject, getTypeCode, getTypeFacade, getWidgetInstanceManager, initialize, isVisible, register, setExpressionEvaluator, setPermissionFacade, setTypeFacade, unRegister
-
-
-
-
Method Detail
-
canHandle
protected boolean canHandle(org.zkoss.zk.ui.Component component)
Description copied from class:AbstractComponentsVisitorDecides if component can be handled by the visitor.- Specified by:
canHandlein classAbstractComponentsVisitor<Editor,DynamicAttribute>- Parameters:
component- component to accept.- Returns:
- true if components should be accepted by visitor.
-
getComponentKey
protected java.lang.String getComponentKey(Editor component)
Description copied from class:AbstractComponentsVisitorGets component's name key which is used to map components with dynamic forms throughAbstractDynamicElement.getQualifier().- Specified by:
getComponentKeyin classAbstractComponentsVisitor<Editor,DynamicAttribute>- Parameters:
component- component which id should be returned.- Returns:
- extracted key of a component.
-
getElementQualifierKey
public java.lang.String getElementQualifierKey(DynamicAttribute dynamicElement)
Description copied from class:AbstractComponentsVisitorGets qualifier of. For components which AbstractComponentsVisitor.getComponentKey(Component)cannot be directly mapped to aAbstractDynamicElement.getQualifier()the method should be overridden so for matching components andvalues from these two methods should be equal. - Overrides:
getElementQualifierKeyin classAbstractComponentsVisitor<Editor,DynamicAttribute>- Parameters:
dynamicElement- element of which qualifier should be returned.- Returns:
- qualifier of a element.
-
getDynamicElements
protected java.util.List<DynamicAttribute> getDynamicElements()
Description copied from class:AbstractComponentsVisitorExtracts elements of typefrom DynamicForms.- Specified by:
getDynamicElementsin classAbstractComponentsVisitor<Editor,DynamicAttribute>- Returns:
- list of
to use in configuration.
-
visitComponents
protected void visitComponents(DynamicAttribute dynamicAttribute, java.lang.Object target, boolean initial)
Description copied from class:AbstractComponentsVisitorVisits components for dynamic element.- Specified by:
visitComponentsin classAbstractComponentsVisitor<Editor,DynamicAttribute>- Parameters:
dynamicAttribute- dynamic forms element configuration.target- currently displayed object.initial- flag which says if this is initial visit before any interaction with user.
-
modifyEditorsParameter
protected void modifyEditorsParameter(java.util.Collection<Editor> editors, java.lang.String paramName, java.lang.Object computedValue)
-
applyVisibleIf
protected void applyVisibleIf(java.util.Collection<Editor> editors, DynamicAttribute dynamicAttribute, java.lang.Object target)
-
applyDisabledIf
protected void applyDisabledIf(java.util.Collection<Editor> editors, DynamicAttribute dynamicAttribute, java.lang.Object target)
-
disableEditor
protected void disableEditor(Editor editor, boolean disabled)
-
isDisabled
protected boolean isDisabled(DynamicAttribute element, java.lang.Object target)
Description copied from class:AbstractComponentsVisitorChecks configuration fromAbstractDynamicElement.disabledIfagainst target object.- Overrides:
isDisabledin classAbstractComponentsVisitor<Editor,DynamicAttribute>- Parameters:
element- element of configurationtarget- target object- Returns:
- true if component should be disabled
-
computeValue
protected java.lang.Object computeValue(java.lang.Object target, DynamicAttribute dynamicAttribute)
-
setAttributeValue
protected void setAttributeValue(java.lang.Object target, DynamicAttribute dynamicAttribute, java.lang.Object computedValue)
-
isAttributeLocalized
protected boolean isAttributeLocalized(DynamicAttribute dynamicAttribute)
-
getLanguagesToSetValue
protected java.util.Set<java.util.Locale> getLanguagesToSetValue(DynamicAttribute dynamicAttribute, java.lang.Object target)
-
-