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
,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
-
-
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.
-
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 ornull
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 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
-
-
-
-
Field Detail
-
PROP_IS_MODEL_GROUP
public static final java.lang.String PROP_IS_MODEL_GROUP
The is model group property key.- See Also:
- Constant Field Values
-
PROP_WAS_MODEL_GROUP
public static final java.lang.String PROP_WAS_MODEL_GROUP
The former copy model property.- See Also:
- Constant Field Values
-
PROP_ELEMENT_OBJECT_ID
public static final java.lang.String PROP_ELEMENT_OBJECT_ID
Property used to mark an element as belonging to this widget.- See Also:
- Constant Field Values
-
m_highlighting
protected CmsHighlightingBorder m_highlighting
Highlighting border for this element.
-
-
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 elementparent
- the drag parentclientId
- the client idsitePath
- the element site-pathnoEditReason
- the no edit reason, if empty, editing is allowedlockInfo
- the lock informationtitle
- the resource titlesubTitle
- the sub titleresourceType
- the resource typehasSettings
- should be true if the element has settings which can be editedhasViewPermission
- indicates if the current user has view permissions on the element resourcehasWritePermission
- indicates if the current user has write permissions on the element resourcereleasedAndNotExpired
-true
if the element resource is currently released and not expireddisableNewEditor
- flag to disable the new editor for this elementhasEditHandler
- indicates an edit handler is configured for the element resource typemodelGroupId
- the model group idwasModelGroup
- in case of a former copy model groupelementView
- the element view of the elementiconClasses
- 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 interfacecom.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 interfaceI_CmsInlineFormParent
- Parameters:
widget
- the widget to adopt- See Also:
I_CmsInlineFormParent.adoptWidget(com.google.gwt.user.client.ui.IsWidget)
-
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 interfaceI_CmsDraggable
- Returns:
- an optional array containing exactly 2 entries [x,y]
- See Also:
I_CmsDraggable.getCursorOffsetDelta()
-
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 interfaceI_CmsDraggable
- Parameters:
target
- the drop target- Returns:
- the drag helper element
- See Also:
I_CmsDraggable.getDragHelper(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
getElementOptionBar
public CmsElementOptionBar 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 java.lang.String getId()
Description copied from interface:I_CmsDraggable
Returns the draggable id.- Specified by:
getId
in interfaceI_CmsDraggable
- Returns:
- the id
- See Also:
I_CmsDraggable.getId()
-
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
-
getParentTarget
public I_CmsDropContainer getParentTarget()
Description copied from interface:I_CmsDraggable
Returns the parent drop target ornull
if there is none.- Specified by:
getParentTarget
in interfaceI_CmsDraggable
- Returns:
- the parent drop target
- See Also:
I_CmsDraggable.getParentTarget()
-
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 interfaceI_CmsDraggable
- Parameters:
target
- the drop target- Returns:
- the drag placeholder element
- See Also:
I_CmsDraggable.getPlaceholder(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
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.
-
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
-
onDragCancel
public void onDragCancel()
Description copied from interface:I_CmsDraggable
Executed on drag cancel.- Specified by:
onDragCancel
in interfaceI_CmsDraggable
- See Also:
I_CmsDraggable.onDragCancel()
-
onDrop
public void onDrop(I_CmsDropTarget target)
Description copied from interface:I_CmsDraggable
Executed on drop.- Specified by:
onDrop
in interfaceI_CmsDraggable
- Parameters:
target
- the drop target- See Also:
I_CmsDraggable.onDrop(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
onStartDrag
public void onStartDrag(I_CmsDropTarget target)
Description copied from interface:I_CmsDraggable
Executed on drag start.- Specified by:
onStartDrag
in interfaceI_CmsDraggable
- Parameters:
target
- the current drop target- See Also:
I_CmsDraggable.onStartDrag(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
removeFromParent
public void removeFromParent()
- Overrides:
removeFromParent
in classcom.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(java.lang.String html)
Description copied from interface:I_CmsInlineFormParent
Replaces the inner HTML of widget to reflect content data changes.- Specified by:
replaceHtml
in interfaceI_CmsInlineFormParent
- Parameters:
html
- the element HTML- See Also:
I_CmsInlineFormParent.replaceHtml(java.lang.String)
-
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(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.
-
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 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 classcom.google.gwt.user.client.ui.Widget
- See Also:
Widget.onDetach()
-
onLoad
protected void onLoad()
- Overrides:
onLoad
in classcom.google.gwt.user.client.ui.Widget
- See Also:
Widget.onLoad()
-
removeEditorHandler
protected void removeEditorHandler()
Removes the inline editor handler.
-
-