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
,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
Modifier and TypeClassDescriptionstatic class
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
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
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of a special property for the container id.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ConstructorDescriptionCmsContainerPageContainer
(org.opencms.ade.containerpage.shared.CmsContainer containerData, com.google.gwt.dom.client.Element element) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Check if the empty container content should be displayed or removed.void
Checks the maximum number of allowed elements and hides overflowing elements.void
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
Clears the list of child drop targets.static void
Clears the static layout change object, resetting it if it's not null.Returns all contained drag elements.int
Returns the configured width for this container.Returns the container id.int
Returns the container level.Returns the container type.In case of a former copy model, and a max elements setting of one, the id of the overflowing element is returned.Returns the list of child drop targets.com.google.gwt.dom.client.Element
Returns whether this container has a model group parent.Gets the highlighting widget for the container.Returns the parent container id.int
Returns the index of the placeholder or -1 if no placeholder is attached.Returns the current position info.Returns the settings presets.boolean
Checks whether this drop target has any children.boolean
Returns whether this container has a model group parent.void
Hides list collector direct edit buttons, if present.void
highlightContainer
(boolean addSeparators) Puts a highlighting border around the container content.void
highlightContainer
(CmsPositionBean positionInfo, boolean addSeparators) 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
Returnstrue
if this container is a detail view only container.boolean
Returns true if this is a detail view container, being actually used for detail content.boolean
Checks if this is a detail view container.boolean
Returns if the container is editable by the current user.boolean
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.newResizeHelper
(CmsContainerPageContainer container) Creates a new layout helper for resizing containers.void
onConsumeChildren
(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
Refreshes position and dimension of the highlighting border.void
refreshHighlighting
(CmsPositionBean positionInfo) Refreshes position and dimension of the highlighting border.void
Removes the highlighting border.void
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.Measures the height of the container and sets its min-height to that value.void
setPlaceholderIndex
(int index) void
setPlaceholderVisibility
(boolean visible) Sets the placeholder visibility.void
Shows list collector direct edit buttons (old direct edit style), if present.void
Updates the option bar positions of the child elements.void
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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
PROP_CONTAINER_MARKER
Name of a special property for the container id.- See Also:
-
-
Constructor Details
-
Method Details
-
clearResizeHelper
Clears the static layout change object, resetting it if it's not null. -
measureHeight
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
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
Description copied from interface:I_CmsDropContainer
Registers a child drop target.- Specified by:
addDndChild
in interfaceI_CmsDropContainer
- Parameters:
child
- the child- See Also:
-
adoptElement
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:
-
checkEmptyContainers
Check if the empty container content should be displayed or removed. -
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:
-
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:
-
checkPosition
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:
-
clearDnDChildren
Description copied from interface:I_CmsDropContainer
Clears the list of child drop targets.- Specified by:
clearDnDChildren
in interfaceI_CmsDropContainer
- See Also:
-
getAllDragElements
Returns all contained drag elements.- Returns:
- the drag elements
-
getConfiguredWidth
Returns the configured width for this container.- Returns:
- the configured width
-
getContainerId
Returns the container id.- Specified by:
getContainerId
in interfaceI_CmsDropContainer
- Returns:
- the container id
-
getContainerLevel
Returns the container level.- Returns:
- the container level
-
getContainerType
Returns the container type.- Returns:
- the container type
-
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
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:
-
getFormerModelGroupParent
Returns whether this container has a model group parent.- Returns:
true
if this container has a model group parent
-
getHighlighting
Gets the highlighting widget for the container.- Returns:
- the highlighting widget
-
getParentContainerId
Returns the parent container id.- Returns:
- the container parent id
-
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:
-
getPositionInfo
Description copied from interface:I_CmsDropContainer
Returns the current position info.- Specified by:
getPositionInfo
in interfaceI_CmsDropContainer
- Returns:
- the position info
- See Also:
-
getSettingPresets
Returns the settings presets.- Returns:
- the presets
-
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:
-
hasModelGroupParent
Returns whether this container has a model group parent.- Returns:
true
if this container has a model group parent
-
hideEditableListButtons
Description copied from interface:I_CmsDropContainer
Hides list collector direct edit buttons, if present.- Specified by:
hideEditableListButtons
in interfaceI_CmsDropContainer
- See Also:
-
highlightContainer
Puts a highlighting border around the container content.- Specified by:
highlightContainer
in interfaceI_CmsDropContainer
-
highlightContainer
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:
-
org.opencms.ade.containerpage.client.ui.I_CmsDropContainer#highlightContainer(org.opencms.gwt.client.util.CmsPositionBean)
-
insert
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:
-
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:
-
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:
-
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
Checks if this is a detail view container.- Returns:
- true if this is a detail view container
-
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:
-
isShowingEmptyContainerElement
Checks if the container is showing the empty container element.- Returns:
- true if the empty container element is shown in the container
-
onConsumeChildren
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:
-
onDrop
Description copied from interface:I_CmsDropTarget
Executed on drop.- Specified by:
onDrop
in interfaceI_CmsDropTarget
- Parameters:
draggable
- the draggable being dropped- See Also:
-
refreshHighlighting
Refreshes position and dimension of the highlighting border. Call when anything changed during the drag process.- Specified by:
refreshHighlighting
in interfaceI_CmsDropContainer
-
refreshHighlighting
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:
-
removeHighlighting
Removes the highlighting border.- Specified by:
removeHighlighting
in interfaceI_CmsDropContainer
-
removePlaceholder
Description copied from interface:I_CmsDropTarget
Removes the placeholder.- Specified by:
removePlaceholder
in interfaceI_CmsDropTarget
- See Also:
-
repositionPlaceholder
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:
-
setContainerLevel
Sets the container level.- Parameters:
level
- the container level
-
setEmptyContainerElement
Sets the empty container element.- Parameters:
emptyContainerElement
- the empty container element
-
setMinHeightToCurrentHeight
Measures the height of the container and sets its min-height to that value.- Returns:
- a runnable used to undo the style changes
-
setPlaceholderIndex
-
setPlaceholderVisibility
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:
-
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:
-
updateOptionBars
Updates the option bar positions of the child elements. -
updatePositionInfo
Description copied from interface:I_CmsDropContainer
Updates the cached position info.- Specified by:
updatePositionInfo
in interfaceI_CmsDropContainer
- See Also:
-