goog.ui.Dialog.ButtonSet
Provided By | |
---|---|
Extends |
A button set defines the behaviour of a set of buttons that the dialog can
show. Uses the goog.structs.Map
interface.
new ButtonSet( opt_domHelper )
Parameters |
|
---|
Instance Methods
this.addAll( map ) → void
void
Adds multiple key-value pairs from another goog.ui.Map or Object.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
this.addButton( button, opt_isDefault, opt_isCancel ) → goog.ui.Dialog.ButtonSet
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
| ||||||||||||
See Also |
this.attachToElement( el ) → void
void
Attaches the button set to an element, rendering it inside.
Parameters |
|
---|
this.clear() → void
void
this.clone() → goog.ui.Map
goog.ui.Map
Clones a map and returns a new map.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.containsKey( key ) → boolean
boolean
Whether the map contains the given key.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.containsValue( val ) → boolean
boolean
Whether the map contains the given value. This is O(n).
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.decorate( element ) → void
void
Decorates the given element by adding any 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 goog.ui.Dialog.DefaultButtonKeys.CANCEL
is found, it is assumed to have "Cancel" semantics.
TODO(attila): ButtonSet should be a goog.ui.Component. Really.
Parameters |
|
---|
this.equals( otherMap, equalityFn ) → boolean
boolean
Whether this map is equal to the argument map.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.forEach<T>( callbackFn, thisArg ) → void
void
Calls the given function on each entry in the map.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.get<DEFAULT>( key, defaultValue ) → ?
?
Returns the value for the given key. If the key is not found and the default
value is not given this will return undefined
.
Defined by | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||
Returns |
|
this.getAllButtons() → IArrayLike<Element>
IArrayLike<Element>
Returns all the HTML Button elements in the button set container.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getButton( key ) → (Element|null)
(Element|null)
Returns the HTML Button element.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.getCancel() → (string|null)
(string|null)
this.getCount() → number
number
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getDefault() → (string|null)
(string|null)
this.getDomHelper() → goog.dom.DomHelper
goog.dom.DomHelper
Returns the dom helper that is being used on this component.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getElement() → (Element|null)
(Element|null)
Gets the component's element.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getKeys() → Array<(K|null)>
Array<(K|null)>
Returns the keys of the map.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getValues() → Array<(V|null)>
Array<(V|null)>
Returns the values of the map.
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isEmpty() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.remove( key ) → boolean
boolean
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.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.render() → void
void
Renders the button set inside its container element.
this.set( key, caption, opt_isDefault, opt_isCancel ) → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
Adds a button to the button set. Buttons will be displayed in the order they are added.
Overrides | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
| ||||||||||||||||
Returns |
|
this.setAllButtonsEnabled( enabled ) → void
void
Enables or disables all of the buttons in this set.
Parameters |
|
---|
this.setButtonEnabled( key, enabled ) → void
void
this.setCancel( key ) → void
void
this.setDefault( key ) → void
void
this.toObject() → Object
Object
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
Instance Properties
this.dom_ → goog.dom.DomHelper
goog.dom.DomHelper
No information.
Static Functions
ButtonSet.createContinueSaveCancel() → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
Creates a new ButtonSet with 'Continue', 'Save', and 'Cancel' (default) buttons.
Parameters | None. | ||
---|---|---|---|
Returns |
|
ButtonSet.createOk() → goog.ui.Dialog.ButtonSet
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.
Parameters | None. | ||
---|---|---|---|
Returns |
|
ButtonSet.createOkCancel() → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
Creates a new ButtonSet with 'OK' (default) and 'Cancel' buttons.
Parameters | None. | ||
---|---|---|---|
Returns |
|
ButtonSet.createYesNo() → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
Creates a new ButtonSet with 'Yes' (default) and 'No' buttons.
Parameters | None. | ||
---|---|---|---|
Returns |
|
ButtonSet.createYesNoCancel() → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
Creates a new ButtonSet with 'Yes', 'No' (default), and 'Cancel' buttons.
Parameters | None. | ||
---|---|---|---|
Returns |
|
Static Properties
ButtonSet.CONTINUE_SAVE_CANCEL → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
ButtonSet.OK → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
ButtonSet.OK_CANCEL → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
ButtonSet.YES_NO → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet
ButtonSet.YES_NO_CANCEL → goog.ui.Dialog.ButtonSet
goog.ui.Dialog.ButtonSet