Yahoo! UI Library

gallery-undo  1.01

Yahoo! UI Library > gallery-undo > UndoableAction
Search:
 
Filters

Class UndoableAction - extends Base

Create a UndoableAction

Constructor

UndoableAction ( config )
Parameters:
config <Object> Configuration object

Properties

_childActions - protected Array

Container for child actions of this action

UndoableAction.ATTRS - protected static Object

Static property used to define the default attribute configuration of UndoableAction.

UndoableAction.NAME - static String

The identity of UndoableAction.

Methods

_initEvents

protected void _initEvents ( )
Publishes UndoableAction's events

cancel

void cancel ( )
UndoManager invokes cancel method of action before removing it from the list.
The default implemetation does nothing.

destructor

protected void destructor ( )
Destructor lifecycle implementation for UndoableAction class.

initializer

protected void initializer ( )
Publishes events

merge

Boolean merge ( newAction )
Depending on the application, an UndoableAction may merge with another action. If merge was successfull, merge must return true; otherwise returns false. The default implemetation returns false.
Parameters:
newAction <Y.UndoableAction> The action to merge with
Returns: Boolean
false

redo

void redo ( )
The default implemetation redoes all child actions.

toString

void toString ( )
Overrides toString() method.
The default implementation returns the value of label property.

undo

void undo ( )
The default implemetation undoes all child actions in reverse order.

Events

asyncProcessingChange

asyncProcessingChange ( event )
Fires when the value for the configuration attribute 'asyncProcessing' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

beforeRedo

beforeRedo ( event )
Signals the beginning of action redo.
Parameters:
event <Event.Facade> An Event Facade object

beforeUndo

beforeUndo ( event )
Signals the beginning of action undo.
Parameters:
event <Event.Facade> An Event Facade object

labelChange

labelChange ( event )
Fires when the value for the configuration attribute 'label' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

redoFinished

redoFinished ( event )
Signals the end of action redo.
Parameters:
event <Event.Facade> An Event Facade object

undoFinished

undoFinished ( event )
Signals the end of action undo.
Parameters:
event <Event.Facade> An Event Facade object

Configuration Attributes

asyncProcessing - Boolean

Boolean, indicates if action must be processed asynchronously. If true, undo method must fire undoFinished event. Respectively, redo method must fire redoFinished event
Default Value: false

label - String

The label of action
Default Value: ""


Copyright © 2010 Yahoo! Inc. All rights reserved.