com.sencha.gxt.widget.core.client
Class Dialog

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.container.Container
                  extended by com.sencha.gxt.widget.core.client.container.ResizeContainer
                      extended by com.sencha.gxt.widget.core.client.container.SimpleContainer
                          extended by com.sencha.gxt.widget.core.client.ContentPanel
                              extended by com.sencha.gxt.widget.core.client.Window
                                  extended by com.sencha.gxt.widget.core.client.Dialog
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, AcceptsOneWidget, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, Collapsible, HasLayout, ActivateEvent.HasActivateHandlers<Window>, AddEvent.HasAddHandlers, BeforeAddEvent.HasBeforeAddHandlers, BeforeCollapseEvent.HasBeforeCollapseHandlers, BeforeExpandEvent.HasBeforeExpandHandlers, BeforeHideEvent.HasBeforeHideHandlers, BeforeRemoveEvent.HasBeforeRemoveHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, CollapseEvent.HasCollapseHandlers, ContainerHandler.HasContainerHandlers, DeactivateEvent.HasDeactivateHandlers<Window>, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, ExpandEvent.HasExpandHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MaximizeEvent.HasMaximizeHandlers, MinimizeEvent.HasMinimizeHandlers, MoveEvent.HasMoveHandlers, RemoveEvent.HasRemoveHandlers, RestoreEvent.HasRestoreHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId, Iterable<Widget>
Direct Known Subclasses:
MessageBox

public class Dialog
extends Window

A 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.setWidget(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))..


Nested Class Summary
static interface Dialog.DialogMessages
          The translatable strings (e.g.
static class Dialog.PredefinedButton
          The predefined buttons supported by this dialog window.
 
Nested classes/interfaces inherited from class com.sencha.gxt.widget.core.client.Window
Window.WindowAppearance, Window.WindowMessages
 
Nested classes/interfaces inherited from class com.sencha.gxt.widget.core.client.ContentPanel
ContentPanel.ContentPanelAppearance, ContentPanel.ContentPanelMessages, ContentPanel.PanelHeaderAppearance
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Dialog()
          Creates a dialog window with default appearance.
Dialog(Window.WindowAppearance appearance)
          Creates a dialog window with the specified appearance.
 
Method Summary
 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).
 
Methods inherited from class com.sencha.gxt.widget.core.client.Window
addActivateHandler, addDeactivateHandler, addMaximizeHandler, addMinimizeHandler, addRestoreHandler, alignTo, center, focus, getConstrain, getContainer, getDraggable, getFocusWidget, getHideButton, getMinHeight, getMinWidth, getResizable, hide, hide, isAutoHide, isBlinkModal, isClosable, isDraggable, isMaximizable, isMaximized, isMinimizable, isModal, isOnEsc, isResizable, maximize, minimize, onBrowserEvent, restore, setActive, setAutoHide, setBlinkModal, setClosable, setConstrain, setContainer, setDraggable, setFocusWidget, setMaximizable, setMinHeight, setMinimizable, setMinWidth, setModal, setOnEsc, setPagePosition, setPosition, setResizable, setWindowMessages, setZIndex, show, toBack, toFront
 
Methods inherited from class com.sencha.gxt.widget.core.client.ContentPanel
addBeforeCollapseHandler, addBeforeExpandHandler, addButton, addCollapseHandler, addExpandHandler, addTool, collapse, expand, getAnimationDuration, getBody, getButtonAlign, getButtonBar, getHeader, getHTML, getMessages, getMinButtonWidth, getText, isAnimCollapse, isCollapsed, isCollapsible, isExpanded, isHideCollapseTool, isTitleCollapse, setAnimationDuration, setAnimCollapse, setBodyBorder, setBodyStyle, setBodyStyleName, setButtonAlign, setCollapsible, setExpanded, setHeaderVisible, setHeadingHtml, setHeadingHtml, setHeadingText, setHideCollapseTool, setMessages, setMinButtonWidth, setTitleCollapse
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.SimpleContainer
add, add, getWidget, isResize, setResize, setWidget, setWidget
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.Container
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, 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, 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, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dialog

public Dialog()
Creates a dialog window with default appearance.


Dialog

public Dialog(Window.WindowAppearance appearance)
Creates a dialog window with the specified appearance.

Parameters:
appearance - the dialog window appearance
Method Detail

getButtonById

public TextButton getButtonById(String string)
Returns the text button associated with the specified predefined button name (e.g. getButtonById(PredefinedButton.OK.name()).

Parameters:
string - the predefined button name
Returns:
the text button associated with the button name, or null if there is no button with the specified name

getDialogMessages

public Dialog.DialogMessages getDialogMessages()
Returns the translatable strings (e.g. button text and ToolTips) for the dialog window.

Returns:
the translatable strings for the dialog window

getPredefinedButtons

public List<Dialog.PredefinedButton> getPredefinedButtons()
Returns the buttons that are currently configured for this dialog window.

Returns:
the buttons the buttons

isHideOnButtonClick

public boolean isHideOnButtonClick()
Returns true if the dialog will be hidden on any button click.

Returns:
the hide on button click state

setDialogMessages

public void setDialogMessages(Dialog.DialogMessages dialogMessages)
Sets the translatable strings (e.g. button text and ToolTips) for the dialog window.

Parameters:
dialogMessages - the translatable strings

setHideOnButtonClick

public void setHideOnButtonClick(boolean hideOnButtonClick)
True to hide the dialog on any button click.

Parameters:
hideOnButtonClick - true to hide

setPredefinedButtons

public void setPredefinedButtons(Dialog.PredefinedButton... buttons)
Sets the predefined buttons to display (defaults to OK). Can be any combination of:
 Dialog.PredefinedButton.OK
 Dialog.PredefinedButton.CANCEL
 Dialog.PredefinedButton.CLOSE
 Dialog.PredefinedButton.YES
 Dialog.PredefinedButton.NO
 

Parameters:
buttons - the buttons to display


Copyright © 2012. All Rights Reserved.