Class AbstractReferenceEditor<T,​K>

    • Field Detail

      • PARAM_AVAILABLE_VALUES_PROVIDER

        public static final java.lang.String PARAM_AVAILABLE_VALUES_PROVIDER
        See Also:
        Constant Field Values
      • PARAM_RESTRICT_TO_TYPE

        public static final java.lang.String PARAM_RESTRICT_TO_TYPE
        See Also:
        Constant Field Values
      • PARAM_DISABLE_DISPLAYING_DETAILS

        public static final java.lang.String PARAM_DISABLE_DISPLAYING_DETAILS
        See Also:
        Constant Field Values
      • PARAM_PLACEHOLDER_KEY

        public static final java.lang.String PARAM_PLACEHOLDER_KEY
        See Also:
        Constant Field Values
      • PARAM_DISABLE_REMOVE_REFERENCE

        public static final java.lang.String PARAM_DISABLE_REMOVE_REFERENCE
        See Also:
        Constant Field Values
      • PARAM_NESTED_CREATION_DISABLED

        public static final java.lang.String PARAM_NESTED_CREATION_DISABLED
        See Also:
        Constant Field Values
      • PARAM_CREATE_ONLY

        public static final java.lang.String PARAM_CREATE_ONLY
        See Also:
        Constant Field Values
      • PARAM_REFERENCE_ADVANCED_SEARCH_ENABLED

        public static final java.lang.String PARAM_REFERENCE_ADVANCED_SEARCH_ENABLED
        See Also:
        Constant Field Values
      • PARAM_REDIRECT_REFERENCE_SELECTED_SOCKET_ID

        public static final java.lang.String PARAM_REDIRECT_REFERENCE_SELECTED_SOCKET_ID
        See Also:
        Constant Field Values
      • PARAM_WHITELISTED_TYPES

        public static final java.lang.String PARAM_WHITELISTED_TYPES
        See Also:
        Constant Field Values
      • PARAM_LABEL_PROVIDER_BEAN

        public static final java.lang.String PARAM_LABEL_PROVIDER_BEAN
        See Also:
        Constant Field Values
      • SOCKET_IN_REFERENCE_EDITOR

        protected static final java.lang.String SOCKET_IN_REFERENCE_EDITOR
        See Also:
        Constant Field Values
      • SOCKET_OUT_REFERENCE_EDITOR

        protected static final java.lang.String SOCKET_OUT_REFERENCE_EDITOR
        See Also:
        Constant Field Values
      • SOCKET_OUT_REFRENCE_SELECTED

        protected static final java.lang.String SOCKET_OUT_REFRENCE_SELECTED
        See Also:
        Constant Field Values
      • SOCKET_OUT_REFERENCE_SEARCH_CTX

        protected static final java.lang.String SOCKET_OUT_REFERENCE_SEARCH_CTX
        See Also:
        Constant Field Values
      • pageSize

        protected int pageSize
      • selectedItemsMaxSize

        protected int selectedItemsMaxSize
      • renderOnDemandSize

        protected int renderOnDemandSize
    • Constructor Detail

      • AbstractReferenceEditor

        public AbstractReferenceEditor()
    • Method Detail

      • loadBaseConfiguration

        protected Base loadBaseConfiguration​(java.lang.String typeCode,
                                             EditorContext<T> context)
      • updateReferencesListBoxModel

        public void updateReferencesListBoxModel​(java.lang.String textQuery)
        Updates search state based on the given text query.
        Specified by:
        updateReferencesListBoxModel in interface ReferenceEditorLogic<T>
        Parameters:
        textQuery -
      • getReferenceSearchContextMap

        public java.util.Map<java.lang.String,​java.lang.Object> getReferenceSearchContextMap()
      • loadSimpleSearchConfiguration

        protected SimpleSearch loadSimpleSearchConfiguration()
        Loads cockpit configuration for simple-search for the given typeCode
        Returns:
        SimpleSearch
      • setPageSize

        protected void setPageSize​(int pageSize)
        Parameters:
        pageSize - size of the page
      • setSelectedItemsMaxSize

        protected void setSelectedItemsMaxSize​(int size)
      • setRenderOnDemandSize

        protected void setRenderOnDemandSize​(int renderOnDemandSize)
      • restrictTypeCode

        protected void restrictTypeCode​(java.lang.Object restrictToTypeValue)
      • setCommonEditorParameters

        protected void setCommonEditorParameters​(java.util.Map<java.lang.String,​java.lang.Object> parametersFromConfig)
      • getSuccessNotificationId

        public java.lang.String getSuccessNotificationId()
      • setSuccessNotificationId

        public void setSuccessNotificationId​(java.lang.String successNotificationId)
      • extractPageSize

        protected int extractPageSize​(java.lang.Object parameterPageSize)
        Tries to extract page size from the object passed. In case of failure returns DEFAULT_PAGE_SIZE
      • readTypeCode

        public abstract java.lang.String readTypeCode​(java.lang.String valueType)
      • getRegexEditorPattern

        protected abstract java.util.regex.Pattern getRegexEditorPattern()
        The 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.
        Returns:
        Pattern that identifies the editor
        See Also:
        Pattern, Matcher
      • getReferenceEditorSearchFacade

        public ReferenceEditorSearchFacade<T> getReferenceEditorSearchFacade()
        Returns:
        the referenceEditorSearchFacade
      • getTypeFacade

        public TypeFacade getTypeFacade()
      • getLabelService

        public LabelService getLabelService()
        Returns:
        the labelService
      • getLabelProvider

        public java.util.Optional<LabelProvider<T>> getLabelProvider()
      • setEditorLayout

        protected void setEditorLayout​(ReferenceEditorLayout<T> editorLayout)
        Parameters:
        editorLayout - the editorLayout to set
      • setTypeCode

        protected void setTypeCode​(java.lang.String typeCode)
        Parameters:
        typeCode - the typeCode to set
      • getParentEditor

        protected Editor getParentEditor()
        Returns:
        the parentEditor
      • setParentEditor

        protected void setParentEditor​(Editor parentEditor)
        Parameters:
        parentEditor - the parentEditor to set
      • createInputSocketEventListener

        protected org.zkoss.zk.ui.event.EventListener createInputSocketEventListener()
        Returns:
      • resolveTypeToCreate

        protected java.lang.String resolveTypeToCreate​(java.lang.String type)
      • setNestedObjectCreationDisabled

        public void setNestedObjectCreationDisabled​(boolean nestedCreationDisabled)
      • setCreateOnly

        public void setCreateOnly​(boolean createOnly)
      • triggerReferenceSelected

        public void triggerReferenceSelected​(java.lang.Object selected)
        Description copied from interface: ReferenceEditorLogic
        Triggers selected reference socktet output to outside widgets

        Specified by:
        triggerReferenceSelected in interface ReferenceEditorLogic<T>
        Parameters:
        selected - reference currently selected
      • getRedirectReferenceSelectedToParentWidget

        protected java.lang.String getRedirectReferenceSelectedToParentWidget()
      • getCustomValuesProviderBeanId

        protected java.lang.String getCustomValuesProviderBeanId()
        Extracts from editor parameters bean id of available values provider PARAM_AVAILABLE_VALUES_PROVIDER.
        Returns:
        bean id if parameter value is not blank String or null.
      • getParentObject

        public java.lang.Object getParentObject()
      • setParentObject

        public void setParentObject​(java.lang.Object parentObject)
      • findAncestorEditor

        protected Editor findAncestorEditor​(org.zkoss.zk.ui.Component component)
        find first component in hierarchy which is an Editor
        Parameters:
        component -
        Returns:
      • getPlaceholderKey

        public java.lang.String getPlaceholderKey()
      • setEditorContext

        public void setEditorContext​(EditorContext<K> editorContext)
      • setEditorListener

        public void setEditorListener​(EditorListener<K> editorListener)
      • getReferenceSearchConditions

        public java.util.Map<java.lang.String,​java.lang.Object> getReferenceSearchConditions()
      • setReferenceSearchConditions

        public void setReferenceSearchConditions​(java.util.Map<java.lang.String,​java.lang.Object> referenceSearchConditions)
      • getLabelProviderBeanName

        protected java.util.Optional<java.lang.String> getLabelProviderBeanName()
      • setLabelProviderBeanName

        public void setLabelProviderBeanName​(java.lang.Object labelProviderBeanName)