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,CmsConfirmSaveDialog,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,CmsYesNoDialog
Provides a pop up dialog base.
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHandles 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.PositionCallbackNested 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.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default width of this dialog.protected com.google.gwt.user.client.CommandThe close command.protected booleanFlag which indicates whether the notification widget has already been installed.protected intThe window width.static final intThe wide dialog width.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.google.gwt.user.client.ui.Widget w) Adds the given child widget.protected voidadd(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.voidaddButton(com.google.gwt.user.client.ui.Widget button) Adds a button widget to the button panel.voidaddButton(com.google.gwt.user.client.ui.Widget button, int position) Adds a button widget to the button panel before the given position.voidaddDialogClose(com.google.gwt.user.client.Command cmd) Adds a close "button" to the top of the popup.protected intadjustIndex(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 voidbeginDragging(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.voidReplaces current notification widget by an overlay.voidcenter()voidcenterHorizontally(int top) Shows the dialog and centers it horizontally, but positions it at a fixed vertical position.protected voidcheckIndexBoundsForAccess(int index) Checks thatindexis in the range [0, getWidgetCount()), which is the valid range on accessible indexes.protected voidcheckIndexBoundsForInsertion(int index) Checks thatindexis in the range [0, getWidgetCount()], which is the valid range for indexes on an insertion.voidclear()protected voidcontinueDragging(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 CmsNotificationWidgetCreates a new notification widget for this dialog.protected voidprotected voidprotected voidendDragging(com.google.gwt.event.dom.client.MouseUpEvent event) Called on mouse up in the caption area, ends dragging by ending event capture.intgetAvailableHeight(int fixedContentHeight) Returns the maximum available height inside the popup.Returns the dialog caption text.protected com.google.gwt.user.client.ui.WidgetCollectionGets the list of children contained in this panel.protected com.google.gwt.user.client.Elementcom.google.gwt.user.client.ui.WidgetgetWidget(int index) Returns the child widget with the given index.intReturns the number of child widgets.intgetWidgetIndex(com.google.gwt.user.client.ui.IsWidget child) Returns the index of the given widget.intgetWidgetIndex(com.google.gwt.user.client.ui.Widget child) Returns the index of the given child widget.intgetWidth()Returns the dialog content width, -1 if not set.booleanReturnstrueif a caption is set for this popupfalseotherwise.voidhide()Hides the widget.voidhide(boolean autoClosed) voidinsert(com.google.gwt.user.client.ui.Widget w, int beforeIndex) Inserts a child widget before the given index.protected voidinsert(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.voidinsertFront(com.google.gwt.user.client.ui.Widget widget) Inserts a widget as the first widget in the popup.protected voidSets the notification widget.Iterator<com.google.gwt.user.client.ui.Widget> iterator()voidonBrowserEvent(com.google.gwt.user.client.Event event) protected voidonDetach()Override to work around the glass overlay still showing after dialog hide.protected voidonPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event) booleanremove(int index) Removes a child widget.booleanremove(com.google.gwt.user.client.ui.Widget w) voidRemoves all buttons.voidremoveButton(com.google.gwt.user.client.ui.Widget button) Removes the given button widget from the button panel.voidRemoves the padding from the popup's content.voidsetBackgroundColor(String color) Sets the popup's content background.voidsetCaption(String caption) Sets the captions text.voidsetHeight(int height) Sets the height for the popup content.voidDeprecated.voidsetMainContent(com.google.gwt.user.client.ui.Widget w) Replaces the content from the main widget.voidsetPixelSize(int width, int height) Deprecated.voidSets the popup's dialog position to 'fixed'.voidDeprecated.voidsetSpecialBackgroundClass(String cssClassName) Sets an additional CSS class to the main content element.voidsetUseAnimation(boolean use) Sets the use animation flag.voidsetWidget(com.google.gwt.user.client.ui.Widget w) Deprecated.voidsetWidth(int width) Sets the width for the popup content.voidDeprecated.voidshow()protected voidshowArrow(com.google.gwt.dom.client.Element arrow) Appends the arrow element to the popup's dialog.static com.google.gwt.user.client.ui.WidgetwrapWithBorderPadding(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, showRelativeToMethods inherited from class com.google.gwt.user.client.ui.SimplePanel
getWidget, setWidgetMethods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, orphan, removeMethods 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, unsinkEventsMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface org.opencms.gwt.client.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabledMethods 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:
addin interfacecom.google.gwt.user.client.ui.HasWidgets- Overrides:
addin 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:
centerin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
centerHorizontally
Shows the dialog and centers it horizontally, but positions it at a fixed vertical position.- Parameters:
top- the top position
-
clear
- Specified by:
clearin interfacecom.google.gwt.user.client.ui.HasWidgets- Overrides:
clearin classcom.google.gwt.user.client.ui.Panel- See Also:
-
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
Returnstrueif a caption is set for this popupfalseotherwise.- Returns:
trueif a caption is set for this popupfalseotherwise
-
hide
Description copied from interface:I_CmsAutoHiderHides the widget.- Specified by:
hidein interfaceI_CmsAutoHider- Overrides:
hidein classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
hide
- Overrides:
hidein classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
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:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget- See Also:
-
remove
Removes a child widget.- Parameters:
index- the index of the widget to remove- Returns:
trueif the there was a widget at the given index to remove
-
remove
- Specified by:
removein interfacecom.google.gwt.user.client.ui.HasWidgets- Overrides:
removein classcom.google.gwt.user.client.ui.SimplePanel- See Also:
-
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:
setHeightin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
setMainContent
Replaces the content from the main widget.- Parameters:
w- the widget that should replace the main content
-
setPixelSize
Deprecated.- Overrides:
setPixelSizein classcom.google.gwt.user.client.ui.UIObject- See Also:
-
setPositionFixed
Sets the popup's dialog position to 'fixed'. -
setSize
Deprecated.- Overrides:
setSizein classcom.google.gwt.user.client.ui.UIObject- See Also:
-
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-trueif the animation should be used, default istrue
-
setWidget
Deprecated.Unsupported operation.- Specified by:
setWidgetin interfacecom.google.gwt.user.client.ui.HasOneWidget- Overrides:
setWidgetin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
setWidth
Sets the width for the popup content.- Parameters:
width- the width in pixels
-
setWidth
Deprecated.- Overrides:
setWidthin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
show
- Overrides:
showin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
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:
-
checkIndexBoundsForAccess
Checks thatindexis in the range [0, getWidgetCount()), which is the valid range on accessible indexes.- Parameters:
index- the index being accessed
-
checkIndexBoundsForInsertion
Checks thatindexis 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:
doAttachChildrenin classcom.google.gwt.user.client.ui.Panel- See Also:
-
doDetachChildren
- Overrides:
doDetachChildrenin classcom.google.gwt.user.client.ui.Panel- See Also:
-
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:
-
getChildren
Gets the list of children contained in this panel.- Returns:
- a collection of child widgets
-
getContainerElement
- Overrides:
getContainerElementin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
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 whichchildwill be containedbeforeIndex- the index before whichchildwill be inserteddomInsert- iftrue, insertchildintocontaineratbeforeIndex; otherwise appendchildto the end ofcontainer.
-
installNotificationWidget
Sets the notification widget. -
onDetach
Override to work around the glass overlay still showing after dialog hide.- Overrides:
onDetachin classcom.google.gwt.user.client.ui.Widget- See Also:
-
onPreviewNativeEvent
- Overrides:
onPreviewNativeEventin classcom.google.gwt.user.client.ui.PopupPanel- See Also:
-
showArrow
Appends the arrow element to the popup's dialog.- Parameters:
arrow- the arrow element to add
-