Class CmsUniqueActiveItemContainer


  • public class CmsUniqueActiveItemContainer
    extends java.lang.Object
    Container which contains at most one I_CmsUniqueActiveItem.

    If a new value is set while this container already contains an item, the previous item is removed and notified of that removal.

    • Method Detail

      • clear

        public void clear()
        Removes the current item.
      • clearIfMatches

        public void clearIfMatches​(I_CmsUniqueActiveItem item)
        Removes the current item only if it is the same object as the given parameter.

        Parameters:
        item - the item to match
      • setActiveItem

        public void setActiveItem​(I_CmsUniqueActiveItem item)
        Sets the active item.

        If this container already contains an item, it is replaced with the given item, and its onDeactivate() method is called.

        Parameters:
        item - the new item