Package org.opencms.gwt.client.ui
Class CmsPopup
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.SimplePanel
com.google.gwt.user.client.ui.PopupPanel
org.opencms.gwt.client.ui.CmsPopup
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.EventPreview
,com.google.gwt.user.client.ui.AcceptsOneWidget
,com.google.gwt.user.client.ui.HasAnimation
,com.google.gwt.user.client.ui.HasOneWidget
,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.IsWidget
,com.google.gwt.user.client.ui.SourcesPopupEvents
,Iterable<com.google.gwt.user.client.ui.Widget>
,I_CmsAutoHider
- Direct Known Subclasses:
A_CmsListItemSelectDialog
,A_CmsNewModelPageDialog
,A_CmsUploadDialog
,CmsAlertDialog
,CmsCategoryDialog
,CmsConfirmRemoveDialog
,CmsCopyLocaleDialog
,CmsCreateGalleryDialog
,CmsCreateModeSelectionDialog
,CmsEditExternalLinkDialog
,CmsErrorDialog
,CmsFormDialog
,CmsFramePopup
,CmsGalleryPopup
,CmsListAddDialog
,CmsLockReportDialog
,CmsOptionDialog
,CmsPreviewDialog
,CmsPropertyDefinitionDialog
,CmsPublishConfirmationDialog
,CmsPublishDialog
,CmsRemovedElementDeletionDialog
,CmsRenameDialog
,CmsReplaceDialog
,CmsResourceInfoDialog
,CmsRestoreDialog
,CmsReuseInfoDialog
,CmsSeoOptionsDialog
,CmsSingleFileUploadDialog
,CmsToolbarPopup
,CmsUploadPopup
Provides a pop up dialog base.
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Handles fragment changes by closing the active popups.Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
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
Modifier and TypeFieldDescriptionstatic final int
The default width of this dialog.protected com.google.gwt.user.client.Command
The close command.protected boolean
Flag which indicates whether the notification widget has already been installed.protected int
The window width.static final int
The wide dialog width.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(com.google.gwt.user.client.ui.Widget w) Adds the given child widget.protected void
add
(com.google.gwt.user.client.ui.Widget child, com.google.gwt.dom.client.Element container) Adds a new child widget to the panel, attaching its Element to the specified container Element.void
addButton
(com.google.gwt.user.client.ui.Widget button) Adds a button widget to the button panel.void
addButton
(com.google.gwt.user.client.ui.Widget button, int position) Adds a button widget to the button panel before the given position.void
addDialogClose
(com.google.gwt.user.client.Command cmd) Adds a close "button" to the top of the popup.protected int
adjustIndex
(com.google.gwt.user.client.ui.Widget child, int beforeIndex) Adjusts beforeIndex to account for the possibility that the given widget is already a child of this panel.protected void
beginDragging
(com.google.gwt.event.dom.client.MouseDownEvent event) Called on mouse down in the caption area, begins the dragging loop by turning on event capture.void
Replaces current notification widget by an overlay.void
center()
void
centerHorizontally
(int top) Shows the dialog and centers it horizontally, but positions it at a fixed vertical position.protected void
checkIndexBoundsForAccess
(int index) Checks thatindex
is in the range [0, getWidgetCount()), which is the valid range on accessible indexes.protected void
checkIndexBoundsForInsertion
(int index) Checks thatindex
is in the range [0, getWidgetCount()], which is the valid range for indexes on an insertion.void
clear()
protected void
continueDragging
(com.google.gwt.event.dom.client.MouseMoveEvent event) Called on mouse move in the caption area, continues dragging if it was started bybeginDragging(com.google.gwt.event.dom.client.MouseDownEvent)
.protected CmsNotificationWidget
Creates a new notification widget for this dialog.protected void
protected void
protected void
endDragging
(com.google.gwt.event.dom.client.MouseUpEvent event) Called on mouse up in the caption area, ends dragging by ending event capture.int
getAvailableHeight
(int fixedContentHeight) Returns the maximum available height inside the popup.Returns the dialog caption text.protected com.google.gwt.user.client.ui.WidgetCollection
Gets the list of children contained in this panel.protected com.google.gwt.user.client.Element
com.google.gwt.user.client.ui.Widget
getWidget
(int index) Returns the child widget with the given index.int
Returns the number of child widgets.int
getWidgetIndex
(com.google.gwt.user.client.ui.IsWidget child) Returns the index of the given widget.int
getWidgetIndex
(com.google.gwt.user.client.ui.Widget child) Returns the index of the given child widget.int
getWidth()
Returns the dialog content width, -1 if not set.boolean
Returnstrue
if a caption is set for this popupfalse
otherwise.void
hide()
Hides the widget.void
hide
(boolean autoClosed) void
insert
(com.google.gwt.user.client.ui.Widget w, int beforeIndex) Inserts a child widget before the given index.protected void
insert
(com.google.gwt.user.client.ui.Widget child, com.google.gwt.dom.client.Element container, int beforeIndex, boolean domInsert) Insert a new child Widget into this Panel at a specified index, attaching its Element to the specified container Element.void
insertFront
(com.google.gwt.user.client.ui.Widget widget) Inserts a widget as the first widget in the popup.protected void
Sets the notification widget.Iterator<com.google.gwt.user.client.ui.Widget>
iterator()
void
onBrowserEvent
(com.google.gwt.user.client.Event event) protected void
onDetach()
Override to work around the glass overlay still showing after dialog hide.protected void
onPreviewNativeEvent
(com.google.gwt.user.client.Event.NativePreviewEvent event) boolean
remove
(int index) Removes a child widget.boolean
remove
(com.google.gwt.user.client.ui.Widget w) void
Removes all buttons.void
removeButton
(com.google.gwt.user.client.ui.Widget button) Removes the given button widget from the button panel.void
Removes the padding from the popup's content.void
setBackgroundColor
(String color) Sets the popup's content background.void
setCaption
(String caption) Sets the captions text.void
setHeight
(int height) Sets the height for the popup content.void
Deprecated.void
setMainContent
(com.google.gwt.user.client.ui.Widget w) Replaces the content from the main widget.void
setPixelSize
(int width, int height) Deprecated.void
Sets the popup's dialog position to 'fixed'.void
Deprecated.void
setSpecialBackgroundClass
(String cssClassName) Sets an additional CSS class to the main content element.void
setUseAnimation
(boolean use) Sets the use animation flag.void
setWidget
(com.google.gwt.user.client.ui.Widget w) Deprecated.void
setWidth
(int width) Sets the width for the popup content.void
Deprecated.void
show()
protected void
showArrow
(com.google.gwt.dom.client.Element arrow) Appends the arrow element to the popup's dialog.static com.google.gwt.user.client.ui.Widget
wrapWithBorderPadding
(com.google.gwt.user.client.ui.Widget w) Wraps the given Widget with a cornered border, padding and margin.Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, getAnimationType, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, showRelativeTo
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
getWidget, setWidget
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, 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, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, 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.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_WIDTH
The default width of this dialog.- See Also:
-
WIDE_WIDTH
The wide dialog width.- See Also:
-
m_closeCommand
The close command. -
m_notificationWidgetInstalled
Flag which indicates whether the notification widget has already been installed. -
m_windowWidth
The window width.
-
-
Constructor Details
-
CmsPopup
public CmsPopup()Constructor. -
CmsPopup
Constructor setting the width of the dialog.- Parameters:
width
- the width to set
-
CmsPopup
Constructor setting the dialog caption.- Parameters:
caption
- the caption to set
-
CmsPopup
Constructor setting caption and width.- Parameters:
caption
- the caption to setwidth
- the width to set
-
CmsPopup
The constructor.- Parameters:
title
- the title and heading of the dialogcontent
- the content widget
-
-
Method Details
-
wrapWithBorderPadding
public static com.google.gwt.user.client.ui.Widget wrapWithBorderPadding(com.google.gwt.user.client.ui.Widget w) Wraps the given Widget with a cornered border, padding and margin.- Parameters:
w
- the widget to wrap- Returns:
- a new widget that wraps the given one
-
add
Adds the given child widget.- Specified by:
add
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Overrides:
add
in classcom.google.gwt.user.client.ui.SimplePanel
- Parameters:
w
- the widget
-
addButton
Adds a button widget to the button panel.- Parameters:
button
- the button widget
-
addButton
Adds a button widget to the button panel before the given position.- Parameters:
button
- the button widgetposition
- the position to insert the button
-
addDialogClose
Adds a close "button" to the top of the popup.- Parameters:
cmd
- the command that should be executed when the close button is clicked
-
catchNotifications
Replaces current notification widget by an overlay. -
center
- Overrides:
center
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.center()
-
centerHorizontally
Shows the dialog and centers it horizontally, but positions it at a fixed vertical position.- Parameters:
top
- the top position
-
clear
- Specified by:
clear
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Overrides:
clear
in classcom.google.gwt.user.client.ui.Panel
- See Also:
-
Panel.clear()
-
getAvailableHeight
Returns the maximum available height inside the popup.- Parameters:
fixedContentHeight
- fixed content height to deduct from the available height- Returns:
- the maximum available height
-
getCaption
Returns the dialog caption text.- Returns:
- the dialog caption
-
getWidget
Returns the child widget with the given index.- Parameters:
index
- the index- Returns:
- the child widget
-
getWidgetCount
Returns the number of child widgets.- Returns:
- the number of child widgets
-
getWidgetIndex
Returns the index of the given widget.- Parameters:
child
- the child widget- Returns:
- the index of the child widget
-
getWidgetIndex
Returns the index of the given child widget.- Parameters:
child
- the child widget- Returns:
- the index
-
getWidth
Returns the dialog content width, -1 if not set.- Returns:
- the dialog content width
-
hasCaption
Returnstrue
if a caption is set for this popupfalse
otherwise.- Returns:
true
if a caption is set for this popupfalse
otherwise
-
hide
Description copied from interface:I_CmsAutoHider
Hides the widget.- Specified by:
hide
in interfaceI_CmsAutoHider
- Overrides:
hide
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.hide()
-
hide
- Overrides:
hide
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.hide(boolean)
-
insert
public void insert(com.google.gwt.user.client.ui.Widget w, int beforeIndex) throws IndexOutOfBoundsException Inserts a child widget before the given index.- Parameters:
w
- the child widgetbeforeIndex
- the index- Throws:
IndexOutOfBoundsException
- if the index is out of bounds
-
insertFront
Inserts a widget as the first widget in the popup.- Parameters:
widget
- the widget to insert
-
iterator
-
onBrowserEvent
- Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
- See Also:
-
Widget.onBrowserEvent(com.google.gwt.user.client.Event)
-
remove
Removes a child widget.- Parameters:
index
- the index of the widget to remove- Returns:
true
if the there was a widget at the given index to remove
-
remove
- Specified by:
remove
in interfacecom.google.gwt.user.client.ui.HasWidgets
- Overrides:
remove
in classcom.google.gwt.user.client.ui.SimplePanel
- See Also:
-
SimplePanel.remove(com.google.gwt.user.client.ui.Widget)
-
removeAllButtons
Removes all buttons. -
removeButton
Removes the given button widget from the button panel.- Parameters:
button
- the button widget to remove
-
removePadding
Removes the padding from the popup's content. -
setBackgroundColor
Sets the popup's content background.- Parameters:
color
- the color to set
-
setCaption
Sets the captions text.- Parameters:
caption
- the text to set
-
setHeight
Sets the height for the popup content.- Parameters:
height
- the height in pixels
-
setHeight
Deprecated.- Overrides:
setHeight
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.setHeight(java.lang.String)
-
setMainContent
Replaces the content from the main widget.- Parameters:
w
- the widget that should replace the main content
-
setPixelSize
Deprecated.- Overrides:
setPixelSize
in classcom.google.gwt.user.client.ui.UIObject
- See Also:
-
UIObject.setSize(java.lang.String, java.lang.String)
-
setPositionFixed
Sets the popup's dialog position to 'fixed'. -
setSize
Deprecated.- Overrides:
setSize
in classcom.google.gwt.user.client.ui.UIObject
- See Also:
-
UIObject.setSize(java.lang.String, java.lang.String)
-
setSpecialBackgroundClass
Sets an additional CSS class to the main content element.- Parameters:
cssClassName
- the CSS class to set
-
setUseAnimation
Sets the use animation flag.- Parameters:
use
-true
if the animation should be used, default istrue
-
setWidget
Deprecated.Unsupported operation.- Specified by:
setWidget
in interfacecom.google.gwt.user.client.ui.HasOneWidget
- Overrides:
setWidget
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.setWidget(com.google.gwt.user.client.ui.Widget)
-
setWidth
Sets the width for the popup content.- Parameters:
width
- the width in pixels
-
setWidth
Deprecated.- Overrides:
setWidth
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.setWidth(java.lang.String)
-
show
- Overrides:
show
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.show()
-
add
protected void add(com.google.gwt.user.client.ui.Widget child, com.google.gwt.dom.client.Element container) Adds a new child widget to the panel, attaching its Element to the specified container Element.- Parameters:
child
- the child widget to be addedcontainer
- the element within which the child will be contained
-
adjustIndex
Adjusts beforeIndex to account for the possibility that the given widget is already a child of this panel.- Parameters:
child
- the widget that might be an existing childbeforeIndex
- the index at which it will be added to this panel- Returns:
- the modified index
-
beginDragging
Called on mouse down in the caption area, begins the dragging loop by turning on event capture.- Parameters:
event
- the mouse down event that triggered dragging- See Also:
-
DOM.setCapture(com.google.gwt.dom.client.Element)
continueDragging(com.google.gwt.event.dom.client.MouseMoveEvent)
-
checkIndexBoundsForAccess
Checks thatindex
is in the range [0, getWidgetCount()), which is the valid range on accessible indexes.- Parameters:
index
- the index being accessed
-
checkIndexBoundsForInsertion
Checks thatindex
is in the range [0, getWidgetCount()], which is the valid range for indexes on an insertion.- Parameters:
index
- the index where insertion will occur
-
continueDragging
Called on mouse move in the caption area, continues dragging if it was started bybeginDragging(com.google.gwt.event.dom.client.MouseDownEvent)
.- Parameters:
event
- the mouse move event that continues dragging- See Also:
-
createDialogNotificationWidget
Creates a new notification widget for this dialog.- Returns:
- the notification widget for this dialog
-
doAttachChildren
- Overrides:
doAttachChildren
in classcom.google.gwt.user.client.ui.Panel
- See Also:
-
Panel.doAttachChildren()
-
doDetachChildren
- Overrides:
doDetachChildren
in classcom.google.gwt.user.client.ui.Panel
- See Also:
-
Panel.doDetachChildren()
-
endDragging
Called on mouse up in the caption area, ends dragging by ending event capture.- Parameters:
event
- the mouse up event that ended dragging- See Also:
-
DOM.releaseCapture(com.google.gwt.dom.client.Element)
beginDragging(com.google.gwt.event.dom.client.MouseDownEvent)
endDragging(com.google.gwt.event.dom.client.MouseUpEvent)
-
getChildren
Gets the list of children contained in this panel.- Returns:
- a collection of child widgets
-
getContainerElement
- Overrides:
getContainerElement
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.getContainerElement()
-
insert
protected void insert(com.google.gwt.user.client.ui.Widget child, com.google.gwt.dom.client.Element container, int beforeIndex, boolean domInsert) Insert a new child Widget into this Panel at a specified index, attaching its Element to the specified container Element. The child Element will either be attached to the container at the same index, or simply appended to the container, depending on the value ofdomInsert
.- Parameters:
child
- the child Widget to be addedcontainer
- the Element within whichchild
will be containedbeforeIndex
- the index before whichchild
will be inserteddomInsert
- iftrue
, insertchild
intocontainer
atbeforeIndex
; otherwise appendchild
to the end ofcontainer
.
-
installNotificationWidget
Sets the notification widget. -
onDetach
Override to work around the glass overlay still showing after dialog hide.- Overrides:
onDetach
in classcom.google.gwt.user.client.ui.Widget
- See Also:
-
Widget.onDetach()
-
onPreviewNativeEvent
- Overrides:
onPreviewNativeEvent
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
-
PopupPanel.onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent)
-
showArrow
Appends the arrow element to the popup's dialog.- Parameters:
arrow
- the arrow element to add
-