Class CmsSmallElementsHandler

java.lang.Object
org.opencms.ade.containerpage.client.ui.CmsSmallElementsHandler

public class CmsSmallElementsHandler extends 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
    The height necessary for a container page element.
    static String
    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

    Modifier and Type
    Method
    Description
    boolean
    Returns true if currently small elements are editable.
    boolean
    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 Details

    • NECESSARY_HEIGHT

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

      The height necessary for a container page element CSS rule.
  • Constructor Details

    • 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 Details

    • 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