goog.ui.Dialog.ButtonSet
Classgoog.ui.Dialog.ButtonSet
> goog.structs.Map
goog.ui.Dialog.ButtonSet(opt_domHelper)
A button set defines the behaviour of a set of buttons that the dialog can show. Uses the {@link goog.structs.Map} interface.
opt_domHelper
{goog.dom.DomHelper
=}
.CONTINUE_SAVE_CANCEL
[deprecated]Deprecated. Use goog.ui.Dialog.ButtonSet#createContinueSaveCancel.
goog.ui.Dialog.ButtonSet.DefaultButtons
EnumThe standard buttons (keys associated with captions). … more
.OK
[deprecated]Deprecated. Use goog.ui.Dialog.ButtonSet#createOk.
.OK_CANCEL
[deprecated]Deprecated. Use goog.ui.Dialog.ButtonSet#createOkCancel.
.YES_NO
[deprecated]Deprecated. Use goog.ui.Dialog.ButtonSet#createYesNo.
.YES_NO_CANCEL
[deprecated]Deprecated. Use goog.ui.Dialog.ButtonSet#createYesNoCancel.
.__iterator__(opt_keys)
Inherited from goog.structs.Map
.
Returns an iterator that iterates over the values or the keys in the map. This throws an exception if the map was mutated since the iterator was created.
opt_keys
{boolean
=}
goog.iter.Iterator
}
.addAll(map)
Inherited from goog.structs.Map
.
Adds multiple key-value pairs from another goog.structs.Map or Object.
map
{Object
}
.addButton(button, opt_isDefault, opt_isCancel)
Adds a button (an object with a key and caption) to this button set. Buttons will be displayed in the order they are added.
button
{!{key
: string
, caption
: string
}}
opt_isDefault
{boolean
=}
opt_isCancel
{boolean
=}
goog.ui.Dialog.ButtonSet
}
.attachToElement(el)
Attaches the button set to an element, rendering it inside.
el
{Element
}
.clear()
Inherited from goog.structs.Map
.
Removes all key-value pairs from the map.
.clone()
Inherited from goog.structs.Map
.
Clones a map and returns a new map.
goog.structs.Map
}
.containsKey(key)
Inherited from goog.structs.Map
.
Whether the map contains the given key.
key
{*}
boolean
}
.containsValue(val)
Inherited from goog.structs.Map
.
Whether the map contains the given value. This is O(n).
val
{*}
boolean
}
.createContinueSaveCancel()
Creates a new ButtonSet with 'Continue', 'Save', and 'Cancel' (default) buttons.
goog.ui.Dialog.ButtonSet
}
.createOk()
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.
goog.ui.Dialog.ButtonSet
}
.createOkCancel()
Creates a new ButtonSet with 'OK' (default) and 'Cancel' buttons.
goog.ui.Dialog.ButtonSet
}
.createYesNo()
Creates a new ButtonSet with 'Yes' (default) and 'No' buttons.
goog.ui.Dialog.ButtonSet
}
.createYesNoCancel()
Creates a new ButtonSet with 'Yes', 'No' (default), and 'Cancel' buttons.
goog.ui.Dialog.ButtonSet
}
.decorate(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.
element
{Element
}
.equals(otherMap, opt_equalityFn)
Inherited from goog.structs.Map
.
Whether this map is equal to the argument map.
otherMap
{goog.structs.Map
}
opt_equalityFn
{function
(?, ?) : boolean
=}
boolean
}
.get(key, opt_val)
Inherited from goog.structs.Map
.
Returns the value for the given key. If the key is not found and the default value is not given this will return {@code undefined}.
key
{*}
opt_val
{*=}
.getAllButtons()
Returns all the HTML Button elements in the button set container.
NodeList
}
.getButton(key)
Returns the HTML Button element.
key
{string
}
Element
}
.getCancel()
Returns the cancel button.
string
}
.getCount()
Inherited from goog.structs.Map
.
number
}
.getDefault()
Returns the default button.
string
}
.getDomHelper()
Returns the dom helper that is being used on this component.
goog.dom.DomHelper
}
.getElement()
Gets the component's element.
Element
}
.getKeyIterator()
Inherited from goog.structs.Map
.
Returns an iterator that iterates over the keys in the map. Removal of keys while iterating might have undesired side effects.
goog.iter.Iterator
}
.getKeys()
Inherited from goog.structs.Map
.
Returns the keys of the map.
Array
.<string
>}
.getValueIterator()
Inherited from goog.structs.Map
.
Returns an iterator that iterates over the values in the map. Removal of keys while iterating might have undesired side effects.
goog.iter.Iterator
}
.getValues()
Inherited from goog.structs.Map
.
Returns the values of the map.
Array
}
.isEmpty()
Inherited from goog.structs.Map
.
boolean
}
.remove(key)
Inherited from goog.structs.Map
.
Removes a key-value pair based on the key. This is O(logN) amortized due to updating the keys array whenever the count becomes half the size of the keys in the keys array.
key
{*}
boolean
}
.render()
Renders the button set inside its container element.
.set(key, caption, opt_isDefault, opt_isCancel)
Adds a button to the button set. Buttons will be displayed in the order they are added.
key
{*}
caption
{*}
opt_isDefault
{boolean
=}
opt_isCancel
{boolean
=}
goog.ui.Dialog.ButtonSet
}
.setAllButtonsEnabled(enabled)
Enables or disables all of the buttons in this set.
enabled
{boolean
}
.setButtonEnabled(key, enabled)
Enables or disables a button in this set by key. If the button is not found, does nothing.
key
{string
}
enabled
{boolean
}
.setCancel(key)
Sets the cancel button.
key
{?string
}
.setDefault(key)
Sets the default button.
key
{?string
}
.toObject()
Inherited from goog.structs.Map
.
Object
}
.transpose()
Inherited from goog.structs.Map
.
Returns a new map in which all the keys and values are interchanged (keys become values and values become keys). If multiple keys map to the same value, the chosen transposed value is implementation-dependent. It acts very similarly to {goog.object.transpose(Object)}.
goog.structs.Map
}