Class AbstractMessageFilterMenuItem<T extends MessageInfo>

    • Constructor Detail

      • AbstractMessageFilterMenuItem

        public AbstractMessageFilterMenuItem​(java.lang.String name)
        Constructs a MessageFilterMenuItem with the given name. Please ensure to use a unique name. The name will be used to build the link to the custom view. If you would like to use a different name to be displayed in the frontend please use the AbstractMessageFilterMenuItem#setDisplayName(String) method.
        Parameters:
        name - the unique name to identify this instance of MessageFilterMenuItem
        Since:
        12.0
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface com.novomind.ecom.common.api.attribute.Named
        Returns:
        the name of the custom message filter menu item.
        Since:
        12.0
      • getDisplayName

        public java.lang.String getDisplayName()
        Specified by:
        getDisplayName in interface com.novomind.ecom.common.api.attribute.DisplayNamed
        Returns:
        the displayName of the custom message filter menu item
        Since:
        12.0
      • setDisplayName

        public MessageFilterMenuItem<T> setDisplayName​(java.lang.String displayName)
        Set the displayName for the custom message filter menu item
        Parameters:
        displayName - the alternative displayName to display the menu entry
        Returns:
        this
        Since:
        12.0
      • getSubMenuItems

        public java.util.List<MessageFilterMenuItem<T>> getSubMenuItems()
        Returns:
        the sub menu items
        Since:
        12.0
      • addSubMenuItem

        public MessageFilterMenuItem<T> addSubMenuItem​(MessageFilterMenuItem<T> messageFilterMenuItem)
        Adds a new MessageFilterMenuItem to this item. The added child item cannot have any children itself. Any children of the added child item will be ignored.
        Parameters:
        messageFilterMenuItem - the sub menu item to be added
        Returns:
        this
        Since:
        12.0
      • setFilter

        public MessageFilterMenuItem<T> setFilter​(java.util.function.Predicate<T> filter)
        The method allows to filter the messages displayed in the view that is linked to this MessageFilterMenuItem by setting a filter predicate. ************************** !!! IMPORTANT NOTE !!! **************************************** Please note that the applied filter predicate will be evaluated multiple times within frequent loops. The implementation must guarantee high performance and avoid heap garbage. Please do not implement any long term operations like web service calls or database lookups within the filter predicate. ******************************************************************************************
        Specified by:
        setFilter in interface MessageFilterMenuItem<T extends MessageInfo>
        Parameters:
        filter - The filter predicate to make a filter decision for a message to be displayed in the view linked to this MessageFilterMenuItem. If the parameter is null then no filter is applied and all messages will be displayed in the linked view of this menu entry.
        Returns:
        this
        Since:
        12.0
      • setIgnoreVisibility

        public MessageFilterMenuItem<T> setIgnoreVisibility​(boolean ignoreVisibility)
        The method allows to disable or enabled the user's category visibility restrictions for the view linked to this MessageFilterMenuItem. If the ignoreVisibility parameter is set to true then the view will not be pre-filtered by the user's category visibility restrictions.
        Specified by:
        setIgnoreVisibility in interface MessageFilterMenuItem<T extends MessageInfo>
        Parameters:
        ignoreVisibility - the ignoreVisibility option for this menu item
        Returns:
        this
        Since:
        12.0
      • getIgnoreVisibility

        public boolean getIgnoreVisibility()
        Specified by:
        getIgnoreVisibility in interface MessageFilterMenuItem<T extends MessageInfo>
        Returns:
        true if the messages displayed in the view linked to this MessageFilterMenuItem should not be pre-filtered by the user's category visibility restrictions, otherwise false
        Since:
        12.0