Created
January 6, 2011 22:52
-
-
Save gAmUssA/768770 to your computer and use it in GitHub Desktop.
Automation delegate fot extended DataGridItemRenderer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mx.automation.delegates.controls.superGridClasses | |
{ | |
import com.theriabook.controls.superGridClasses.DataGridItemRenderer; | |
import flash.display.DisplayObject; | |
import mx.automation.Automation; | |
import mx.automation.IAutomationObject; | |
import mx.automation.delegates.core.UITextFieldAutomationImpl; | |
import mx.core.mx_internal; | |
use namespace mx_internal; | |
[Mixin] | |
/** | |
* | |
* Defines methods and properties required to perform instrumentation for the | |
* DataGridItemRenderer class. | |
* | |
* @see mx.controls.dataGridClasses.DataGridItemRenderer | |
* | |
* | |
* @langversion 3.0 | |
* @playerversion Flash 9 | |
* @playerversion AIR 1.1 | |
* @productversion Flex 3 | |
*/ | |
public class DataGridItemRendererAutomationImpl extends UITextFieldAutomationImpl | |
{ | |
//include "../../../core/Version.as"; | |
//-------------------------------------------------------------------------- | |
// | |
// Class methods | |
// | |
//-------------------------------------------------------------------------- | |
/** | |
* Registers the delegate class for a component class with automation manager. | |
* | |
* @param root The SystemManger of the application. | |
* | |
* @langversion 3.0 | |
* @playerversion Flash 9 | |
* @playerversion AIR 1.1 | |
* @productversion Flex 3 | |
*/ | |
public static function init(root:DisplayObject):void | |
{ | |
trace("-1"); | |
Automation.registerDelegateClass(com.theriabook.controls.superGridClasses.DataGridItemRenderer, | |
DataGridItemRendererAutomationImpl); | |
trace("0"); | |
} | |
//-------------------------------------------------------------------------- | |
// | |
// Constructor | |
// | |
//-------------------------------------------------------------------------- | |
/** | |
* Constructor. | |
* @param obj DataGridItem object to be automated. | |
* | |
* @langversion 3.0 | |
* @playerversion Flash 9 | |
* @playerversion AIR 1.1 | |
* @productversion Flex 3 | |
*/ | |
public function DataGridItemRendererAutomationImpl(obj:DataGridItemRenderer) | |
{ | |
super(obj); | |
item = obj; | |
} | |
/** | |
* @private | |
*/ | |
protected function get itemRenderer():DataGridItemRenderer | |
{ | |
return uiTextField as DataGridItemRenderer; | |
} | |
private var item:com.theriabook.controls.superGridClasses.DataGridItemRenderer; | |
override public function getAutomationChildAt(index:int):IAutomationObject | |
{ | |
trace ("1"); | |
return item as IAutomationObject; | |
} | |
override public function getAutomationChildren():Array | |
{ | |
trace ("2"); | |
return [item]; | |
} | |
override public function get numAutomationChildren():int | |
{ | |
return 1; | |
} | |
override public function get automationValue():Array | |
{ | |
return [item.data.toString()]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment