|
GWT Tk 0.2.3 | |||||||||
| 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
asquare.gwt.tk.client.ui.CPopupPanel
asquare.gwt.tk.client.ui.ModalDialog
asquare.gwt.tk.client.ui.AlertDialog
public class AlertDialog
A modal dialog tailored to conveniently displaying alerts.
Features:
A callback is assigned to each button in the form of a Command.
When a button is pressed, the dialog will be hidden and the command will be executed.
| Nested Class Summary | |
|---|---|
static class |
AlertDialog.ArrowKeyFocusController
A controller which cycles the focus when the arrow keys are pressed. |
static class |
AlertDialog.HideAndExecuteCommand
A command wrapper which hides the dialog then executes a wrapped command. |
static class |
AlertDialog.HotKeyController
A controller which listens for the onkeydown event of a registered hotkey and executes the associated command. |
| Nested classes/interfaces inherited from class asquare.gwt.tk.client.ui.ModalDialog |
|---|
ModalDialog.CaptionWrapper, ModalDialog.FocusOnCloseController, ModalDialog.InitializeFocusController, ModalDialog.PositionDialogController, ModalDialog.PositionDialogControllerIE6 |
| Field Summary | |
|---|---|
static int |
BUTTON_CANCEL
Indicates that a button has the Cancel role. |
static int |
BUTTON_CANCEL_DEFAULT
Indicates that a button has both the Default and Cancel roles. |
static int |
BUTTON_DEFAULT
Indicates that a button has the Default role. |
static int |
BUTTON_PLAIN
Indicates a button which has no special roles. |
static String |
TEXT_CANCEL
Text for the "Cancel" button used in factory generated dialogs. |
static String |
TEXT_OK
Text for the "OK" button used in factory generated dialogs. |
| Fields inherited from class asquare.gwt.tk.client.ui.ModalDialog |
|---|
s_focusImpl, STYLENAME_CAPTION, STYLENAME_CONTENT, STYLENAME_DIALOG, STYLENAME_DRAGGING, STYLENAME_GLASSPANEL |
| Constructor Summary | |
|---|---|
AlertDialog()
Creates an empty AlertDialog. |
|
| Method Summary | |
|---|---|
void |
addButton(String text,
char hotKey,
Command command,
int type)
Adds a button to button panel. |
void |
addButton(Widget widget,
char hotKey,
Command command,
int type)
Adds a widget to button panel. |
protected Widget |
buildCaption()
Factory method which creates the caption. |
protected List |
createControllers()
A factory method which gives a subclass the opportunity to override default controller creation. |
static AlertDialog |
createError(Command okCommand,
String captionText,
String message)
Creates a high severity "stop" modal dialog with an OK button. |
static AlertDialog |
createInfo(Command okCommand,
String captionText,
String message)
Creates a low severity modal dialog with an OK button. |
static AlertDialog |
createWarning(Command okCommand,
String captionText,
String message)
Creates a medium severity modal dialog with a OK and Cancel buttons. |
Widget |
getButton(int index)
Gets the widget in the button panel corresponding to index. |
int |
getButtonCount()
Gets the number of widgets in the button panel. |
String |
getCaptionText()
Get the text which will be displayed in the caption. |
Image |
getIcon()
Get the image which will be displayed in the caption. |
KeyMap |
getKeyMap()
Gets the map of hotkeys to commands. |
Widget |
getMessage()
Get the message which will be displayed in the dialog. |
void |
removeButton(Widget button)
Removes the specified button from the button panel. |
void |
setCaptionText(String captionText,
boolean asHtml)
Set the text which will be displayed in the caption. |
void |
setIcon(Image icon)
Set the image will be displayed in the caption. |
void |
setIcon(String url)
Set the image will be displayed in the caption. |
void |
setMessage(String text)
Set the message which will be displayed in the dialog. |
void |
setMessage(String text,
boolean asHtml)
Set the message which will be displayed in the dialog. |
void |
setMessage(Widget widget)
Set a widget to be displayed in the message area of the dialog. |
void |
show()
Shows the glasspanel and dialog then focuses the widget selected in the focus model. |
void |
show(HasFocus focusOnCloseWidget)
Shows the glasspanel and dialog then focuses the widget selected in the focus model. |
| Methods inherited from class asquare.gwt.tk.client.ui.ModalDialog |
|---|
add, createCaptionControllers, getContentElement, getContentMinHeight, getContentMinWidth, getContentOffsetHeight, getContentOffsetWidth, getFocusModel, getFocusOnCloseWidget, getGlassPanel, hide, onAttach, onDetach, remove, setCaption, setCaption, setContentHeight, setContentMinHeight, setContentMinWidth, setContentWidth, setFocusModel, setWidget |
| Methods inherited from class asquare.gwt.tk.client.ui.CPopupPanel |
|---|
addController, getController, onBrowserEvent, onEventPreview, removeController, setControllers, sinkEvents, unsinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.PopupPanel |
|---|
addPopupListener, getPopupLeft, getPopupTop, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, removePopupListener, setPopupPosition |
| Methods inherited from class com.google.gwt.user.client.ui.SimplePanel |
|---|
getContainerElement, getWidget, iterator |
| Methods inherited from class com.google.gwt.user.client.ui.Panel |
|---|
adopt, clear, disown |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
getParent, isAttached, 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, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TEXT_OK
.tk-AlertDialog-hotKeyChar style to "O".
public static final String TEXT_CANCEL
.tk-AlertDialog-hotKeyChar style to "C".
public static final int BUTTON_PLAIN
public static final int BUTTON_DEFAULT
public static final int BUTTON_CANCEL
Esc will execute the button's associated command. The
dialog may only have one button of this type.
public static final int BUTTON_CANCEL_DEFAULT
Esc to execute this button's command. The dialog may
have no other buttons of type Default or
Cancel.
| Constructor Detail |
|---|
public AlertDialog()
| Method Detail |
|---|
public static AlertDialog createInfo(Command okCommand,
String captionText,
String message)
okCommand - a command to execute after the dialog is dismissed, or nullcaptionText - a String to display in the dialog title, or nullmessage - text a String display in the content area of the dialog, or null
public static AlertDialog createWarning(Command okCommand,
String captionText,
String message)
okCommand - a command to execute if the user presses the OK button, or nullcaptionText - a String to display in the dialog title, or nullmessage - text a String display in the content area of the dialog, or null
public static AlertDialog createError(Command okCommand,
String captionText,
String message)
okCommand - a command to execute after the dialog is dismissed, or nullcaptionText - a String to display in the dialog title, or nullmessage - text a String display in the content area of the dialog, or nullprotected List createControllers()
CPopupPanel
createControllers in class ModalDialognullpublic KeyMap getKeyMap()
public Image getIcon()
public void setIcon(String url)
url - a URL to an image or nullpublic void setIcon(Image icon)
Icon to ensure size information is available when the dialog
layout is calculated.
icon - an image or nullIconpublic String getCaptionText()
public void setCaptionText(String captionText,
boolean asHtml)
captionText - a String or nullasHtml - true to treat captionText as HTML, false to
treat captionText as plain textprotected Widget buildCaption()
nullpublic Widget getMessage()
nullpublic void setMessage(String text)
text - a String, or null
public void setMessage(String text,
boolean asHtml)
text - a String, or nullasHtml - true to treat captionText as HTML, false to
treat captionText as plain textpublic void setMessage(Widget widget)
widget - a Widget, or nullpublic Widget getButton(int index)
index.
index - an integer >= 0
public int getButtonCount()
public void addButton(String text,
char hotKey,
Command command,
int type)
text - the text to display in the buttonhotKey - the keycode of a key which will execute the widget's
associated command when pressedcommand - a command to execute if the button is clicked, or
nulltype - a constant representing special button behavior
public void addButton(Widget widget,
char hotKey,
Command command,
int type)
HasFocus and does not have a tabIndex < 0.
The widget must implement SourcesClickEvents. When a button is
clicked, the dialog will be closed and the specified command will be
executed.
widget - the widget to addhotKey - the keycode of a key which will execute the widget's
associated command when pressedcommand - a command to execute if the button is clicked, or
nulltype - a constant representing special button behavior
ClassCastException - if widget does not implement
HasFocuspublic void removeButton(Widget button)
button - getKeyMap()public void show()
ModalDialog
show in class ModalDialogpublic void show(HasFocus focusOnCloseWidget)
ModalDialog
show in class ModalDialogfocusOnCloseWidget - a widget to focus after this dialog is closed
|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||