Class CmsSmallElementsHandler


  • public class CmsSmallElementsHandler
    extends java.lang.Object
    This class is responsible for managing the visibility of edit points on small elements.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int NECESSARY_HEIGHT
      The height necessary for a container page element.
      static java.lang.String NECESSARY_HEIGHT_RULE
      The height necessary for a container page element CSS rule.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsSmallElementsHandler​(org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageServiceAsync service)
      Creates a new small elements handler.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean areSmallElementsEditable()
      Returns true if currently small elements are editable.
      boolean hasSmallElements()
      Returns true if any small elements are present.
      protected void internalSetEditSmallElements​(boolean editable)
      Sets the mode for displaying small elements.
      static boolean isSmall​(com.google.gwt.user.client.ui.Widget widget)
      Checks if a given widget counts as 'small'.
      void prepareSmallElement​(com.google.gwt.user.client.ui.Widget widget)
      Prepares a small element.
      void setEditSmallElements​(boolean editable, boolean save)
      Enables or disables editing for small elements and optionally saves the setting.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NECESSARY_HEIGHT

        public static int NECESSARY_HEIGHT
        The height necessary for a container page element.
      • NECESSARY_HEIGHT_RULE

        public static java.lang.String NECESSARY_HEIGHT_RULE
        The height necessary for a container page element CSS rule.
    • Constructor Detail

      • CmsSmallElementsHandler

        public CmsSmallElementsHandler​(org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageServiceAsync service)
        Creates a new small elements handler.

        Parameters:
        service - the container page service
    • Method Detail

      • isSmall

        public static boolean isSmall​(com.google.gwt.user.client.ui.Widget widget)
        Checks if a given widget counts as 'small'.

        Parameters:
        widget - the widget to check
        Returns:
        true if the widget is small
      • areSmallElementsEditable

        public boolean areSmallElementsEditable()
        Returns true if currently small elements are editable.

        Returns:
        true if small elements are editable
      • hasSmallElements

        public boolean hasSmallElements()
        Returns true if any small elements are present.

        Returns:
        true if any small elements are present
      • prepareSmallElement

        public void prepareSmallElement​(com.google.gwt.user.client.ui.Widget widget)
        Prepares a small element.

        Parameters:
        widget - the small element
      • setEditSmallElements

        public void setEditSmallElements​(boolean editable,
                                         boolean save)
        Enables or disables editing for small elements and optionally saves the setting.

        Parameters:
        editable - if true, enables editing for small elements
        save - true if the setting should be saved
      • internalSetEditSmallElements

        protected void internalSetEditSmallElements​(boolean editable)
        Sets the mode for displaying small elements.

        Parameters:
        editable - if true, small elements will be enlarged and their edit buttons shown; if false, the edit buttons will be hidden