Home

# Class goog.ui.Dialog

Class for showing simple dialog boxes. The Html structure of the dialog box is:

    Element         Function                Class-name, modal-dialog = default
    ----------------------------------------------------------------------------
    - iframe         Iframe mask              modal-dialog-bg
    - div            Background mask          modal-dialog-bg
    - div            Dialog area              modal-dialog
    - div        Title bar                modal-dialog-title
    - span                             modal-dialog-title-text
    - text  Title text               N/A
    - span                             modal-dialog-title-close
    - ??    Close box                N/A
    - div        Content area             modal-dialog-content
    - ??      User specified content   N/A
    - div        Button area              modal-dialog-buttons
    - button                           N/A
    - button
    - ...

extends goog.ui.ModalPopup

Instance Method Summary
| `createDom()` Creates the initial DOM representation for the modal popup. Overrides {@link goog.ui.Component#createDom}.
| `createDragger() ⇒ !goog.fx.Dragger` Returns a dragger for moving the dialog and adds a class for the move cursor. Defaults to allow dragging of the title only, but can be overridden if different drag targets or dragging behavior is desired.
| `decorateInternal(?Element element)` Actually decorates the element. Should be overridden by inheriting objects. This method can assume there are checks to ensure the component has not already been rendered have occurred and that enter document will be called afterwards. This method is considered protected.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `enterDocument()` Called when the component's element is known to be in the document. Anything using document.getElementById etc. should be done at this stage. If the component contains child components, this call is propagated to its children.
| `exitDocument()` Called by dispose to clean up the elements and listeners created by a component, or by a parent component/application who has removed the component from the document but wants to reuse it later. If the component contains child components, this call is propagated to its children. It should be possible for the component to be rendered again once this method has been called.
| `findParentButton_(?Element element) ⇒ ?Element` Finds the parent button of an element (or null if there was no button parent).
| `focus()` Focuses the dialog contents and the default dialog button if there is one.
| `getBackgroundElement() ⇒ ?Element` Returns the background mask element so that more complicated things can be done with the background region. Renders if the DOM is not yet created.
| `getBackgroundElementOpacity() ⇒ number` Gets the opacity of the background mask.
| `getButtonElement() ⇒ ?Element` Returns the button element so that more complicated things can be done with the button area. Renders if the DOM is not yet created.
| `getButtonSet() ⇒ ?goog.ui.Dialog.ButtonSet` Returns the button set being used.
| `getClass() ⇒ string`
| `getContent() ⇒ string` Gets the content HTML of the content element.
| `getContentElement() ⇒ ?Element` Returns the content element so that more complicated things can be done with the content area. Renders if the DOM is not yet created. Overrides {@link goog.ui.Component#getContentElement}.
| `getCssClass() ⇒ string`
| `getDialogElement() ⇒ ?Element` Returns the dialog element so that more complicated things can be done with the dialog box. Renders if the DOM is not yet created.
| `getDisposeOnHide() ⇒ boolean`
| `getDraggable() ⇒ boolean`
| `getHasTitleCloseButton() ⇒ boolean`
| `getModal() ⇒ boolean`
| `getTitle() ⇒ string` Gets the title.
| `getTitleCloseElement() ⇒ ?Element` Returns the title close element so that more complicated things can be done with the close area of the title. Renders if the DOM is not yet created.
| `getTitleElement() ⇒ ?Element` Returns the title element so that more complicated things can be done with the title. Renders if the DOM is not yet created.
| `getTitleTextElement() ⇒ ?Element` Returns the title text element so that more complicated things can be done with the text of the title. Renders if the DOM is not yet created.
| `isEscapeToCancel() ⇒ boolean`
| `onButtonClick_(?goog.events.BrowserEvent e)` Handles a click on the button container.
| `onKey_(?goog.events.BrowserEvent e)` Handles keydown and keypress events, and dismisses the popup if cancel is pressed. If there is a cancel action in the ButtonSet, than that will be fired. Also prevents tabbing out of the dialog.
| `onTitleCloseClick_(?goog.events.BrowserEvent e)` Handles a click on the title close area.
| `renderIfNoDom_()` Renders if the DOM is not created.
| `setBackgroundElementOpacity(number opacity)` Sets the opacity of the background mask.
| `setButtonSet(?goog.ui.Dialog.ButtonSet buttons)` Sets the button set to use. Note: Passing in null will cause no button set to be rendered.
| `setContent(string html)` Allows arbitrary HTML to be set in the content element.
| `setDisposeOnHide(boolean b)` Sets whether the dialog should be disposed when it is hidden. By default dialogs are not disposed when they are hidden.
| `setDraggable(boolean draggable)` Sets whether the dialog can be dragged.
| `setDraggerLimits_(!goog.events.Event e)` Sets dragger limits when dragging is started.
| `setDraggingEnabled_(boolean enabled)` Enables or disables dragging.
| `setEscapeToCancel(boolean b)`
| `setHasTitleCloseButton(boolean b)` Sets whether the dialog should have a close button in the title bar. There will always be an element for the title close button, but setting this parameter to false will cause it to be hidden and have no active listener.
| `setModal(boolean modal)` Sets the modal property of the dialog. In case the dialog is already inDocument, renders the modal background elements according to the specified modal parameter. Note that non-modal dialogs cannot use an iframe mask.
| `setModalInternal_(boolean modal)` Sets the modal property of the dialog.
| `setTitle(string title)` Sets the title.
| `setVisible(boolean visible)` Sets the visibility of the dialog box and moves focus to the default button. Lazily renders the component if needed.
| `setVisibleInternal_(?goog.events.Event e)` Sets visibility after super class setVisible is completed.