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 |
Known Direct Subclasses |
Known Indirect Subclasses |
A panel that can "pop up" over other widgets. It overlays the browser's client area (and any previously-created popups).
A PopupPanel should not generally be added to other panels; rather, it should
be shown and hidden using the show()
and hide()
methods.
The width and height of the PopupPanel cannot be explicitly set; they are
determined by the PopupPanel's widget. Calls to setWidth(String)
and
setHeight(String)
will call these methods on the PopupPanel's
widget.
The PopupPanel can be optionally displayed with a "glass" element behind it,
which is commonly used to gray out the widgets behind it. It can be enabled
using setGlassEnabled(boolean)
. It has a default style name of
"gwt-PopupPanelGlass", which can be changed using
setGlassStyleName(String)
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PopupPanel.PositionCallback | A callback that is used to set the position of a PopupPanel right
before it is shown. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty popup panel.
| |||||||||||
Creates an empty popup panel, specifying its "auto-hide" property.
| |||||||||||
Creates an empty popup panel, specifying its "auto-hide" and "modal"
properties.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Mouse events that occur within an autoHide partner will not hide a panel
set to autoHide.
| |||||||||||
This method is deprecated.
Use
addCloseHandler(CloseHandler instead
| |||||||||||
Centers the popup in the browser window and shows it.
| |||||||||||
Gets the style name to be used on the glass element.
| |||||||||||
Gets the panel's offset height in pixels.
| |||||||||||
Gets the panel's offset width in pixels.
| |||||||||||
Gets the popup's left position relative to the browser's client area.
| |||||||||||
Gets the popup's top position relative to the browser's client area.
| |||||||||||
Gets the title associated with this object.
| |||||||||||
Hides the popup and detaches it from the page.
| |||||||||||
Hides the popup and detaches it from the page.
| |||||||||||
Returns true if animations are enabled, false if not.
| |||||||||||
Returns
true if the popup should be automatically hidden when
the user clicks outside of it. | |||||||||||
Returns
true if the popup should be automatically hidden when
the history token changes, such as when the user presses the browser's back
button. | |||||||||||
Returns
true if a glass element will be displayed under the
PopupPanel . | |||||||||||
Returns
true if keyboard or mouse events that do not target
the PopupPanel or its children should be ignored. | |||||||||||
Returns
true if the popup should preview all native events,
even if the event has already been consumed by another popup. | |||||||||||
Determines whether or not this popup is showing.
| |||||||||||
Determines whether or not this popup is visible.
| |||||||||||
This method is deprecated.
Use
onPreviewNativeEvent(Event.NativePreviewEvent) instead
| |||||||||||
This method is deprecated.
Use
onPreviewNativeEvent(Event.NativePreviewEvent) instead
| |||||||||||
This method is deprecated.
Use
onPreviewNativeEvent(Event.NativePreviewEvent) instead
| |||||||||||
This method is deprecated.
Use
onPreviewNativeEvent(Event.NativePreviewEvent) instead
| |||||||||||
Remove an autoHide partner.
| |||||||||||
This method is deprecated.
Use the
removeHandler() method on the
object returned by addCloseHandler(CloseHandler instead
| |||||||||||
Enable or disable animations.
| |||||||||||
Enable or disable the autoHide feature.
| |||||||||||
Enable or disable autoHide on history change events.
| |||||||||||
When enabled, the background will be blocked with a semi-transparent pane
the next time it is shown.
| |||||||||||
Sets the style name to be used on the glass element.
| |||||||||||
Sets the height of the panel's child widget.
| |||||||||||
When the popup is modal, keyboard or mouse events that do not target the
PopupPanel or its children will be ignored.
| |||||||||||
Sets the popup's position relative to the browser's client area.
| |||||||||||
Sets the popup's position using a
PopupPanel.PositionCallback , and shows the
popup. | |||||||||||
When enabled, the popup will preview all native events, even if another popup was opened after this one. | |||||||||||
Sets the title associated with this object.
| |||||||||||
Sets whether this object is visible.
| |||||||||||
Sets this panel's widget.
| |||||||||||
Sets the width of the panel's child widget.
| |||||||||||
Shows the popup and attach it to the page.
| |||||||||||
Normally, the popup is positioned directly below the relative target, with
its left edge aligned with the left edge of the target.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Override this method to specify that an element other than the root element
be the container for the panel's child widget.
| |||||||||||
Get the glass element used by this
PopupPanel . | |||||||||||
Template method that returns the element to which style names will be
applied.
| |||||||||||
This method is called immediately before a widget will be detached from the
browser's document.
|
Creates an empty popup panel. A child widget must be added to it before it is shown.
Creates an empty popup panel, specifying its "auto-hide" property.
autoHide | true if the popup should be automatically
hidden when the user clicks outside of it or the history token
changes.
|
---|
Creates an empty popup panel, specifying its "auto-hide" and "modal" properties.
autoHide | true if the popup should be automatically
hidden when the user clicks outside of it or the history token
changes. |
---|---|
modal | true if keyboard or mouse events that do not
target the PopupPanel or its children should be ignored
|
Mouse events that occur within an autoHide partner will not hide a panel set to autoHide.
partner | the auto hide partner to add |
---|
This method is deprecated.
Use addCloseHandler(CloseHandler
instead
Adds a listener interface to receive popup events.
listener | the listener interface to add. |
---|
Centers the popup in the browser window and shows it. If the popup was already showing, then the popup is centered.
Gets the style name to be used on the glass element. By default, this is "gwt-PopupPanelGlass".
Gets the panel's offset height in pixels. Calls to
setHeight(String)
before the panel's child widget is set will not
influence the offset height.
Gets the panel's offset width in pixels. Calls to setWidth(String)
before the panel's child widget is set will not influence the offset width.
Gets the popup's left position relative to the browser's client area.
Gets the popup's top position relative to the browser's client area.
Gets the title associated with this object. The title is the 'tool-tip' displayed to users when they hover over the object.
Hides the popup and detaches it from the page. This has no effect if it is not currently showing.
Hides the popup and detaches it from the page. This has no effect if it is not currently showing.
autoClosed | the value that will be passed to
onClose(CloseEvent) when the popup is closed
|
---|
Returns true if animations are enabled, false if not.
Returns true
if the popup should be automatically hidden when
the user clicks outside of it.
Returns true
if the popup should be automatically hidden when
the history token changes, such as when the user presses the browser's back
button.
Returns true
if a glass element will be displayed under the
PopupPanel
.
Returns true
if keyboard or mouse events that do not target
the PopupPanel or its children should be ignored.
Returns true
if the popup should preview all native events,
even if the event has already been consumed by another popup.
Determines whether or not this popup is visible. Note that this just checks
the visibility
style attribute, which is set in the
setVisible(boolean)
method. If you want to know if the popup is
attached to the page, use isShowing()
instead.
true
if the object is visible
This method is deprecated.
Use onPreviewNativeEvent(Event.NativePreviewEvent)
instead
Called when a browser event occurs and this event preview is on top of the preview stack.
event | the browser event |
---|
false
to cancel the event
This method is deprecated.
Use onPreviewNativeEvent(Event.NativePreviewEvent)
instead
Popups get an opportunity to preview keyboard events before they are passed to a widget contained by the Popup.
key | the key code of the depressed key |
---|---|
modifiers | keyboard modifiers, as specified in
KeyCodes . |
false
to suppress the event
This method is deprecated.
Use onPreviewNativeEvent(Event.NativePreviewEvent)
instead
Popups get an opportunity to preview keyboard events before they are passed to a widget contained by the Popup.
key | the unicode character pressed |
---|---|
modifiers | keyboard modifiers, as specified in
KeyCodes . |
false
to suppress the event
This method is deprecated.
Use onPreviewNativeEvent(Event.NativePreviewEvent)
instead
Popups get an opportunity to preview keyboard events before they are passed to a widget contained by the Popup.
key | the key code of the released key |
---|---|
modifiers | keyboard modifiers, as specified in
KeyCodes . |
false
to suppress the eventRemove an autoHide partner.
partner | the auto hide partner to remove |
---|
This method is deprecated.
Use the removeHandler()
method on the
object returned by addCloseHandler(CloseHandler
instead
Removes a previously added popup listener.
listener | the listener interface to remove. |
---|
Enable or disable animations.
enable | true to enable, false to disable |
---|
Enable or disable the autoHide feature. When enabled, the popup will be automatically hidden when the user clicks outside of it.
autoHide | true to enable autoHide, false to disable |
---|
Enable or disable autoHide on history change events. When enabled, the popup will be automatically hidden when the history token changes, such as when the user presses the browser's back button. Disabled by default.
enabled | true to enable, false to disable |
---|
When enabled, the background will be blocked with a semi-transparent pane the next time it is shown. If the PopupPanel is already visible, the glass will not be displayed until it is hidden and shown again.
enabled | true to enable, false to disable |
---|
Sets the style name to be used on the glass element. By default, this is "gwt-PopupPanelGlass".
glassStyleName | the glass element's style name |
---|
Sets the height of the panel's child widget. If the panel's child widget has not been set, the height passed in will be cached and used to set the height immediately after the child widget is set.
Note that subclasses may have a different behavior. A subclass may decide not to change the height of the child widget. It may instead decide to change the height of an internal panel widget, which contains the child widget.
height | the object's new height, in CSS units (e.g. "10px", "1em") |
---|
When the popup is modal, keyboard or mouse events that do not target the PopupPanel or its children will be ignored.
modal | true to make the popup modal |
---|
Sets the popup's position relative to the browser's client area. The
popup's position may be set before calling show()
.
left | the left position, in pixels |
---|---|
top | the top position, in pixels |
Sets the popup's position using a PopupPanel.PositionCallback
, and shows the
popup. The callback allows positioning to be performed based on the
offsetWidth and offsetHeight of the popup, which are normally not available
until the popup is showing. By positioning the popup before it is shown,
the the popup will not jump from its original position to the new position.
callback | the callback to set the position of the popup |
---|
When enabled, the popup will preview all native events, even if another popup was opened after this one.
If autoHide is enabled, enabling this feature will cause the popup to autoHide even if another non-modal popup was shown after it. If this feature is disabled, the popup will only autoHide if it was the last popup opened.
previewAllNativeEvents | true to enable, false to disable |
---|
Sets the title associated with this object. The title is the 'tool-tip' displayed to users when they hover over the object.
title | the object's new title |
---|
Sets whether this object is visible. This method just sets the
visibility
style attribute. You need to call show()
to actually attached/detach the PopupPanel
to the page.
visible | true to show the object, false to
hide it |
---|
Sets this panel's widget. Any existing child widget will be removed.
w | the panel's new widget, or null to clear the panel
|
---|
Sets the width of the panel's child widget. If the panel's child widget has not been set, the width passed in will be cached and used to set the width immediately after the child widget is set.
Note that subclasses may have a different behavior. A subclass may decide not to change the width of the child widget. It may instead decide to change the width of an internal panel widget, which contains the child widget.
width | the object's new width, in CSS units (e.g. "10px", "1em") |
---|
Shows the popup and attach it to the page. It must have a child widget before this method is called.
Normally, the popup is positioned directly below the relative target, with its left edge aligned with the left edge of the target. Depending on the width and height of the popup and the distance from the target to the bottom and right edges of the window, the popup may be displayed directly above the target, and/or its right edge may be aligned with the right edge of the target.
target | the target to show the popup below |
---|
Override this method to specify that an element other than the root element
be the container for the panel's child widget. This can be useful when you
want to create a simple panel that decorates its contents.
Note that this method continues to return the
Element
class defined in the
User
module to maintain backwards compatibility.
Get the glass element used by this PopupPanel
. The element is not
created until it is enabled via setGlassEnabled(boolean)
.
Template method that returns the element to which style names will be applied. By default it returns the root element, but this method may be overridden to apply styles to a child element.
This method is called immediately before a widget will be detached from the browser's document.