|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.co.fujitsu.reffi.client.nexaweb.controller.EventBinder
public class EventBinder
[概 要]
イベント紐付け情報保持クラスです。[詳 細]
BaseController.bind(EventBinder)
によるコンポーネント、イベントタイプ、アクションクラス
の紐付け情報を、bindInfoフィールドMapに保持します。[ コンポーネント名1 = [イベントタイプ1 = アクションクラス, イベントタイプ2 = アクションクラス], コンポーネント名2 = [イベントタイプ1 = アクションクラス] ]
eventBinder.addEventBinding("menu.openChat", "onActiveGained", FocusChatAction.class); eventBinder.addEventBinding("menu.openChat", "onCommand", OpenChatAction.class); eventBinder.addEventBinding("menu.openWindowGroupParent", "onCommand", OpenWindowGroupParentAction.class);上記の場合、以下のようになります。
[ "menu.openChat" = ["onActiveGained" = FocusChatAction.class, "onCommand" = OpenChatAction.class] "menu.openWindowGroupParent" = ["onCommand" = OpenWindowGroupParentAction.class] ]
[備 考]
アプリケーション動作中に紐付け情報を追加する場合、以下のようにEventBinderオブジェクト を取得してaddEventBinding、又はaddEventBindingImmediatelyをコールします。getController().getEventBinder().addEventBinding("newdisplay.btnRegist", "onCommand", RegistAction.class);
[環 境] JDK 6.0 Update 11
Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.
コンストラクタの概要 | |
---|---|
EventBinder(BaseController controller)
[概 要] デフォルトコンストラクタです。 |
メソッドの概要 | |
---|---|
void |
addEventBinding(String componentName,
String eventType,
Class<? extends Action> actionClass)
[概 要] イベント紐付け情報追加メソッドです。 |
void |
addEventBindingImmediately(String componentName,
String eventType,
Class<? extends Action> actionClass)
[概 要] イベント紐付け情報追加メソッドです。 |
Class<? extends Action> |
getActionClass(String componentName,
String eventType)
[概 要] componentNameをname属性値として持つエレメントの、eventTypeイベント発動時の アクションクラス型を取得します。 |
Map<String,Map<String,Class<? extends Action>>> |
getBindInfo()
[概 要] イベント紐付け情報保持オブジェクトを取得します。 |
BaseController |
getController()
[概 要] コントローラオブジェクトを取得します。 |
String[] |
getEventTypes(String componentName)
[概 要] 引数指定された名前を持つエレメントに登録されているイベントタイプ群を返却します。 |
void |
loadConfig(String fileName)
[概 要] イベント紐付け情報XMLを読込み追加するメソッドです。 |
void |
setBindInfo(Map<String,Map<String,Class<? extends Action>>> bindInfo)
[概 要] イベント紐付け情報保持オブジェクトを設定します。 |
void |
setController(BaseController controller)
[概 要] コントローラオブジェクトを設定します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public EventBinder(BaseController controller)
[概 要]
デフォルトコンストラクタです。[詳 細]
bindInfoフィールドインスタンスを生成します。[備 考]
メソッドの詳細 |
---|
public Map<String,Map<String,Class<? extends Action>>> getBindInfo()
[概 要]
イベント紐付け情報保持オブジェクトを取得します。[詳 細]
bindInfoフィールドを返却します。[備 考]
public void setBindInfo(Map<String,Map<String,Class<? extends Action>>> bindInfo)
[概 要]
イベント紐付け情報保持オブジェクトを設定します。[詳 細]
bindInfoフィールドを、引数bindInfoで設定します。[備 考]
bindInfo
- イベント紐付け情報public BaseController getController()
[概 要]
コントローラオブジェクトを取得します。[詳 細]
controllerフィールドを返却します。[備 考]
public void setController(BaseController controller)
[概 要]
コントローラオブジェクトを設定します。[詳 細]
controllerフィールドを引数controllerで設定します。[備 考]
controller
- コントローラオブジェクトpublic void addEventBinding(String componentName, String eventType, Class<? extends Action> actionClass)
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
引数componentNameが既に登録されている場合、componentName用のMapを取り出し、 イベントタイプをキーにしてアクションを登録します。[備 考]
登録された紐付け情報が反映されるのは、componentNameをname属性値として持つ エレメントが、ui Documentに追加されたタイミングです。
componentName
- コンポーネント(エレメント)のname属性値eventType
- NexawebイベントタイプactionClass
- 起動するアクションのクラス型public void addEventBindingImmediately(String componentName, String eventType, Class<? extends Action> actionClass)
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
addEventBinding(String, String, Class)
オーバーロードメソッドを
呼び出して、イベント紐付け情報保持オブジェクト(bindInfo)に追加します。[備 考]
addEventBinding(String, String, Class)
と違い、登録された情報がui Documentに
反映されるのはこのメソッド呼び出し直後です。
componentName
- コンポーネント(エレメント)のname属性値eventType
- NexawebイベントタイプactionClass
- 起動するアクションのクラス型addEventBinding(String, String, Class)
public String[] getEventTypes(String componentName)
[概 要]
引数指定された名前を持つエレメントに登録されているイベントタイプ群を返却します。[詳 細]
bindInfoフィールドから、引数componentNameで紐付け情報を取り出し、 登録されている全イベントタイプをString配列に変換して返却します。[備 考]
componentName
- コンポーネント(エレメント)のname属性値
public Class<? extends Action> getActionClass(String componentName, String eventType)
[概 要]
componentNameをname属性値として持つエレメントの、eventTypeイベント発動時の アクションクラス型を取得します。[詳 細]
bindInfoフィールドから、引数componentNameで紐付け情報を取り出し、 取り出した[イベントタイプ = アクションクラス]のマップから、eventTypeイベント のアクションクラスを取得、返却します。[備 考]
componentName
- コンポーネント(エレメント)のname属性値eventType
- イベントタイプ
public void loadConfig(String fileName)
[概 要]
イベント紐付け情報XMLを読込み追加するメソッドです。[詳 細]
イベント紐付け情報XMLを読込み追加するメソッドです。 読込みXMLの例:<?xml version="1.0" encoding="UTF-8"?> <reffi-client-config xmlns="urn:jp.co.fujitsu.reffi.client.config"> <import resource="reffi-client-config-window.xml" /> <!-- event mapping config. name: Name on element event: Set provided by the Nexaweb event name (ex. onCommand, onCreate, onContextMenu ...) type: Call action class --> <event-mappings> <!-- menuWindowAction --> <event name="menu.openChat" event="onCommand" type="demo.client.menu.action.OpenChatAction" /> </event-mappings> </reffi-client-config>
[備 考]
fileName
- 設定ファイル名
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |