ui.SplitBehavior Extends goog.Disposable
Creates a behavior for combining two controls. The behavior is triggered by a given event type which applies the behavior handler. Can be used to also render or decorate the controls. For a usage example see goog.ui.ColorSplitBehavior

Inheritance

Constructor

goog.ui.SplitBehavior(firstsecondopt_behaviorHandleropt_eventTypeopt_domHelper)

Parameters

first : goog.ui.Control
A ui control.
second : goog.ui.Control
A ui control.
opt_behaviorHandler : function(goog.ui.Control,Event)=
A handler to apply for the behavior.
opt_eventType : string=
The event type triggering the handler.
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 »
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.SplitBehavior.CSS_CLASS :
Css class for elements rendered by this behavior.
Code »
goog.ui.SplitBehavior.superClass_ :
No description.
Code »

Enumerations

goog.ui.SplitBehavior.DefaultHandlers :
An emum of split behavior handlers.
Constants:
CAPTION
No description.
NONE
No description.
VALUE
No description.
Code »

Package ui

Package Reference