|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.DialogBox
public class DialogBox
A form of popup that has a caption area at the top and can be dragged by the user.
public class DialogBoxExample implements EntryPoint, ClickListener { private static class MyDialog extends DialogBox { public MyDialog() { // Set the dialog box's caption. setText("My First Dialog"); // DialogBox is a SimplePanel, so you have to set it's widget property to // whatever you want its contents to be. Button ok = new Button("OK"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { MyDialog.this.hide(); } }); setWidget(ok); } } public void onModuleLoad() { Button b = new Button("Click me"); b.addClickListener(this); RootPanel.get().add(b); } public void onClick(Widget sender) { // Instantiate the dialog box and show it. new MyDialog().show(); } }
Constructor Summary | |
---|---|
DialogBox()
Creates an empty dialog box. |
|
DialogBox(boolean autoHide)
Creates an empty dialog box specifying its "auto-hide" property. |
Method Summary | |
---|---|
java.lang.String |
getHTML()
Gets this object's contents as HTML. |
java.lang.String |
getText()
Gets this object's text. |
void |
onMouseDown(Widget sender,
int x,
int y)
Fired when the user depresses the mouse button over a widget. |
void |
onMouseEnter(Widget sender)
Fired when the mouse enters a widget's area. |
void |
onMouseLeave(Widget sender)
Fired when the mouse leaves a widget's area. |
void |
onMouseMove(Widget sender,
int x,
int y)
Fired when the user moves the mouse over a widget. |
void |
onMouseUp(Widget sender,
int x,
int y)
Fired when the user releases the mouse button over a widget. |
boolean |
remove(Widget w)
Removes a child widget. |
void |
setHTML(java.lang.String html)
Sets this object's contents via HTML. |
void |
setText(java.lang.String text)
Sets this object's text. |
void |
setWidget(Widget w)
Sets this panel's widget. |
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel |
---|
addPopupListener, getPopupLeft, getPopupTop, hide, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, removePopupListener, setPopupPosition, show |
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel |
---|
add, getContainerElement, getWidget, iterator |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
adopt, clear, disown, onAttach, onDetach |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
getParent, isAttached, onBrowserEvent, onLoad, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DialogBox()
SimplePanel.add(Widget)
.
public DialogBox(boolean autoHide)
SimplePanel.add(Widget)
.
autoHide
- true
if the dialog should be automatically
hidden when the user clicks outside of itMethod Detail |
---|
public java.lang.String getHTML()
HasHTML
getHTML
in interface HasHTML
public java.lang.String getText()
HasText
getText
in interface HasText
public void onMouseDown(Widget sender, int x, int y)
MouseListener
onMouseDown
in interface MouseListener
sender
- the widget sending the eventx
- the x coordinate of the mousey
- the y coordinate of the mousepublic void onMouseEnter(Widget sender)
MouseListener
onMouseEnter
in interface MouseListener
sender
- the widget sending the eventpublic void onMouseLeave(Widget sender)
MouseListener
onMouseLeave
in interface MouseListener
sender
- the widget sending the eventpublic void onMouseMove(Widget sender, int x, int y)
MouseListener
onMouseMove
in interface MouseListener
sender
- the widget sending the eventx
- the x coordinate of the mousey
- the y coordinate of the mousepublic void onMouseUp(Widget sender, int x, int y)
MouseListener
onMouseUp
in interface MouseListener
sender
- the widget sending the eventx
- the x coordinate of the mousey
- the y coordinate of the mousepublic boolean remove(Widget w)
HasWidgets
remove
in interface HasWidgets
remove
in class PopupPanel
w
- the widget to be removed
true
if the widget was presentpublic void setHTML(java.lang.String html)
HasHTML
HasText.setText(String)
whenever possible.
setHTML
in interface HasHTML
html
- the object's new HTMLpublic void setText(java.lang.String text)
HasText
setText
in interface HasText
text
- the object's new textpublic void setWidget(Widget w)
SimplePanel
setWidget
in class SimplePanel
w
- the panel's new widget (null
will clear the panel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |