Home

# Class goog.ui.Dialog.ButtonSet

A button set defines the behaviour of a set of buttons that the dialog can show. Uses the {@link goog.structs.Map} interface.

extends goog.structs.Map

Instance Method Summary
| `addButton({caption: string, key: string} button, boolean= opt_isDefault, boolean= opt_isCancel) ⇒ !goog.ui.Dialog.ButtonSet` Adds a button (an object with a key and caption) to this button set. Buttons will be displayed in the order they are added.
| `attachToElement(?Element el)` Attaches the button set to an element, rendering it inside.

`decorate(?Element element)`

Decorates the given element by adding any {@code button} elements found among its descendants to the button set. The first button found is assumed to be the default and will receive focus when the button set is rendered. If a button with a name of {@link goog.ui.Dialog.DefaultButtonKeys.CANCEL} is found, it is assumed to have "Cancel" semantics. TODO(attila): ButtonSet should be a goog.ui.Component. Really.

| `getAllButtons() ⇒ ?NodeList` Returns all the HTML Button elements in the button set container.
| `getButton(string key) ⇒ ?Element` Returns the HTML Button element.
| `getCancel() ⇒ ?string` Returns the cancel button.
| `getDefault() ⇒ ?string` Returns the default button.
| `getDomHelper() ⇒ !goog.dom.DomHelper` Returns the dom helper that is being used on this component.
| `getElement() ⇒ ?Element` Gets the component's element.
| `render()` Renders the button set inside its container element.
| `set(string key, (Element|null|string) caption, boolean= opt_isDefault, boolean= opt_isCancel) ⇒ !goog.ui.Dialog.ButtonSet` Adds a button to the button set. Buttons will be displayed in the order they are added.
| `setAllButtonsEnabled(boolean enabled)` Enables or disables all of the buttons in this set.
| `setButtonEnabled(string key, boolean enabled)` Enables or disables a button in this set by key. If the button is not found, does nothing.
| `setCancel(?string key)` Sets the cancel button.
| `setDefault(?string key)` Sets the default button.

Static Method Summary
| `createContinueSaveCancel() ⇒ !goog.ui.Dialog.ButtonSet` Creates a new ButtonSet with 'Continue', 'Save', and 'Cancel' (default) buttons.
| `createOk() ⇒ !goog.ui.Dialog.ButtonSet` Creates a new ButtonSet with a single 'OK' button, which is also set with cancel button semantics so that pressing escape will close the dialog.
| `createOkCancel() ⇒ !goog.ui.Dialog.ButtonSet` Creates a new ButtonSet with 'OK' (default) and 'Cancel' buttons.
| `createYesNo() ⇒ !goog.ui.Dialog.ButtonSet` Creates a new ButtonSet with 'Yes' (default) and 'No' buttons.
| `createYesNoCancel() ⇒ !goog.ui.Dialog.ButtonSet` Creates a new ButtonSet with 'Yes', 'No' (default), and 'Cancel' buttons.