Package com.google.gwt.user.client.ui
Class DecoratedPopupPanel
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
com.google.gwt.user.client.ui.DecoratedPopupPanel
- All Implemented Interfaces:
HasAttachHandlers
,HasCloseHandlers<PopupPanel>
,HasHandlers
,EventListener
,EventPreview
,AcceptsOneWidget
,HasAnimation
,HasOneWidget
,HasVisibility
,HasWidgets
,HasWidgets.ForIsWidget
,IsWidget
,SourcesPopupEvents
,Iterable<Widget>
- Direct Known Subclasses:
DialogBox
A PopupPanel
that wraps its content in a 3x3 grid, which allows users
to add rounded corners.
Setting the Size:
If you set the width or height of the DecoratedPopupPanel
, you need
to set the height and width of the middleCenter cell to 100% so that the
middleCenter cell takes up all of the available space. If you do not set the
width and height of the DecoratedPopupPanel
, it will wrap its
contents tightly.
.gwt-DecoratedPopupPanel .popupMiddleCenter { height: 100%; width: 100%; }
CSS Style Rules
- .gwt-DecoratedPopupPanel { the outside of the popup }
- .gwt-DecoratedPopupPanel .popupContent { the wrapper around the content }
- .gwt-DecoratedPopupPanel .popupTopLeft { the top left cell }
- .gwt-DecoratedPopupPanel .popupTopLeftInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupTopCenter { the top center cell }
- .gwt-DecoratedPopupPanel .popupTopCenterInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupTopRight { the top right cell }
- .gwt-DecoratedPopupPanel .popupTopRightInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupMiddleLeft { the middle left cell }
- .gwt-DecoratedPopupPanel .popupMiddleLeftInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupMiddleCenter { the middle center cell }
- .gwt-DecoratedPopupPanel .popupMiddleCenterInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupMiddleRight { the middle right cell }
- .gwt-DecoratedPopupPanel .popupMiddleRightInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupBottomLeft { the bottom left cell }
- .gwt-DecoratedPopupPanel .popupBottomLeftInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupBottomCenter { the bottom center cell }
- .gwt-DecoratedPopupPanel .popupBottomCenterInner { the inner element of the cell }
- .gwt-DecoratedPopupPanel .popupBottomRight { the bottom right cell }
- .gwt-DecoratedPopupPanel .popupBottomRightInner { the inner element of the cell }
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
PopupPanel.AnimationType, PopupPanel.PositionCallback, PopupPanel.ResizeAnimation
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
-
Field Summary
Fields inherited from class com.google.gwt.user.client.ui.SimplePanel
widget
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
-
Constructor Summary
ConstructorDescriptionCreates an empty decorated popup panel.DecoratedPopupPanel
(boolean autoHide) Creates an empty decorated popup panel, specifying its "auto-hide" property.DecoratedPopupPanel
(boolean autoHide, boolean modal) Creates an empty decorated popup panel, specifying its "auto-hide" and "modal" properties.DecoratedPopupPanel
(boolean autoHide, boolean modal, String prefix) Creates an empty decorated popup panel using the specified style names. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all child widgets.protected void
If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onAttach()
for each of its child widgets.protected void
If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onDetach()
for each of its child widgets.protected Element
getCellElement
(int row, int cell) Get a specific Element from the panel.Gets the panel's child widget.iterator()
Gets an iterator for the contained widgets.boolean
Removes a child widget.void
Sets this panel's widget.Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getAnimationType, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, hide, hide, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, maybeUpdateSize, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimation, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setHeight, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, setWidth, show, showRelativeTo
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, setWidget
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, removeFromParent, replaceElement, setLayoutData, setParent, 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, setPixelSize, setSize, 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 java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DecoratedPopupPanel
public DecoratedPopupPanel()Creates an empty decorated popup panel. A child widget must be added to it before it is shown. -
DecoratedPopupPanel
public DecoratedPopupPanel(boolean autoHide) Creates an empty decorated popup panel, specifying its "auto-hide" property.- Parameters:
autoHide
-true
if the popup should be automatically hidden when the user clicks outside of it
-
DecoratedPopupPanel
public DecoratedPopupPanel(boolean autoHide, boolean modal) Creates an empty decorated popup panel, specifying its "auto-hide" and "modal" properties.- Parameters:
autoHide
-true
if the popup should be automatically hidden when the user clicks outside of itmodal
-true
if keyboard or mouse events that do not target the PopupPanel or its children should be ignored
-
DecoratedPopupPanel
DecoratedPopupPanel(boolean autoHide, boolean modal, String prefix) Creates an empty decorated popup panel using the specified style names.- Parameters:
autoHide
-true
if the popup should be automatically hidden when the user clicks outside of itmodal
-true
if keyboard or mouse events that do not target the PopupPanel or its children should be ignoredprefix
- the prefix applied to child style names
-
-
Method Details
-
clear
public void clear()Description copied from interface:HasWidgets
Removes all child widgets.- Specified by:
clear
in interfaceHasWidgets
- Overrides:
clear
in classPanel
-
getWidget
Description copied from class:SimplePanel
Gets the panel's child widget.- Specified by:
getWidget
in interfaceHasOneWidget
- Overrides:
getWidget
in classSimplePanel
- Returns:
- the child widget, or
null
if none is present
-
iterator
Description copied from interface:HasWidgets
Gets an iterator for the contained widgets. This iterator is required to implementIterator.remove()
.- Specified by:
iterator
in interfaceHasWidgets
- Specified by:
iterator
in interfaceIterable<Widget>
- Overrides:
iterator
in classSimplePanel
-
remove
Description copied from class:Panel
Removes a child widget.How to Override this Method
There are several important things that must take place in the correct order to properly remove a Widget from a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.
- Validate: Make sure this Panel is actually the parent of the
child Widget; return
false
if it is not. - Orphan: Call
Panel.orphan(Widget)
first while the child Widget is still attached. - Physical Detach: Adjust the DOM to account for the removal of the child Widget. The Widget's Element must be physically removed from the DOM.
- Logical Detach: Update the Panel's state variables to reflect
the removal of the child Widget. Example: the Widget is removed from the
Panel's
WidgetCollection
.
- Specified by:
remove
in interfaceHasWidgets
- Overrides:
remove
in classSimplePanel
- Parameters:
w
- the widget to be removed- Returns:
true
if the child was present
- Validate: Make sure this Panel is actually the parent of the
child Widget; return
-
setWidget
Description copied from class:SimplePanel
Sets this panel's widget. Any existing child widget will be removed.- Specified by:
setWidget
in interfaceHasOneWidget
- Overrides:
setWidget
in classPopupPanel
- Parameters:
w
- the panel's new widget, ornull
to clear the panel
-
doAttachChildren
protected void doAttachChildren()Description copied from class:Widget
If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onAttach()
for each of its child widgets.- Overrides:
doAttachChildren
in classPanel
- See Also:
-
doDetachChildren
protected void doDetachChildren()Description copied from class:Widget
If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onDetach()
for each of its child widgets.- Overrides:
doDetachChildren
in classPanel
- See Also:
-
getCellElement
Get a specific Element from the panel.- Parameters:
row
- the row indexcell
- the cell index- Returns:
- the Element at the given row and cell
-