ui.ColorSplitBehavior Extends goog.ui.SplitBehavior
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.

Inheritance

Constructor

goog.ui.ColorSplitBehavior(colorButtonopt_domHelper)

Parameters

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.

Instance Methods

Public Protected Private
behaviorHandler_()
Handler for this behavior.
code »
collapseSides_(firstsecond)
Collapse the the controls together.
Arguments:
first : goog.ui.Control
The first element.
second : goog.ui.Control
The second element.
code »
decorate(elementopt_activate) !goog.ui.SplitBehavior
Decorates an element and returns the behavior.
Arguments:
element : Element
An element to decorate.
opt_activate : boolean=
Whether to activate the behavior (default=true).
Returns: !goog.ui.SplitBehavior  A split behavior.
code »
decorateChildren_(element)
Decorates two child nodes of the given element.
Arguments:
element : Element
An element to render two of it's child nodes.
code »
disposeInternal()
No description.
code »
getBehaviorHandler() function(goog.ui.Control,Event)
No description.
Returns: function(goog.ui.Control,Event)  The behavior handler.
code »
getElement() Element
No description.
Returns: Element  The element containing the controls.
code »
getEventType() string
No description.
Returns: string  The behavior event type.
code »
render(elementopt_activate) !goog.ui.SplitBehavior
Renders an element and returns the behavior.
Arguments:
element : Element
An element to decorate.
opt_activate : boolean=
Whether to activate the behavior (default=true).
Returns: !goog.ui.SplitBehavior  A split behavior.
code »
setActive(activate)
Activate or deactivate the behavior.
Arguments:
activate : boolean
Whether to activate or deactivate the behavior.
code »
setDisposeControls(disposeFirstdisposeSecond)
Sets the disposeControls flags.
Arguments:
disposeFirst : boolean
Whether to dispose the first control when dispose is called.
disposeSecond : boolean
Whether to dispose the second control when dispose is called.
code »
setEventType(eventType)
Sets the behavior event type.
Arguments:
eventType : string
The behavior event type.
code »
setHandler(behaviorHandler)
Sets the behavior handler.
Arguments:
behaviorHandler : function(goog.ui.Control,Event)
The behavior handler.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
  mypackage.MyClass = function() {
    mypackage.MyClass.base(this, 'constructor');
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    mypackage.MyClass.base(this, 'disposeInternal');
  };
code »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

constructor :
No description.
Code »
constructor :
No description.
Code »
disposeFirst_ :
Whether to dispose the first control when dispose is called.
Code »
disposeSecond_ :
Whether to dispose the second control when dispose is called.
Code »
No description.
Code »
element_ :
The element containing the controls.
Code »
eventHandler_ : goog.events.EventHandler
Event handler.
Code »
eventType_ :
Event type triggering the behavior.
Code »
first_ : goog.ui.Control
No description.
Code »
isActive_ :
True iff the behavior is active.
Code »
second_ : goog.ui.Control
No description.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Properties

goog.ui.ColorSplitBehavior.ZERO_WIDTH_SPACE_ :
A zero width space character.
Code »
goog.ui.ColorSplitBehavior.superClass_ :
No description.
Code »

Package ui

Package Reference