Class CmsContainerPageContainer
- 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
-
- org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer
-
- All Implemented Interfaces:
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.IsWidget
,java.lang.Iterable<com.google.gwt.user.client.ui.Widget>
,I_CmsDropContainer
,I_CmsDropTarget
,I_CmsNestedDropTarget
public class CmsContainerPageContainer extends com.google.gwt.user.client.ui.ComplexPanel implements I_CmsDropContainer
Container page container.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsContainerPageContainer.ContainerResizeHelper
Helper class for resizing containers in the drag/drop process when an element is dropped into them that is of lower height than the empty container HTML.protected class
CmsContainerPageContainer.ElementPositionInfo
Element position info class.-
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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_CONTAINER_MARKER
Name of a special property for the container id.
-
Constructor Summary
Constructors Constructor Description CmsContainerPageContainer(org.opencms.ade.containerpage.shared.CmsContainer containerData, com.google.gwt.dom.client.Element element)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(com.google.gwt.user.client.ui.Widget w)
Adds a new child widget.void
addDndChild(I_CmsDropTarget child)
Registers a child drop target.void
adoptElement(CmsContainerPageElementPanel containerElement)
Adopts a container-page element registering it as a child of this container.void
checkEmptyContainers()
Check if the empty container content should be displayed or removed.void
checkMaxElementsOnEnter()
Checks the maximum number of allowed elements and hides overflowing elements.void
checkMaxElementsOnLeave()
Checks the maximum number of allowed elements and displays formerly hidden elements.boolean
checkPosition(int x, int y, CmsDNDHandler.Orientation orientation)
Returns true if the given cursor position is over the drop target.void
clearDnDChildren()
Clears the list of child drop targets.static void
clearResizeHelper()
Clears the static layout change object, resetting it if it's not null.java.util.List<CmsContainerPageElementPanel>
getAllDragElements()
Returns all contained drag elements.int
getConfiguredWidth()
Returns the configured width for this container.java.lang.String
getContainerId()
Returns the container id.int
getContainerLevel()
Returns the container level.java.lang.String
getContainerType()
Returns the container type.java.lang.String
getCopyModelReplaceId()
In case of a former copy model, and a max elements setting of one, the id of the overflowing element is returned.java.util.List<I_CmsDropTarget>
getDnDChildren()
Returns the list of child drop targets.com.google.gwt.dom.client.Element
getFormerModelGroupParent()
Returns whether this container has a model group parent.java.lang.String
getParentContainerId()
Returns the parent container id.int
getPlaceholderIndex()
Returns the index of the placeholder or -1 if no placeholder is attached.CmsPositionBean
getPositionInfo()
Returns the current position info.java.util.Map<java.lang.String,java.lang.String>
getSettingPresets()
Returns the settings presets.boolean
hasDnDChildren()
Checks whether this drop target has any children.boolean
hasModelGroupParent()
Returns whether this container has a model group parent.void
hideEditableListButtons()
Hides list collector direct edit buttons, if present.void
highlightContainer()
Puts a highlighting border around the container content.void
highlightContainer(CmsPositionBean positionInfo)
Puts a highlighting border around the container content using the given dimensions.void
insert(com.google.gwt.user.client.ui.Widget w, int beforeIndex)
Inserts a child widget before the specified index.void
insertPlaceholder(com.google.gwt.dom.client.Element placeholder, int x, int y, CmsDNDHandler.Orientation orientation)
Inserts a new placeholder.boolean
isDetailOnly()
Returnstrue
if this container is a detail view only container.boolean
isDetailView()
Returns true if this is a detail view container, being actually used for detail content.boolean
isDetailViewContainer()
Checks if this is a detail view container.boolean
isEditable()
Returns if the container is editable by the current user.boolean
isShowingEmptyContainerElement()
Checks if the container is showing the empty container element.static int
measureHeight(com.google.gwt.dom.client.Element elem)
Measures the height of the container's element.static CmsContainerPageContainer.ContainerResizeHelper
newResizeHelper(CmsContainerPageContainer container)
Creates a new layout helper for resizing containers.void
onConsumeChildren(java.util.List<CmsContainerPageElementPanel> children)
This is called when the elements of this container/group have been processed into CmsContainerPageElementPanels.void
onDrop(I_CmsDraggable draggable)
Executed on drop.void
refreshHighlighting()
Refreshes position and dimension of the highlighting border.void
refreshHighlighting(CmsPositionBean positionInfo)
Refreshes position and dimension of the highlighting border.void
removeHighlighting()
Removes the highlighting border.void
removePlaceholder()
Removes the placeholder.void
repositionPlaceholder(int x, int y, CmsDNDHandler.Orientation orientation)
Repositions the placeholder.void
setContainerLevel(int level)
Sets the container level.void
setEmptyContainerElement(com.google.gwt.dom.client.Element emptyContainerElement)
Sets the empty container element.java.lang.Runnable
setMinHeightToCurrentHeight()
Measures the height of the container and sets its min-height to that value.void
setPlaceholderVisibility(boolean visible)
Sets the placeholder visibility.void
showEditableListButtons()
Shows list collector direct edit buttons (old direct edit style), if present.void
updateOptionBars()
Updates the option bar positions of the child elements.void
updatePositionInfo()
Updates the cached position info.-
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, 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, onDetach, onLoad, onUnload, removeFromParent, 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.ade.containerpage.client.ui.I_CmsDropContainer
getWidgetCount, getWidgetIndex
-
Methods inherited from interface org.opencms.gwt.client.dnd.I_CmsDropTarget
getElement
-
-
-
-
Field Detail
-
PROP_CONTAINER_MARKER
public static final java.lang.String PROP_CONTAINER_MARKER
Name of a special property for the container id.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsContainerPageContainer
public CmsContainerPageContainer(org.opencms.ade.containerpage.shared.CmsContainer containerData, com.google.gwt.dom.client.Element element)
Constructor.- Parameters:
containerData
- the container dataelement
- the container element
-
-
Method Detail
-
clearResizeHelper
public static void clearResizeHelper()
Clears the static layout change object, resetting it if it's not null.
-
measureHeight
public static int measureHeight(com.google.gwt.dom.client.Element elem)
Measures the height of the container's element. This sets the overflow-y style property to auto to prevent margin collapsing.- Parameters:
elem
- the element- Returns:
- the height
-
newResizeHelper
public static CmsContainerPageContainer.ContainerResizeHelper newResizeHelper(CmsContainerPageContainer container)
Creates a new layout helper for resizing containers.The previously created layout changes object (if any) will be reset.
- Parameters:
container
- the container- Returns:
- the new layout helper
-
add
public void add(com.google.gwt.user.client.ui.Widget w)
Description copied from interface:I_CmsDropContainer
Adds a new child widget.- Specified by:
add
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Specified by:
add
in interfaceI_CmsDropContainer
- Overrides:
add
in classcom.google.gwt.user.client.ui.Panel
- Parameters:
w
- the widget- See Also:
Panel.add(com.google.gwt.user.client.ui.Widget)
-
addDndChild
public void addDndChild(I_CmsDropTarget child)
Description copied from interface:I_CmsDropContainer
Registers a child drop target.- Specified by:
addDndChild
in interfaceI_CmsDropContainer
- Parameters:
child
- the child- See Also:
I_CmsDropContainer.addDndChild(org.opencms.gwt.client.dnd.I_CmsDropTarget)
-
adoptElement
public void adoptElement(CmsContainerPageElementPanel containerElement)
Description copied from interface:I_CmsDropContainer
Adopts a container-page element registering it as a child of this container. Used for elements that are already child nodes of the container-element node in DOM.- Specified by:
adoptElement
in interfaceI_CmsDropContainer
- Parameters:
containerElement
- the element to adopt- See Also:
I_CmsDropContainer.adoptElement(org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel)
-
checkEmptyContainers
public void checkEmptyContainers()
Check if the empty container content should be displayed or removed.
-
checkMaxElementsOnEnter
public void checkMaxElementsOnEnter()
Description copied from interface:I_CmsDropContainer
Checks the maximum number of allowed elements and hides overflowing elements.- Specified by:
checkMaxElementsOnEnter
in interfaceI_CmsDropContainer
- See Also:
I_CmsDropContainer.checkMaxElementsOnEnter()
-
checkMaxElementsOnLeave
public void checkMaxElementsOnLeave()
Description copied from interface:I_CmsDropContainer
Checks the maximum number of allowed elements and displays formerly hidden elements.- Specified by:
checkMaxElementsOnLeave
in interfaceI_CmsDropContainer
- See Also:
I_CmsDropContainer.checkMaxElementsOnLeave()
-
checkPosition
public boolean checkPosition(int x, int y, CmsDNDHandler.Orientation orientation)
Description copied from interface:I_CmsDropTarget
Returns true if the given cursor position is over the drop target.- Specified by:
checkPosition
in interfaceI_CmsDropTarget
- Parameters:
x
- the cursor client x positiony
- the cursor client y positionorientation
- the drag and drop orientation- Returns:
true
if the given cursor position is over the drop target- See Also:
I_CmsDropTarget.checkPosition(int, int, Orientation)
-
clearDnDChildren
public void clearDnDChildren()
Description copied from interface:I_CmsDropContainer
Clears the list of child drop targets.- Specified by:
clearDnDChildren
in interfaceI_CmsDropContainer
- See Also:
I_CmsDropContainer.clearDnDChildren()
-
getAllDragElements
public java.util.List<CmsContainerPageElementPanel> getAllDragElements()
Returns all contained drag elements.- Returns:
- the drag elements
-
getConfiguredWidth
public int getConfiguredWidth()
Returns the configured width for this container.- Returns:
- the configured width
-
getContainerId
public java.lang.String getContainerId()
Returns the container id.- Specified by:
getContainerId
in interfaceI_CmsDropContainer
- Returns:
- the container id
-
getContainerLevel
public int getContainerLevel()
Returns the container level.- Returns:
- the container level
-
getContainerType
public java.lang.String getContainerType()
Returns the container type.- Returns:
- the container type
-
getCopyModelReplaceId
public java.lang.String getCopyModelReplaceId()
In case of a former copy model, and a max elements setting of one, the id of the overflowing element is returned.- Returns:
- the overflowing element id or
null
-
getDnDChildren
public java.util.List<I_CmsDropTarget> getDnDChildren()
Description copied from interface:I_CmsNestedDropTarget
Returns the list of child drop targets.- Specified by:
getDnDChildren
in interfaceI_CmsNestedDropTarget
- Returns:
- the child drop targets
- See Also:
I_CmsNestedDropTarget.getDnDChildren()
-
getFormerModelGroupParent
public com.google.gwt.dom.client.Element getFormerModelGroupParent()
Returns whether this container has a model group parent.- Returns:
true
if this container has a model group parent
-
getParentContainerId
public java.lang.String getParentContainerId()
Returns the parent container id.- Returns:
- the container parent id
-
getPlaceholderIndex
public int getPlaceholderIndex()
Description copied from interface:I_CmsDropTarget
Returns the index of the placeholder or -1 if no placeholder is attached.- Specified by:
getPlaceholderIndex
in interfaceI_CmsDropTarget
- Returns:
- the index
- See Also:
I_CmsDropTarget.getPlaceholderIndex()
-
getPositionInfo
public CmsPositionBean getPositionInfo()
Description copied from interface:I_CmsDropContainer
Returns the current position info.- Specified by:
getPositionInfo
in interfaceI_CmsDropContainer
- Returns:
- the position info
- See Also:
I_CmsDropContainer.getPositionInfo()
-
getSettingPresets
public java.util.Map<java.lang.String,java.lang.String> getSettingPresets()
Returns the settings presets.- Returns:
- the presets
-
hasDnDChildren
public boolean hasDnDChildren()
Description copied from interface:I_CmsNestedDropTarget
Checks whether this drop target has any children.- Specified by:
hasDnDChildren
in interfaceI_CmsNestedDropTarget
- Returns:
true
if this drop target has any children- See Also:
I_CmsNestedDropTarget.hasDnDChildren()
-
hasModelGroupParent
public boolean hasModelGroupParent()
Returns whether this container has a model group parent.- Returns:
true
if this container has a model group parent
-
hideEditableListButtons
public void hideEditableListButtons()
Description copied from interface:I_CmsDropContainer
Hides list collector direct edit buttons, if present.- Specified by:
hideEditableListButtons
in interfaceI_CmsDropContainer
- See Also:
I_CmsDropContainer.hideEditableListButtons()
-
highlightContainer
public void highlightContainer()
Puts a highlighting border around the container content.- Specified by:
highlightContainer
in interfaceI_CmsDropContainer
-
highlightContainer
public void highlightContainer(CmsPositionBean positionInfo)
Description copied from interface:I_CmsDropContainer
Puts a highlighting border around the container content using the given dimensions.- Specified by:
highlightContainer
in interfaceI_CmsDropContainer
- Parameters:
positionInfo
- the highlighting position to use- See Also:
I_CmsDropContainer.highlightContainer(org.opencms.gwt.client.util.CmsPositionBean)
-
insert
public void insert(com.google.gwt.user.client.ui.Widget w, int beforeIndex)
Description copied from interface:I_CmsDropContainer
Inserts a child widget before the specified index. If the widget is already a child of this panel, it will be moved to the specified index.- Specified by:
insert
in interfaceI_CmsDropContainer
- Parameters:
w
- the new childbeforeIndex
- the before index- See Also:
I_CmsDropContainer.insert(com.google.gwt.user.client.ui.Widget, int)
-
insertPlaceholder
public void insertPlaceholder(com.google.gwt.dom.client.Element placeholder, int x, int y, CmsDNDHandler.Orientation orientation)
Description copied from interface:I_CmsDropTarget
Inserts a new placeholder.- Specified by:
insertPlaceholder
in interfaceI_CmsDropTarget
- Parameters:
placeholder
- the placeholder elementx
- the cursor client x positiony
- the cursor client y positionorientation
- the drag and drop orientation- See Also:
I_CmsDropTarget.insertPlaceholder(com.google.gwt.dom.client.Element, int, int, Orientation)
-
isDetailOnly
public boolean isDetailOnly()
Description copied from interface:I_CmsDropContainer
Returnstrue
if this container is a detail view only container.- Specified by:
isDetailOnly
in interfaceI_CmsDropContainer
- Returns:
true
if this container is a detail view only container- See Also:
I_CmsDropContainer.isDetailOnly()
-
isDetailView
public boolean isDetailView()
Returns true if this is a detail view container, being actually used for detail content.- Specified by:
isDetailView
in interfaceI_CmsDropContainer
- Returns:
- true if this is a detail view container
-
isDetailViewContainer
public boolean isDetailViewContainer()
Checks if this is a detail view container.- Returns:
- true if this is a detail view container
-
isEditable
public boolean isEditable()
Description copied from interface:I_CmsDropContainer
Returns if the container is editable by the current user.- Specified by:
isEditable
in interfaceI_CmsDropContainer
- Returns:
true
if the container is editable by the current user- See Also:
I_CmsDropContainer.isEditable()
-
isShowingEmptyContainerElement
public boolean isShowingEmptyContainerElement()
Checks if the container is showing the empty container element.- Returns:
- true if the empty container element is shown in the container
-
onConsumeChildren
public void onConsumeChildren(java.util.List<CmsContainerPageElementPanel> children)
Description copied from interface:I_CmsDropContainer
This is called when the elements of this container/group have been processed into CmsContainerPageElementPanels.- Specified by:
onConsumeChildren
in interfaceI_CmsDropContainer
- Parameters:
children
- the processed children- See Also:
I_CmsDropContainer.onConsumeChildren(java.util.List)
-
onDrop
public void onDrop(I_CmsDraggable draggable)
Description copied from interface:I_CmsDropTarget
Executed on drop.- Specified by:
onDrop
in interfaceI_CmsDropTarget
- Parameters:
draggable
- the draggable being dropped- See Also:
I_CmsDropTarget.onDrop(org.opencms.gwt.client.dnd.I_CmsDraggable)
-
refreshHighlighting
public void refreshHighlighting()
Refreshes position and dimension of the highlighting border. Call when anything changed during the drag process.- Specified by:
refreshHighlighting
in interfaceI_CmsDropContainer
-
refreshHighlighting
public void refreshHighlighting(CmsPositionBean positionInfo)
Description copied from interface:I_CmsDropContainer
Refreshes position and dimension of the highlighting border. Call when anything changed during the drag process.- Specified by:
refreshHighlighting
in interfaceI_CmsDropContainer
- Parameters:
positionInfo
- the position info to use- See Also:
I_CmsDropContainer.refreshHighlighting(org.opencms.gwt.client.util.CmsPositionBean)
-
removeHighlighting
public void removeHighlighting()
Removes the highlighting border.- Specified by:
removeHighlighting
in interfaceI_CmsDropContainer
-
removePlaceholder
public void removePlaceholder()
Description copied from interface:I_CmsDropTarget
Removes the placeholder.- Specified by:
removePlaceholder
in interfaceI_CmsDropTarget
- See Also:
I_CmsDropTarget.removePlaceholder()
-
repositionPlaceholder
public void repositionPlaceholder(int x, int y, CmsDNDHandler.Orientation orientation)
Description copied from interface:I_CmsDropTarget
Repositions the placeholder.- Specified by:
repositionPlaceholder
in interfaceI_CmsDropTarget
- Parameters:
x
- the cursor client x positiony
- the cursor client y positionorientation
- the drag and drop orientation- See Also:
I_CmsDropTarget.repositionPlaceholder(int, int, Orientation)
-
setContainerLevel
public void setContainerLevel(int level)
Sets the container level.- Parameters:
level
- the container level
-
setEmptyContainerElement
public void setEmptyContainerElement(com.google.gwt.dom.client.Element emptyContainerElement)
Sets the empty container element.- Parameters:
emptyContainerElement
- the empty container element
-
setMinHeightToCurrentHeight
public java.lang.Runnable setMinHeightToCurrentHeight()
Measures the height of the container and sets its min-height to that value.- Returns:
- a runnable used to undo the style changes
-
setPlaceholderVisibility
public void setPlaceholderVisibility(boolean visible)
Description copied from interface:I_CmsDropContainer
Sets the placeholder visibility.- Specified by:
setPlaceholderVisibility
in interfaceI_CmsDropContainer
- Parameters:
visible
-true
to set the place holder visible- See Also:
I_CmsDropContainer.setPlaceholderVisibility(boolean)
-
showEditableListButtons
public void showEditableListButtons()
Description copied from interface:I_CmsDropContainer
Shows list collector direct edit buttons (old direct edit style), if present.- Specified by:
showEditableListButtons
in interfaceI_CmsDropContainer
- See Also:
I_CmsDropContainer.showEditableListButtons()
-
updateOptionBars
public void updateOptionBars()
Updates the option bar positions of the child elements.
-
updatePositionInfo
public void updatePositionInfo()
Description copied from interface:I_CmsDropContainer
Updates the cached position info.- Specified by:
updatePositionInfo
in interfaceI_CmsDropContainer
- See Also:
I_CmsDropContainer.updatePositionInfo()
-
-