public class Dialog extends Window
Window with specialized support for buttons. Defaults to a
dialog with an 'ok' button.
Code snippet:
Dialog d = new Dialog();
d.setHeadingText("Exit Warning!");
d.add(new HTML("Do you wish to save before exiting?"));
d.setBodyStyle("fontWeight:bold;padding:13px;");
d.setPixelSize(300, 100);
d.setHideOnButtonClick(true);
d.setPredefinedButtons(PredefinedButton.YES, PredefinedButton.NO, PredefinedButton.CANCEL);
d.show();
The predefined buttons can be retrieved from the button bar using their
respective ids (see Enum.name() and
getButtonById(String)) or by index (see ContentPanel.getButtonBar() and
Container.getWidget(int))..| Modifier and Type | Class and Description |
|---|---|
static interface |
Dialog.DialogMessages
The translatable strings (e.g.
|
static class |
Dialog.PredefinedButton
The predefined buttons supported by this dialog window.
|
Window.WindowAppearance, Window.WindowMessagesContentPanel.ContentPanelAppearance, ContentPanel.ContentPanelMessages, ContentPanel.PanelHeaderAppearanceUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledHasWidgets.ForIsWidgetIndexedPanel.ForIsWidgetDEBUG_ID_PREFIX| Constructor and Description |
|---|
Dialog()
Creates a dialog window with default appearance.
|
Dialog(Window.WindowAppearance appearance)
Creates a dialog window with the specified appearance.
|
| Modifier and Type | Method and Description |
|---|---|
TextButton |
getButtonById(String string)
Returns the text button associated with the specified predefined button
name (e.g.
|
Dialog.DialogMessages |
getDialogMessages()
Returns the translatable strings (e.g.
|
List<Dialog.PredefinedButton> |
getPredefinedButtons()
Returns the buttons that are currently configured for this dialog window.
|
boolean |
isHideOnButtonClick()
Returns true if the dialog will be hidden on any button click.
|
void |
setDialogMessages(Dialog.DialogMessages dialogMessages)
Sets the translatable strings (e.g.
|
void |
setHideOnButtonClick(boolean hideOnButtonClick)
True to hide the dialog on any button click.
|
void |
setPredefinedButtons(Dialog.PredefinedButton... buttons)
Sets the predefined buttons to display (defaults to OK).
|
addActivateHandler, addDeactivateHandler, addMaximizeHandler, addMinimizeHandler, addRestoreHandler, alignTo, center, focus, getConstrain, getContainer, getDraggable, getFocusWidget, getHideButton, getMinHeight, getMinWidth, getResizable, getWindowMessages, hide, hide, isAutoHide, isBlinkModal, isClosable, isDraggable, isMaximizable, isMaximized, isMinimizable, isModal, isOnEsc, isPlain, isResizable, maximize, minimize, onBrowserEvent, restore, setActive, setAutoHide, setBlinkModal, setClosable, setConstrain, setContainer, setDraggable, setFocusWidget, setMaximizable, setMinHeight, setMinimizable, setMinWidth, setModal, setOnEsc, setPagePosition, setPlain, setPosition, setResizable, setWindowMessages, setZIndex, show, toBack, toFrontaddBeforeCollapseHandler, addBeforeExpandHandler, addButton, addCollapseHandler, addExpandHandler, addTool, collapse, expand, getBody, getButtonAlign, getButtonBar, getHeader, getHTML, getMessages, getMinButtonWidth, getText, isAnimCollapse, isCollapsed, isCollapsible, isExpanded, isHideCollapseTool, isTitleCollapse, setAnimCollapse, setBodyBorder, setBodyStyle, setBodyStyleName, setButtonAlign, setCollapsible, setExpanded, setHeaderVisible, setHeadingHtml, setHeadingHtml, setHeadingText, setHideCollapseTool, setMessages, setMinButtonWidth, setTitleCollapseadd, add, getWidget, isResize, setResize, setWidget, setWidgetforceLayout, isLayoutRunning, isOrWasLayoutRunning, onResizeadd, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, removeaddBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeHandler, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPixelSize, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, sync, syncSize, unmaskaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEventspublic Dialog()
public Dialog(Window.WindowAppearance appearance)
appearance - the dialog window appearancepublic TextButton getButtonById(String string)
string - the predefined button namepublic Dialog.DialogMessages getDialogMessages()
public List<Dialog.PredefinedButton> getPredefinedButtons()
public boolean isHideOnButtonClick()
public void setDialogMessages(Dialog.DialogMessages dialogMessages)
dialogMessages - the translatable stringspublic void setHideOnButtonClick(boolean hideOnButtonClick)
hideOnButtonClick - true to hidepublic void setPredefinedButtons(Dialog.PredefinedButton... buttons)
Dialog.PredefinedButton.OKDialog.PredefinedButton.CANCELDialog.PredefinedButton.CLOSEDialog.PredefinedButton.YESDialog.PredefinedButton.NO
buttons - the buttons to displayCopyright © 2012. All Rights Reserved.