Class DefaultReferenceEditor<T>
- java.lang.Object
-
- com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware
-
- com.hybris.cockpitng.editor.commonreferenceeditor.AbstractReferenceEditor<T,T>
-
- com.hybris.cockpitng.editor.defaultreferenceeditor.DefaultReferenceEditor<T>
-
- All Implemented Interfaces:
ReferenceEditorLogic<T>,CockpitEditorRenderer<T>,ComponentWidgetAdapterAware
- Direct Known Subclasses:
DefaultFixedReferenceEditor
public class DefaultReferenceEditor<T> extends AbstractReferenceEditor<T,T> implements CockpitEditorRenderer<T>
Reference editor
-
-
Field Summary
-
Fields inherited from class com.hybris.cockpitng.editor.commonreferenceeditor.AbstractReferenceEditor
editorLayout, pageable, pageSize, PARAM_AVAILABLE_VALUES_PROVIDER, PARAM_CREATE_ONLY, PARAM_DISABLE_DISPLAYING_DETAILS, PARAM_DISABLE_REMOVE_REFERENCE, PARAM_LABEL_PROVIDER_BEAN, PARAM_NESTED_CREATION_DISABLED, PARAM_PAGE_SIZE, PARAM_PLACEHOLDER_KEY, PARAM_REDIRECT_REFERENCE_SELECTED_SOCKET_ID, PARAM_REFERENCE_ADVANCED_SEARCH_ENABLED, PARAM_RESTRICT_TO_TYPE, PARAM_WHITELISTED_TYPES, PARENT_OBJECT, renderOnDemandSize, selectedItemsMaxSize, SOCKET_IN_REFERENCE_EDITOR, SOCKET_OUT_REFERENCE_EDITOR, SOCKET_OUT_REFERENCE_SEARCH_CTX, SOCKET_OUT_REFRENCE_SELECTED, TYPE_CODE
-
Fields inherited from interface com.hybris.cockpitng.editors.CockpitEditorRenderer
INITIAL_EDIT_STRING
-
-
Constructor Summary
Constructors Constructor Description DefaultReferenceEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectedObject(T obj)Inform editor that user select new objectvoidforwardEditorEvent(java.lang.String eventCode)Forwards event to editor listener.protected java.util.regex.PatterngetRegexEditorPattern()The pattern should match when the editor may be applied.booleanisEditable()java.lang.StringreadTypeCode(java.lang.String valueType)voidrefreshObjects(java.util.Collection<T> objects)Informs editor to update objects in modelvoidremoveSelectedObject(T obj)Inform editor that user remove object from selected items listvoidrender(org.zkoss.zk.ui.Component parent, EditorContext<T> context, EditorListener<T> listener)Creates a new editor component and attaches it to the specifiedComponentcomponent.protected voidsetEditorParameters(EditorContext<T> context)protected voidsetInitialValue(EditorContext<T> context)-
Methods inherited from class com.hybris.cockpitng.editor.commonreferenceeditor.AbstractReferenceEditor
allowNestedObjectCreation, createInputSocketEventListener, createNewReference, createNewReference, createReferenceLayout, extractPageSize, findAncestorEditor, getCockpitConfigurationService, getCockpitUserService, getCustomValuesProviderBeanId, getEditorContext, getEditorLayout, getEditorListener, getLabelProvider, getLabelProviderBeanName, getLabelService, getObjectFacade, getPageable, getParentEditor, getParentObject, getPermissionFacade, getPlaceholderKey, getPropertyValueService, getRedirectReferenceSelectedToParentWidget, getReferenceEditorSearchConditionHandler, getReferenceEditorSearchFacade, getReferenceSearchConditions, getReferenceSearchContextMap, getStringRepresentationOfObject, getSuccessNotificationId, getTypeCode, getTypeFacade, isDisableDisplayingDetails, isDisableRemoveReference, isOnlyCreateMode, isReferenceAdvancedSearchEnabled, loadBaseConfiguration, loadBaseConfiguration, loadSimpleSearchConfiguration, openReferenceAdvancedSearch, preserveFocus, resolveTypeToCreate, restrictTypeCode, setCommonEditorParameters, setCreateOnly, setEditorContext, setEditorLayout, setEditorListener, setLabelProviderBeanName, setNestedObjectCreationDisabled, setPageSize, setParentEditor, setParentObject, setReferenceSearchConditions, setRenderOnDemandSize, setSelectedItemsMaxSize, setSuccessNotificationId, setTypeCode, triggerReferenceSelected, updateReferencesListBoxModel, updateReferencesListBoxModel
-
Methods inherited from class com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware
addSocketInputEventListener, getComponentID, handleSocketInputEvent, initialize, initializeDefaultEventListeners, registerStubInstance, sendOutput, setComponentID, unregisterStubInstance
-
-
-
-
Method Detail
-
render
public void render(org.zkoss.zk.ui.Component parent, EditorContext<T> context, EditorListener<T> listener)Description copied from interface:CockpitEditorRendererCreates a new editor component and attaches it to the specifiedComponentcomponent.- Specified by:
renderin interfaceCockpitEditorRenderer<T>- Parameters:
parent- parent component the editor should be attached tocontext- the context for the editor creationlistener- the listener to notify the rest of the world about value changes and other events
-
setEditorParameters
protected void setEditorParameters(EditorContext<T> context)
-
setInitialValue
protected void setInitialValue(EditorContext<T> context)
-
addSelectedObject
public void addSelectedObject(T obj)
Description copied from interface:ReferenceEditorLogicInform editor that user select new object- Specified by:
addSelectedObjectin interfaceReferenceEditorLogic<T>
-
removeSelectedObject
public void removeSelectedObject(T obj)
Description copied from interface:ReferenceEditorLogicInform editor that user remove object from selected items list- Specified by:
removeSelectedObjectin interfaceReferenceEditorLogic<T>
-
refreshObjects
public void refreshObjects(java.util.Collection<T> objects)
Description copied from interface:ReferenceEditorLogicInforms editor to update objects in model- Specified by:
refreshObjectsin interfaceReferenceEditorLogic<T>
-
forwardEditorEvent
public void forwardEditorEvent(java.lang.String eventCode)
Description copied from interface:ReferenceEditorLogicForwards event to editor listener.- Specified by:
forwardEditorEventin interfaceReferenceEditorLogic<T>- Parameters:
eventCode- event code.
-
isEditable
public boolean isEditable()
- Specified by:
isEditablein interfaceReferenceEditorLogic<T>- Returns:
- whether editor is in editable or readonly state
-
getRegexEditorPattern
protected java.util.regex.Pattern getRegexEditorPattern()
Description copied from class:AbstractReferenceEditorThe pattern should match when the editor may be applied. If the pattern's matcher matches it should guarantee that group(1) on it's matcher returns the type code.- Specified by:
getRegexEditorPatternin classAbstractReferenceEditor<T,T>- Returns:
- Pattern that identifies the editor
- See Also:
Pattern,Matcher
-
readTypeCode
public java.lang.String readTypeCode(java.lang.String valueType)
- Specified by:
readTypeCodein classAbstractReferenceEditor<T,T>
-
-