Package | jp.co.fujitsu.reffi.client.flex.controller |
Class | public class EventBinder |
[概 要]
イベント紐付け情報保持クラスです.[詳 細]
具象コントローラ#bind(EventBinder)実装によるコンポーネント、イベントタイプ、アクションクラス の紐付け情報を、bindInfoプロパティに保持します。
bindInfo:Dictionary "component name1" = typeMap:Dictionary "event type name1" = actionInfoList:Array [0] = actionInfo:Dictionary "actionClass" = Class(Action) "useCapture" = false "priority" = 0 "useWeakReference" = false [1] = actionInfo:Dictionary "actionClass" = Class(Action) "useCapture" = false "priority" = 0 "useWeakReference" = false "event type name2" = actionInfoList:Array [0] = actionInfo:Dictionary "actionClass" = Class(Action) "useCapture" = false "priority" = 0 "useWeakReference" = false "component name2" = typeMap:Dictionary "event type name1" = actionInfoList:Array [0] = actionInfo:Dictionary "actionClass" = Class(Action) "useCapture" = false "priority" = 0 "useWeakReference" = false
eventBinder.addEventBinding("menu.openChat", FocusEvent.FOCUS_IN, Class(FocusChatAction));
eventBinder.addEventBinding("menu.openChat", MouseEvent.CLICK, Class(OpenChatAction));
eventBinder.addEventBinding("menu.openWindow", MouseEvent.CLICK, Class(OpenWindowGroupParentAction));
bindInfoの構造は以下のようになります。
bindInfo:Dictionary "menu.openChat" = typeMap:Dictionary FocusEvent.FOCUS_IN = actionInfoList:Array [0] = actionInfo:Dictionary "actionClass" = Class(FocusChatAction) "useCapture" = false "priority" = 0 "useWeakReference" = false MouseEvent.CLICK = actionInfoList:Array [0] = actionInfo:Dictionary "actionClass" = Class(OpenChatAction) "useCapture" = false "priority" = 0 "useWeakReference" = false "menu.openWindow" = typeMap:Dictionary MouseEvent.CLICK = actionInfoList:Array [0] = actionInfo:Dictionary "actionClass" = Class(OpenWindowGroupParentAction) "useCapture" = false "priority" = 0 "useWeakReference" = false
[備 考]
アプリケーション動作中に紐付け情報を動的追加する場合、controller.eventBinder.addEventBindingImmediately("newdisplay.btnRegist", MouseEvent.CLICK, Class(RegistAction));
Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.
Property | Defined by | ||
---|---|---|---|
bindInfo : Dictionary [概 要] イベント定義情報を保持するオブジェクトです. | EventBinder | ||
controller : BaseController
[概 要] このEventBinderを保持しているコントローラオブジェクトです. | EventBinder |
Method | Defined by | ||
---|---|---|---|
EventBinder(controller:BaseController)
[概 要] コンストラクタです. | EventBinder | ||
addEventBinding(componentName:String, type:String, actionClass:Class, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[概 要] イベント紐付け情報追加メソッドです. | EventBinder | ||
addEventBindingImmediately(componentName:String, type:String, action:Class, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[概 要] イベント紐付け情報追加メソッドです. | EventBinder | ||
addEventBindings(componentNames:Array, type:String, actionClass:Class, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[概 要] イベント紐付け情報追加メソッドです. | EventBinder | ||
getActionClasses(componentName:String, eventType:String):Array
[概 要] componentNameをname属性値として持つエレメントの、eventTypeイベント発動時の アクションクラス型配列を取得します. | EventBinder | ||
getEventTypes(componentName:String):Array
[概 要] 引数指定された名前を持つエレメントに登録されているイベントタイプ群を返却します. | EventBinder | ||
hasEventBinding(componentName:String):Boolean
[概 要] 引数componentNameに対するイベント紐付け情報があるかどうか調べます. | EventBinder | ||
removeEventBinding(componentName:String, type:String):void
[概 要] イベント紐付け情報削除メソッドです. | EventBinder |
bindInfo | property |
bindInfo:Dictionary
[read-write]
[概 要]
イベント定義情報を保持するオブジェクトです.[詳 細]
コンポーネントの名前、イベントタイプ、アクションクラスをマッピングします。[備 考]
実装 public function get bindInfo():Dictionary
public function set bindInfo(value:Dictionary):void
controller | property |
controller:BaseController
[read-write]
[概 要]
このEventBinderを保持しているコントローラオブジェクトです.[詳 細]
イベントハンドリングを委譲されたコントローラは、このEventBinder オブジェクトを参照して、イベントを起こしたコンポーネントの名前と イベントタイプを元に、実行するべきアクションクラスを取得します。[備 考]
実装 public function get controller():BaseController
public function set controller(value:BaseController):void
EventBinder | () | constructor |
public function EventBinder(controller:BaseController)
[概 要]
コンストラクタです.[詳 細]
bindInfo領域の生成、引数controllerのプロパティへの設定を行います。[備 考]
パラメータcontroller:BaseController |
addEventBinding | () | method |
public function addEventBinding(componentName:String, type:String, actionClass:Class, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[概 要]
イベント紐付け情報追加メソッドです.[詳 細]
引数componentNameが既に登録されている場合、componentName用のMapを取り出し、 イベントタイプをキーにしてアクションを登録します。[備 考]
パラメータcomponentName:String — コンポーネント(エレメント)のname属性値
|
|
type:String — イベントタイプ
|
|
actionClass:Class — 起動するアクションのクラス型
|
|
useCapture:Boolean (default = false )
|
|
priority:int (default = 0 )
|
|
useWeakReference:Boolean (default = false )
|
addEventBindingImmediately | () | method |
public function addEventBindingImmediately(componentName:String, type:String, action:Class, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[概 要]
イベント紐付け情報追加メソッドです.[詳 細]
addEventBinding(String, String, Class)メソッドを 呼び出して、イベント紐付け情報保持オブジェクト(bindInfo)に追加します。[備 考]
addEventBindingと違い、登録された情報が画面オブジェクトに 反映されるのはこのメソッド呼び出し直後です。 パラメータcomponentName:String — コンポーネント(エレメント)のname属性値
|
|
type:String — イベントタイプ
|
|
action:Class — 起動するアクションのクラス型
|
|
useCapture:Boolean (default = false )
|
|
priority:int (default = 0 )
|
|
useWeakReference:Boolean (default = false )
|
関連項目
addEventBindings | () | method |
public function addEventBindings(componentNames:Array, type:String, actionClass:Class, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[概 要]
イベント紐付け情報追加メソッドです.[詳 細]
componentNames配列内のコンポーネント名全てに引数typeイベントタイプで 引数actionClassを紐付けます。[備 考]
パラメータcomponentNames:Array — コンポーネント(エレメント)のname属性値配列
|
|
type:String — イベントタイプ
|
|
actionClass:Class — 起動するアクションのクラス型
|
|
useCapture:Boolean (default = false )
|
|
priority:int (default = 0 )
|
|
useWeakReference:Boolean (default = false )
|
getActionClasses | () | method |
public function getActionClasses(componentName:String, eventType:String):Array
[概 要]
componentNameをname属性値として持つエレメントの、eventTypeイベント発動時の アクションクラス型配列を取得します.[詳 細]
bindInfoフィールドから、引数componentNameで紐付け情報を取り出し、 取り出した[イベントタイプ = アクションクラス]のマップから、eventTypeイベント のアクションクラス群を取得、返却します。[備 考]
パラメータcomponentName:String — コンポーネントのname属性値
|
|
eventType:String — イベントタイプ
|
Array — componentName、eventTypeに対応するアクションクラス型
|
getEventTypes | () | method |
public function getEventTypes(componentName:String):Array
[概 要]
引数指定された名前を持つエレメントに登録されているイベントタイプ群を返却します.[詳 細]
bindInfoフィールドから、引数componentNameで紐付け情報を取り出し、 登録されている全イベントタイプをString配列に変換して返却します。[備 考]
パラメータcomponentName:String — コンポーネントのname属性値
|
Array — componentNameに登録されている全イベントタイプが入った配列
|
hasEventBinding | () | method |
public function hasEventBinding(componentName:String):Boolean
[概 要]
引数componentNameに対するイベント紐付け情報があるかどうか調べます.[詳 細]
binInfoプロパティにcomponentNameプロパティが存在するか調べて返却します。[備 考]
パラメータcomponentName:String — イベント紐付け情報が登録されているか調べるコンポーネント名
|
Boolean |
removeEventBinding | () | method |
public function removeEventBinding(componentName:String, type:String):void
[概 要]
イベント紐付け情報削除メソッドです.[詳 細]
保持されているコンポーネン紐付け情報から、引数componentNameの 引数typeイベントに対する紐付けを削除します。[備 考]
パラメータcomponentName:String — コンポーネントのname属性値
|
|
type:String — アクション紐付け情報を削除するイベントタイプ
|