A form of popup that has a caption area at the top and can be dragged by the
user. Unlike a PopupPanel, calls to setWidth(String)
and
setHeight(String)
will set the width and height of the dialog box
itself, even if a widget has not been added as yet.
DialogBox elements in
UiBinder
templates can
have one widget child and one <g:caption> child. (Note the lower case
"c", meant to signal that the caption is not a runtime object, and so cannot
have a ui:field
attribute.) The body of the
caption can be html.
For example:
<g:DialogBox autoHide="true" modal="true"> <g:caption><b>Caption text</b></g:caption> <g:HTMLPanel> Body text <g:Button ui:field='cancelButton'>Cancel</g:Button> <g:Button ui:field='okButton'>Okay</g:Button> </g:HTMLPanel> </g:DialogBox>
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DialogBox.Caption | Set of characteristic interfaces supported by the DialogBox caption
Note that this set might expand over time, so implement this interface at
your own risk. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty dialog box.
| |||||||||||
Creates an empty dialog box specifying its "auto-hide" property.
| |||||||||||
Creates an empty dialog box specifying its "auto-hide" property.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Provides access to the dialog's caption.
| |||||||||||
Gets this object's contents as HTML.
| |||||||||||
Gets this object's text.
| |||||||||||
Hides the popup and detaches it from the page.
| |||||||||||
Fired whenever a browser event is received.
| |||||||||||
This method is deprecated.
Use
beginDragging(MouseDownEvent) and getCaption()
instead
| |||||||||||
This method is deprecated.
Use
addMouseOverHandler(MouseOverHandler) instead
| |||||||||||
This method is deprecated.
Use
addMouseOutHandler(MouseOutHandler) instead
| |||||||||||
This method is deprecated.
Use
continueDragging(MouseMoveEvent) and getCaption() instead
| |||||||||||
This method is deprecated.
Use
endDragging(MouseUpEvent) and getCaption() instead
| |||||||||||
Sets the html string inside the caption.
| |||||||||||
Sets the html string inside the caption.
| |||||||||||
Sets the text inside the caption.
| |||||||||||
Shows the popup and attach it to the page.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called on mouse down in the caption area, begins the dragging loop by
turning on event capture.
| |||||||||||
Called on mouse move in the caption area, continues dragging if it was
started by
beginDragging(MouseDownEvent) . | |||||||||||
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 call
onAttach() for each of its
child widgets. | |||||||||||
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 call
onDetach() for each of its
child widgets. | |||||||||||
Called on mouse up in the caption area, ends dragging by ending event
capture.
| |||||||||||
Affected Elements:
| |||||||||||
Creates an empty dialog box. It should not be shown until its child widget
has been added using add(Widget)
.
Creates an empty dialog box specifying its "auto-hide" property. It should
not be shown until its child widget has been added using
add(Widget)
.
autoHide | true if the dialog should be automatically
hidden when the user clicks outside of it
|
---|
Creates an empty dialog box specifying its "auto-hide" property. It should
not be shown until its child widget has been added using
add(Widget)
.
autoHide | true if the dialog should be automatically
hidden when the user clicks outside of it |
---|---|
modal | true if keyboard and mouse events for widgets not
contained by the dialog should be ignored
|
Provides access to the dialog's caption. This method is final because the Caption interface will expand. Therefore it is highly likely that subclasses which implemented this method would end up breaking.
Hides the popup and detaches it from the page. This has no effect if it is not currently showing.
Fired whenever a browser event is received.
event | the event received |
---|
This method is deprecated.
Use beginDragging(MouseDownEvent)
and getCaption()
instead
Fired when the user depresses the mouse button over a widget.
sender | the widget sending the event |
---|---|
x | the x coordinate of the mouse |
y | the y coordinate of the mouse |
This method is deprecated.
Use addMouseOverHandler(MouseOverHandler)
instead
Fired when the mouse enters a widget's area.
sender | the widget sending the event |
---|
This method is deprecated.
Use addMouseOutHandler(MouseOutHandler)
instead
Fired when the mouse leaves a widget's area.
sender | the widget sending the event |
---|
This method is deprecated.
Use continueDragging(MouseMoveEvent)
and getCaption()
instead
Fired when the user moves the mouse over a widget.
sender | the widget sending the event |
---|---|
x | the x coordinate of the mouse |
y | the y coordinate of the mouse |
This method is deprecated.
Use endDragging(MouseUpEvent)
and getCaption()
instead
Fired when the user releases the mouse button over a widget.
sender | the widget sending the event |
---|---|
x | the x coordinate of the mouse |
y | the y coordinate of the mouse |
Sets the html string inside the caption.
Use setWidget(Widget)
to set the contents inside the
DialogBox
.
html | the object's new HTML |
---|
Sets the html string inside the caption.
Use setWidget(Widget)
to set the contents inside the
DialogBox
.
html | the object's new HTML |
---|
Sets the text inside the caption.
Use setWidget(Widget)
to set the contents inside the
DialogBox
.
text | the object's new text |
---|
Shows the popup and attach it to the page. It must have a child widget before this method is called.
Called on mouse down in the caption area, begins the dragging loop by turning on event capture.
event | the mouse down event that triggered dragging |
---|
Called on mouse move in the caption area, continues dragging if it was
started by beginDragging(MouseDownEvent)
.
event | the mouse move event that continues dragging |
---|
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 call onAttach()
for each of its
child widgets.
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 call onDetach()
for each of its
child widgets.
Called on mouse up in the caption area, ends dragging by ending event capture.
event | the mouse up event that ended dragging |
---|
Affected Elements:
DialogBox
.baseID | the base ID used by the main element |
---|