The goog.ui.ColorSplitBehavior Class

goog.ui.ColorSplitBehavior
> goog.ui.SplitBehavior
> goog.Disposable

goog.ui.ColorSplitBehavior(colorButton, opt_domHelper)

Constructs a ColorSplitBehavior for combining a color button and a menu. To use this, provide a goog.ui.ColorButton which will be attached with a goog.ui.ColorMenuButton (with no caption). Whenever a color is selected from the ColorMenuButton, it will be placed in the ColorButton and the user can apply it over and over (by clicking the ColorButton). Primary use case - setting the color of text/background in a text editor.

colorButton {!goog.ui.Button}
A button to interact with a color menu button (preferably a goog.ui.ColorButton).
opt_domHelper {goog.dom.DomHelper=}
Optional DOM helper, used for document interaction.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.decorate(element, opt_activate)

Inherited from goog.ui.SplitBehavior .

Decorates an element and returns the behavior.

element {Element}
An element to decorate.
opt_activate {boolean=}
Whether to activate the behavior (default=true).
returns {goog.ui.SplitBehavior}
A split behavior.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.getBehaviorHandler()

Inherited from goog.ui.SplitBehavior .

returns {function(goog.ui.Control,Event)}
The behavior handler.

.getElement()

Inherited from goog.ui.SplitBehavior .

returns {Element}
The element containing the controls.

.getEventType()

Inherited from goog.ui.SplitBehavior .

returns {string}
The behavior event type.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.render(element, opt_activate)

Inherited from goog.ui.SplitBehavior .

Renders an element and returns the behavior.

element {Element}
An element to decorate.
opt_activate {boolean=}
Whether to activate the behavior (default=true).
returns {goog.ui.SplitBehavior}
A split behavior.

.setActive(activate)

Inherited from goog.ui.SplitBehavior .

Activate or deactivate the behavior.

activate {boolean}
Whether to activate or deactivate the behavior.

.setDisposeControls(disposeFirst, disposeSecond)

Inherited from goog.ui.SplitBehavior .

Sets the disposeControls flags.

disposeFirst {boolean}
Whether to dispose the first control when dispose is called.
disposeSecond {boolean}
Whether to dispose the second control when dispose is called.

.setEventType(eventType)

Inherited from goog.ui.SplitBehavior .

Sets the behavior event type.

eventType {string}
The behavior event type.

.setHandler(behaviorHandler)

Inherited from goog.ui.SplitBehavior .

Sets the behavior handler.

behaviorHandler {function(goog.ui.Control,Event)}
The behavior handler.