Class 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, java.lang.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  CmsContainerPageElementPanel.PointPositioningParser
      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
      protected CmsHighlightingBorder m_highlighting
      Highlighting border for this element.
      static java.lang.String PROP_ELEMENT_OBJECT_ID
      Property used to mark an element as belonging to this widget.
      static java.lang.String PROP_IS_MODEL_GROUP
      The is model group property key.
      static java.lang.String PROP_WAS_MODEL_GROUP
      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, java.lang.String clientId, java.lang.String sitePath, java.lang.String noEditReason, org.opencms.ade.containerpage.shared.CmsElementLockInfo lockInfo, java.lang.String title, java.lang.String subTitle, java.lang.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, java.lang.String iconClasses)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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 checkForEditableChanges()
      Checks for changes in the list collector direct edit content.
      com.google.common.base.Optional<int[]> getCursorOffsetDelta()
      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 getDragHelper​(I_CmsDropTarget target)
      Creates the drag helper element and attaches it into the DOM.
      protected java.util.List<com.google.gwt.dom.client.Element> getEditableElements()
      Gets the editable list elements.
      CmsElementOptionBar getElementOptionBar()
      Returns the option bar of this element.
      org.opencms.util.CmsUUID getElementView()
      Returns the elements element view.
      java.lang.String getId()
      Returns the draggable id.
      org.opencms.ade.containerpage.shared.CmsInheritanceInfo getInheritanceInfo()
      Returns the inheritance info for this element.
      org.opencms.ade.containerpage.shared.CmsElementLockInfo getLockInfo()
      Gets the lock information.
      org.opencms.util.CmsUUID getModelGroupId()
      Returns the model group id.
      java.lang.String getNewType()
      Returns the new element type.
      java.lang.String getNoEditReason()
      Returns the no edit reason.
      java.lang.String getObjectId()
      Gets the random id identifying this widget.
      I_CmsDropContainer getParentTarget()
      Returns the parent drop target or null if there is none.
      com.google.gwt.dom.client.Element getPlaceholder​(I_CmsDropTarget target)
      Creates the drag placeholder element.
      boolean getReleasedAndNotExpired()
      Returns if the element resource is currently released and not expired.
      java.lang.String getResourceType()
      Returns the element resource type name.
      java.lang.String getSitePath()
      Returns the site-path.
      org.opencms.util.CmsUUID getStructureId()
      Returns the structure id of the element.
      protected boolean hasChangedEditables()
      Returns if the list collector direct edit content has changed.
      boolean hasEditHandler()
      Indicates an edit handler is configured for the element resource type.
      boolean hasModelGroupParent()
      Returns whether this element has a model group parent.
      boolean hasReloadMarker()
      In case the inner HTML contains the reload marker.
      boolean hasSettings()
      Returns true if the element has settings to edit.
      boolean hasViewPermission()
      Returns if the current user has view permissions for the element resource.
      boolean hasWritePermission()
      Returns if the user has write permission.
      void hideEditableListButtons()
      Hides list collector direct edit buttons, if present.
      void highlightElement()
      Puts a highlighting border around the element.
      void initInlineEditor​(CmsContainerpageController controller)
      Initializes the editor click handler.
      boolean isCreateNew()
      Checks if this element has 'createNew' status, i.e.
      boolean isModelGroup()
      Returns whether the element is used as a model group.
      boolean isNew()
      Returns if this is e newly created element.
      boolean isNewEditorDisabled()
      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.
      protected void onDetach()  
      void onDragCancel()
      Executed on drag cancel.
      void onDrop​(I_CmsDropTarget target)
      Executed on drop.
      protected void onLoad()  
      void onStartDrag​(I_CmsDropTarget target)
      Executed on drag start.
      protected void removeEditorHandler()
      Removes the inline editor handler.
      void removeFromParent()  
      void removeHighlighting()
      Removes the highlighting border.
      void removeInlineEditor()
      Removes the inline editor.
      void replaceHtml​(java.lang.String html)
      Replaces the inner HTML of widget to reflect content data changes.
      void setCreateNew​(boolean createNew)
      Sets the 'create new' status of the element.
      void setElementOptionBar​(CmsElementOptionBar elementOptionBar)
      Sets the element option bar.
      void setId​(java.lang.String id)
      Sets the element id.
      void setInheritanceInfo​(org.opencms.ade.containerpage.shared.CmsInheritanceInfo inheritanceInfo)
      Sets the inheritance info for this element.
      void setNewType​(java.lang.String newType)
      Sets the new-type of the element.
      void setNoEditReason​(java.lang.String noEditReason)
      Sets the no edit reason.
      void setReleasedAndNotExpired​(boolean releasedAndNotExpired)
      Sets if the element resource is currently released and not expired.
      void setSitePath​(java.lang.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 showEditableListButtons()
      Shows list collector direct edit buttons (old direct edit style), if present.
      void updateOptionBarPosition()
      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 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
    • Constructor Detail

      • CmsContainerPageElementPanel

        public CmsContainerPageElementPanel​(com.google.gwt.dom.client.Element element,
                                            I_CmsDropContainer parent,
                                            java.lang.String clientId,
                                            java.lang.String sitePath,
                                            java.lang.String noEditReason,
                                            org.opencms.ade.containerpage.shared.CmsElementLockInfo lockInfo,
                                            java.lang.String title,
                                            java.lang.String subTitle,
                                            java.lang.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,
                                            java.lang.String iconClasses)
        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
    • Method Detail

      • 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)
      • getElementView

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

        Returns:
        the element view
      • 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 java.lang.String getNewType()
        Returns the new element type.
        Returns:
        the new element type
      • getNoEditReason

        public java.lang.String getNoEditReason()
        Returns the no edit reason.

        Returns:
        the no edit reason
      • getObjectId

        public java.lang.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
      • 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

        public java.lang.String getResourceType()
        Returns the element resource type name.

        Returns:
        the resource type name
      • getSitePath

        public java.lang.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.

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

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

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

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

        public void setId​(java.lang.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​(java.lang.String newType)
        Sets the new-type of the element.

        Parameters:
        newType - the new-type
      • setNoEditReason

        public void setNoEditReason​(java.lang.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​(java.lang.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.

      • checkForEditableChanges

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

      • getEditableElements

        protected java.util.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.