Class CmsContainerPageElementPanel

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.AbsolutePanel
org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.InsertPanel, com.google.gwt.user.client.ui.InsertPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Iterable<com.google.gwt.user.client.ui.Widget>, I_CmsInlineFormParent, I_CmsDraggable
Direct Known Subclasses:
CmsGroupContainerElementPanel

public class CmsContainerPageElementPanel extends com.google.gwt.user.client.ui.AbsolutePanel implements I_CmsDraggable, com.google.gwt.event.dom.client.HasClickHandlers, I_CmsInlineFormParent
Content element within a container-page.

Since:
8.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Parses CSS classess of the form 'oc-point-TY_LX', where X and Y are strings of decimal digits possibly preceded by a minus sign.

    Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

    com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled

    Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets

    com.google.gwt.user.client.ui.HasWidgets.ForIsWidget

    Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel

    com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget

    Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel

    com.google.gwt.user.client.ui.InsertPanel.ForIsWidget
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Highlighting border for this element.
    static final String
    Property used to mark an element as belonging to this widget.
    static final String
    The is model group property key.
    static final String
    The former copy model property.

    Fields inherited from class com.google.gwt.user.client.ui.UIObject

    DEBUG_ID_PREFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmsContainerPageElementPanel(com.google.gwt.dom.client.Element element, I_CmsDropContainer parent, String clientId, String sitePath, String noEditReason, org.opencms.ade.containerpage.shared.CmsElementLockInfo lockInfo, String title, String subTitle, String resourceType, boolean hasSettings, boolean hasViewPermission, boolean hasWritePermission, boolean releasedAndNotExpired, boolean disableNewEditor, boolean hasEditHandler, org.opencms.util.CmsUUID modelGroupId, boolean wasModelGroup, org.opencms.util.CmsUUID elementView, String iconClasses, boolean isReused)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.gwt.event.shared.HandlerRegistration
    addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
     
    void
    adoptWidget(com.google.gwt.user.client.ui.IsWidget widget)
    Adopts the given widget as a child widget.
    protected void
    Checks for changes in the list collector direct edit content.
    com.google.common.base.Optional<int[]>
    Gets an optional pair of integers which are to be used as an "offset delta" for the drag and drop process.
    com.google.gwt.dom.client.Element
    Creates the drag helper element and attaches it into the DOM.
    protected List<com.google.gwt.dom.client.Element>
    Gets the editable list elements.
    Returns the option bar of this element.
    org.opencms.util.CmsUUID
    Returns the elements element view.
    Returns the draggable id.
    org.opencms.ade.containerpage.shared.CmsInheritanceInfo
    Returns the inheritance info for this element.
    org.opencms.ade.containerpage.shared.CmsElementLockInfo
    Gets the lock information.
    org.opencms.util.CmsUUID
    Returns the model group id.
    Returns the new element type.
    Returns the no edit reason.
    Gets the random id identifying this widget.
    Returns the parent drop target or null if there is none.
    com.google.gwt.dom.client.Element
    Creates the drag placeholder element.
    boolean
    Returns if the element resource is currently released and not expired.
    Returns the element resource type name.
    Returns the site-path.
    org.opencms.util.CmsUUID
    Returns the structure id of the element.
    protected boolean
    Returns if the list collector direct edit content has changed.
    boolean
    Indicates an edit handler is configured for the element resource type.
    boolean
    Returns whether this element has a model group parent.
    boolean
    In case the inner HTML contains the reload marker.
    boolean
    Returns true if the element has settings to edit.
    boolean
    Returns if the current user has view permissions for the element resource.
    boolean
    Returns if the user has write permission.
    void
    Hides list collector direct edit buttons, if present.
    void
    Puts a highlighting border around the element.
    void
    Initializes the editor click handler.
    boolean
    Checks if this element has 'createNew' status, i.e.
    boolean
    Returns whether the element is used as a model group.
    boolean
    Returns if this is e newly created element.
    boolean
    Returns true if the new content editor is disabled for this element.
    static boolean
    isOverlay(com.google.gwt.dom.client.Element element)
    Checks if the element is an overlay for a container page element.
    boolean
    Checks if this element is marked as reused.
    protected void
     
    void
    Executed on drag cancel.
    void
    Executed on drop.
    protected void
     
    void
    Executed on drag start.
    protected void
    Removes the inline editor handler.
    void
     
    void
    Removes the highlighting border.
    void
    Removes the inline editor.
    void
    Replaces the inner HTML of widget to reflect content data changes.
    void
    setCreateNew(boolean createNew)
    Sets the 'create new' status of the element.
    void
    Sets the element option bar.
    void
    Sets the element id.
    void
    setInheritanceInfo(org.opencms.ade.containerpage.shared.CmsInheritanceInfo inheritanceInfo)
    Sets the inheritance info for this element.
    void
    setNewType(String newType)
    Sets the new-type of the element.
    void
    setNoEditReason(String noEditReason)
    Sets the no edit reason.
    void
    setReleasedAndNotExpired(boolean releasedAndNotExpired)
    Sets if the element resource is currently released and not expired.
    void
    setSitePath(String sitePath)
    Sets the site path.
    void
    setViewPermission(boolean viewPermission)
    Sets if the current user has view permissions for the element resource.
    void
    setWritePermission(boolean writePermission)
    Sets the user write permission.
    void
    Shows list collector direct edit buttons (old direct edit style), if present.
    void
    Updates the option bar position.

    Methods inherited from class com.google.gwt.user.client.ui.AbsolutePanel

    add, add, add, getWidgetLeft, getWidgetTop, insert, insert, insert, remove, setWidgetPosition, setWidgetPositionImpl

    Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel

    add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove

    Methods inherited from class com.google.gwt.user.client.ui.Panel

    add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove

    Methods inherited from class com.google.gwt.user.client.ui.Widget

    addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onUnload, setLayoutData, sinkEvents, unsinkEvents

    Methods inherited from class com.google.gwt.user.client.ui.UIObject

    addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.gwt.event.shared.HasHandlers

    fireEvent

    Methods inherited from interface org.opencms.gwt.client.dnd.I_CmsDraggable

    getElement

    Methods inherited from interface org.opencms.acacia.client.I_CmsInlineFormParent

    getElement

    Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel

    getWidget, getWidgetCount, getWidgetIndex, remove

    Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget

    getWidgetIndex

    Methods inherited from interface com.google.gwt.user.client.ui.InsertPanel.ForIsWidget

    add

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

  • Constructor Details

    • CmsContainerPageElementPanel

      public CmsContainerPageElementPanel(com.google.gwt.dom.client.Element element, I_CmsDropContainer parent, String clientId, String sitePath, String noEditReason, org.opencms.ade.containerpage.shared.CmsElementLockInfo lockInfo, String title, String subTitle, String resourceType, boolean hasSettings, boolean hasViewPermission, boolean hasWritePermission, boolean releasedAndNotExpired, boolean disableNewEditor, boolean hasEditHandler, org.opencms.util.CmsUUID modelGroupId, boolean wasModelGroup, org.opencms.util.CmsUUID elementView, String iconClasses, boolean isReused)
      Constructor.

      Parameters:
      element - the DOM element
      parent - the drag parent
      clientId - the client id
      sitePath - the element site-path
      noEditReason - the no edit reason, if empty, editing is allowed
      lockInfo - the lock information
      title - the resource title
      subTitle - the sub title
      resourceType - the resource type
      hasSettings - should be true if the element has settings which can be edited
      hasViewPermission - indicates if the current user has view permissions on the element resource
      hasWritePermission - indicates if the current user has write permissions on the element resource
      releasedAndNotExpired - true if the element resource is currently released and not expired
      disableNewEditor - flag to disable the new editor for this element
      hasEditHandler - indicates an edit handler is configured for the element resource type
      modelGroupId - the model group id
      wasModelGroup - in case of a former copy model group
      elementView - the element view of the element
      iconClasses - the resource type icon CSS classes
      isReused - true if this element is marked as reused
  • Method Details

    • isOverlay

      public static boolean isOverlay(com.google.gwt.dom.client.Element element)
      Checks if the element is an overlay for a container page element.

      Parameters:
      element - the element to check
      Returns:
      true if the element is an overlay
    • addClickHandler

      public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
      Specified by:
      addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlers
      See Also:
      • HasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
    • adoptWidget

      public void adoptWidget(com.google.gwt.user.client.ui.IsWidget widget)
      Description copied from interface: I_CmsInlineFormParent
      Adopts the given widget as a child widget.

      This assumes the widget element is already attached to the DOM and is a child or descendant of this widget element.

      Specified by:
      adoptWidget in interface I_CmsInlineFormParent
      Parameters:
      widget - the widget to adopt
      See Also:
    • getCursorOffsetDelta

      public com.google.common.base.Optional<int[]> getCursorOffsetDelta()
      Description copied from interface: I_CmsDraggable
      Gets an optional pair of integers which are to be used as an "offset delta" for the drag and drop process.

      Specified by:
      getCursorOffsetDelta in interface I_CmsDraggable
      Returns:
      an optional array containing exactly 2 entries [x,y]
      See Also:
    • getDragHelper

      public com.google.gwt.dom.client.Element getDragHelper(I_CmsDropTarget target)
      Description copied from interface: I_CmsDraggable
      Creates the drag helper element and attaches it into the DOM.

      Specified by:
      getDragHelper in interface I_CmsDraggable
      Parameters:
      target - the drop target
      Returns:
      the drag helper element
      See Also:
    • getElementOptionBar

      Returns the option bar of this element.

      Returns:
      the option bar widget
    • getElementView

      public org.opencms.util.CmsUUID getElementView()
      Returns the elements element view.

      Returns:
      the element view
    • getId

      public String getId()
      Description copied from interface: I_CmsDraggable
      Returns the draggable id.

      Specified by:
      getId in interface I_CmsDraggable
      Returns:
      the id
      See Also:
    • getInheritanceInfo

      public org.opencms.ade.containerpage.shared.CmsInheritanceInfo getInheritanceInfo()
      Returns the inheritance info for this element.

      Returns:
      the inheritance info for this element
    • getLockInfo

      public org.opencms.ade.containerpage.shared.CmsElementLockInfo getLockInfo()
      Gets the lock information.
      Returns:
      the lock information
    • getModelGroupId

      public org.opencms.util.CmsUUID getModelGroupId()
      Returns the model group id.

      Returns:
      the model group id
    • getNewType

      public String getNewType()
      Returns the new element type.
      Returns:
      the new element type
    • getNoEditReason

      Returns the no edit reason.

      Returns:
      the no edit reason
    • getObjectId

      public String getObjectId()
      Gets the random id identifying this widget.

      The id is also stored in the element_object_id property of the DOM element for this widget.

      Returns:
      the random id identifying this widget
    • getParentTarget

      Description copied from interface: I_CmsDraggable
      Returns the parent drop target or null if there is none.

      Specified by:
      getParentTarget in interface I_CmsDraggable
      Returns:
      the parent drop target
      See Also:
    • getPlaceholder

      public com.google.gwt.dom.client.Element getPlaceholder(I_CmsDropTarget target)
      Description copied from interface: I_CmsDraggable
      Creates the drag placeholder element.

      Specified by:
      getPlaceholder in interface I_CmsDraggable
      Parameters:
      target - the drop target
      Returns:
      the drag placeholder element
      See Also:
    • getReleasedAndNotExpired

      public boolean getReleasedAndNotExpired()
      Returns if the element resource is currently released and not expired.

      Returns:
      true if the element resource is currently released and not expired
    • getResourceType

      Returns the element resource type name.

      Returns:
      the resource type name
    • getSitePath

      public String getSitePath()
      Returns the site-path.

      Returns:
      the site-path
    • getStructureId

      public org.opencms.util.CmsUUID getStructureId()
      Returns the structure id of the element.

      Returns:
      the structure id of the element
    • hasEditHandler

      public boolean hasEditHandler()
      Indicates an edit handler is configured for the element resource type.

      Returns:
      indicates an edit handler is configured for the element resource type
    • hasModelGroupParent

      public boolean hasModelGroupParent()
      Returns whether this element has a model group parent.

      Returns:
      true if this element has a model group parent
    • hasReloadMarker

      public boolean hasReloadMarker()
      In case the inner HTML contains the reload marker.

      Returns:
      true in case the inner HTML contains the reload marker
    • hasSettings

      public boolean hasSettings()
      Returns true if the element has settings to edit.

      Returns:
      true if the element has settings to edit
    • hasViewPermission

      public boolean hasViewPermission()
      Returns if the current user has view permissions for the element resource.

      Returns:
      true if the current user has view permissions for the element resource
    • hasWritePermission

      public boolean hasWritePermission()
      Returns if the user has write permission.

      Returns:
      true if the user has write permission
    • hideEditableListButtons

      public void hideEditableListButtons()
      Hides list collector direct edit buttons, if present.

    • highlightElement

      public void highlightElement()
      Puts a highlighting border around the element.

    • initInlineEditor

      public void initInlineEditor(CmsContainerpageController controller)
      Initializes the editor click handler.

      Parameters:
      controller - the container page controller instance
    • isCreateNew

      public boolean isCreateNew()
      Checks if this element has 'createNew' status, i.e. will be copied when using this page as a model for a new container page.

      Returns:
      true if this element has createNew status
    • isModelGroup

      public boolean isModelGroup()
      Returns whether the element is used as a model group.

      Returns:
      true if the element is used as a model group
    • isNew

      public boolean isNew()
      Returns if this is e newly created element.

      Returns:
      true if the element is new
    • isNewEditorDisabled

      public boolean isNewEditorDisabled()
      Returns true if the new content editor is disabled for this element.

      Returns:
      true if the new editor is disabled for this element
    • isReused

      public boolean isReused()
      Checks if this element is marked as reused.
      Returns:
      true if the element is marked as reused
    • onDragCancel

      public void onDragCancel()
      Description copied from interface: I_CmsDraggable
      Executed on drag cancel.

      Specified by:
      onDragCancel in interface I_CmsDraggable
      See Also:
    • onDrop

      public void onDrop(I_CmsDropTarget target)
      Description copied from interface: I_CmsDraggable
      Executed on drop.

      Specified by:
      onDrop in interface I_CmsDraggable
      Parameters:
      target - the drop target
      See Also:
    • onStartDrag

      public void onStartDrag(I_CmsDropTarget target)
      Description copied from interface: I_CmsDraggable
      Executed on drag start.

      Specified by:
      onStartDrag in interface I_CmsDraggable
      Parameters:
      target - the current drop target
      See Also:
    • removeFromParent

      public void removeFromParent()
      Overrides:
      removeFromParent in class com.google.gwt.user.client.ui.Widget
      See Also:
      • Widget.removeFromParent()
    • removeHighlighting

      public void removeHighlighting()
      Removes the highlighting border.

    • removeInlineEditor

      public void removeInlineEditor()
      Removes the inline editor.

    • replaceHtml

      public void replaceHtml(String html)
      Description copied from interface: I_CmsInlineFormParent
      Replaces the inner HTML of widget to reflect content data changes.

      Specified by:
      replaceHtml in interface I_CmsInlineFormParent
      Parameters:
      html - the element HTML
      See Also:
    • setCreateNew

      public void setCreateNew(boolean createNew)
      Sets the 'create new' status of the element.

      Parameters:
      createNew - the new value for the 'create new' status
    • setElementOptionBar

      public void setElementOptionBar(CmsElementOptionBar elementOptionBar)
      Sets the element option bar.

      Parameters:
      elementOptionBar - the element option bar to set
    • setId

      public void setId(String id)
      Sets the element id.

      Parameters:
      id - the id
    • setInheritanceInfo

      public void setInheritanceInfo(org.opencms.ade.containerpage.shared.CmsInheritanceInfo inheritanceInfo)
      Sets the inheritance info for this element.

      Parameters:
      inheritanceInfo - the inheritance info for this element to set
    • setNewType

      public void setNewType(String newType)
      Sets the new-type of the element.

      Parameters:
      newType - the new-type
    • setNoEditReason

      public void setNoEditReason(String noEditReason)
      Sets the no edit reason.

      Parameters:
      noEditReason - the no edit reason to set
    • setReleasedAndNotExpired

      public void setReleasedAndNotExpired(boolean releasedAndNotExpired)
      Sets if the element resource is currently released and not expired.

      Parameters:
      releasedAndNotExpired - true if the element resource is currently released and not expired
    • setSitePath

      public void setSitePath(String sitePath)
      Sets the site path.

      Parameters:
      sitePath - the site path to set
    • setViewPermission

      public void setViewPermission(boolean viewPermission)
      Sets if the current user has view permissions for the element resource.

      Parameters:
      viewPermission - the view permission to set
    • setWritePermission

      public void setWritePermission(boolean writePermission)
      Sets the user write permission.

      Parameters:
      writePermission - the user write permission to set
    • showEditableListButtons

      public void showEditableListButtons()
      Shows list collector direct edit buttons (old direct edit style), if present.

    • updateOptionBarPosition

      public void updateOptionBarPosition()
      Updates the option bar position.

    • checkForEditableChanges

      protected void checkForEditableChanges()
      Checks for changes in the list collector direct edit content.

    • getEditableElements

      protected List<com.google.gwt.dom.client.Element> getEditableElements()
      Gets the editable list elements.

      Returns:
      the editable list elements
    • hasChangedEditables

      protected boolean hasChangedEditables()
      Returns if the list collector direct edit content has changed.

      Returns:
      true if the list collector direct edit content has changed
    • onDetach

      protected void onDetach()
      Overrides:
      onDetach in class com.google.gwt.user.client.ui.Widget
      See Also:
      • Widget.onDetach()
    • onLoad

      protected void onLoad()
      Overrides:
      onLoad in class com.google.gwt.user.client.ui.Widget
      See Also:
      • Widget.onLoad()
    • removeEditorHandler

      protected void removeEditorHandler()
      Removes the inline editor handler.