|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjp.co.fujitsu.reffi.client.swing.controller.EventBinder
public class EventBinder
[概 要]
イベント紐付け情報保持クラスです。[詳 細]
AbstractController.bind(EventBinder)によるコンポーネント、イベントタイプ、アクションクラス
の紐付け情報を、bindInfoフィールドMapに保持します。
[
コンポーネント名1 =
イベントリスナクラス型 =
[イベントタイプ1(イベントハンドラメソッド名) = アクションクラス,
イベントタイプ2(イベントハンドラメソッド名) = アクションクラス],
コンポーネント名2 =
イベントリスナクラス型 =
[イベントタイプ1(イベントハンドラメソッド名) = アクションクラス]
]
eventBinder.addEventBinding("chatFrame.jbEnterChannel", ActionListener.class, "actionPerformed", EnterChannelAction.class);
eventBinder.addEventBinding("chatFrame.jbRemarkSend", ActionListener.class, "actionPerformed", RemarkSendAction.class);
eventBinder.addEventBinding("chatFrame", WindowListener.class, "windowClosing", ChatFrameCloseAction.class);
上記の場合、以下のようになります。
[
"chatFrame.jbEnterChannel" =
ActionListener.class =
["actionPerformed" = EnterChannelAction.class]
"chatFrame.jbRemarkSend" =
ActionListener.class =
["actionPerformed" = RemarkSendAction.class]
]
[備 考]
アプリケーション動作中に紐付け情報を追加する場合、以下のようにEventBinderオブジェクト を取得してaddEventBinding、又はaddEventBindingImmediatelyをコールします。
getController().getEventBinder().addEventBinding("inputFormFrame.jtfUserId", FocusListener.class, "focusLost", UserIdFocusLostAction.class);
[環 境] JDK 6.0 Update 11
Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.
| コンストラクタの概要 | |
|---|---|
EventBinder(AbstractController controller)
[概 要] デフォルトコンストラクタです。 |
|
| メソッドの概要 | |
|---|---|
void |
addEventBinding(String componentName,
Class<? extends EventListener> listenerType,
String eventType,
Class<? extends AbstractAction> actionClass)
[概 要] イベント紐付け情報追加メソッドです。 |
void |
addEventBinding(String componentName,
Class<? extends EventListener> listenerType,
String eventType,
String actionFqcn)
[概 要] イベント紐付け情報追加メソッドです。 |
void |
addEventBinding(String componentName,
String listenerFqcn,
String eventType,
String actionFqcn)
[概 要] イベント紐付け情報追加メソッドです。 |
void |
addEventBindingImmediately(Component component,
Class<? extends EventListener> listenerType,
String eventType,
Class<? extends AbstractAction> actionClass)
[概 要] イベント紐付け情報追加メソッドです。 |
void |
addEventBindingImmediately(String componentName,
Class<? extends EventListener> listenerType,
String eventType,
Class<? extends AbstractAction> actionClass)
[概 要] イベント紐付け情報追加メソッドです。 |
Class<? extends AbstractAction> |
getActionClass(String componentName,
Class<? extends EventListener> listenerType,
String eventType)
[概 要] 引数componentName、listenerType、eventTypeに紐付いているイベントタイプリストを返却します。 |
Map<String,Map<Class<? extends EventListener>,Map<String,Class<? extends AbstractAction>>>> |
getBindInfo()
[概 要] イベント紐付け情報保持オブジェクトを取得します。 |
AbstractController |
getController()
[概 要] コントローラオブジェクトを取得します。 |
List<String> |
getEventTypes(String componentName,
Class<? extends EventListener> listenerType)
[概 要] 引数componentName、listenerTypeに紐付いているイベントタイプリストを返却します。 |
Map<Class<? extends EventListener>,Map<String,Class<? extends AbstractAction>>> |
getListenerTypeMap(String componentName)
[概 要] 引数componentNameに紐付いているイベントリスナタイプマップを返却します。 |
List<Class<? extends EventListener>> |
getListenerTypes(String componentName)
[概 要] 引数componentNameに紐付いているイベントリスナのリストを返却します。 |
boolean |
isEventBinding(String componentName)
[概 要] 引数componentNameに対してイベント紐付けが行われているかどうか調べます。 |
void |
removeEventBinding(String componentName)
[概 要] イベント紐付け情報削除メソッドです. |
void |
removeEventBinding(String componentName,
Class<? extends EventListener> listenerType)
[概 要] イベント紐付け情報削除メソッドです. |
void |
removeEventBinding(String componentName,
Class<? extends EventListener> listenerType,
String eventType)
[概 要] イベント紐付け情報削除メソッドです. |
void |
removeEventBindingImmediately(Component component,
Class listenerType,
String eventType,
EventListener listener)
[概 要] イベント紐付け情報削除メソッドです。 |
void |
setBindInfo(Map<String,Map<Class<? extends EventListener>,Map<String,Class<? extends AbstractAction>>>> bindInfo)
[概 要] イベント紐付け情報保持オブジェクトを設定します。 |
void |
setController(AbstractController controller)
[概 要] コントローラオブジェクトを設定します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public EventBinder(AbstractController controller)
[概 要]
デフォルトコンストラクタです。[詳 細]
bindInfoフィールドインスタンスを生成します。[備 考]
| メソッドの詳細 |
|---|
public Map<String,Map<Class<? extends EventListener>,Map<String,Class<? extends AbstractAction>>>> getBindInfo()
[概 要]
イベント紐付け情報保持オブジェクトを取得します。[詳 細]
bindInfoフィールドを返却します。[備 考]
public void setBindInfo(Map<String,Map<Class<? extends EventListener>,Map<String,Class<? extends AbstractAction>>>> bindInfo)
[概 要]
イベント紐付け情報保持オブジェクトを設定します。[詳 細]
bindInfoフィールドを、引数bindInfoで設定します。[備 考]
bindInfo - イベント紐付け情報public AbstractController getController()
[概 要]
コントローラオブジェクトを取得します。[詳 細]
controllerフィールドを返却します。[備 考]
public void setController(AbstractController controller)
[概 要]
コントローラオブジェクトを設定します。[詳 細]
controllerフィールドを引数controllerで設定します。[備 考]
controller - コントローラオブジェクト
public void addEventBinding(String componentName,
String listenerFqcn,
String eventType,
String actionFqcn)
throws Exception
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
引数componentNameが既に登録されている場合、componentName用のMapを取り出し、 イベントタイプをキーにしてアクションを登録します。[備 考]
登録された紐付け情報が反映されるのは、componentNameをname属性値として持つ コンポーネントが画面追加されたタイミングです。
componentName - listenerFqcn - eventType - actionFqcn -
Exception
public void addEventBinding(String componentName,
Class<? extends EventListener> listenerType,
String eventType,
String actionFqcn)
throws Exception
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
引数componentNameが既に登録されている場合、componentName用のMapを取り出し、 イベントタイプをキーにしてアクションを登録します。[備 考]
登録された紐付け情報が反映されるのは、componentNameをname属性値として持つ コンポーネントが画面追加されたタイミングです。
componentName - listenerType - eventType - actionFqcn -
Exception
public void addEventBinding(String componentName,
Class<? extends EventListener> listenerType,
String eventType,
Class<? extends AbstractAction> actionClass)
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
引数componentNameが既に登録されている場合、componentName用のMapを取り出し、 イベントタイプをキーにしてアクションを登録します。[備 考]
登録された紐付け情報が反映されるのは、componentNameをname属性値として持つ コンポーネントが画面追加されたタイミングです。
componentName - listenerType - eventType - actionClass - public Map<Class<? extends EventListener>,Map<String,Class<? extends AbstractAction>>> getListenerTypeMap(String componentName)
[概 要]
引数componentNameに紐付いているイベントリスナタイプマップを返却します。[詳 細]
下記構造のMapを返却します。[ イベントリスナ型 = [イベントハンドラメソッド名 = アクションクラス], イベントリスナ型 = [イベントハンドラメソッド名 = アクションクラス], イベントリスナ型 = [イベントハンドラメソッド名 = アクションクラス], ]
[備 考]
componentName - イベントリスナタイプマップを取得するコンポーネント名
public List<Class<? extends EventListener>> getListenerTypes(String componentName)
[概 要]
引数componentNameに紐付いているイベントリスナのリストを返却します。[詳 細]
componentNameに対して以下のリスナタイプマップが紐付けられている場合、[ イベントリスナ型1 = [イベントハンドラメソッド名 = アクションクラス], イベントリスナ型2 = [イベントハンドラメソッド名 = アクションクラス], イベントリスナ型3 = [イベントハンドラメソッド名 = アクションクラス], ]以下のリストを返却します。
[イベントリスナ型1、イベントリスナ型2、イベントリスナ型3]
[備 考]
componentName - イベントリスナリストを取得するコンポーネント名
public List<String> getEventTypes(String componentName,
Class<? extends EventListener> listenerType)
[概 要]
引数componentName、listenerTypeに紐付いているイベントタイプリストを返却します。[詳 細]
componentNameに対して以下のリスナタイプマップが紐付けられている場合、
[
イベントリスナ型1 = [イベントハンドラメソッド名1 = アクションクラス,
イベントハンドラメソッド名2 = アクションクラス],
イベントリスナ型2 = [イベントハンドラメソッド名2 = アクションクラス],
イベントリスナ型3 = [イベントハンドラメソッド名3 = アクションクラス],
]
イベントリスナ型1に対して以下のリストを返却します。
[イベントハンドラメソッド名1、イベントハンドラメソッド名2]
[備 考]
componentName - イベントタイプリストを取得するコンポーネント名listenerType - イベントタイプリストを取得するイベントリスナタイプ
public Class<? extends AbstractAction> getActionClass(String componentName,
Class<? extends EventListener> listenerType,
String eventType)
[概 要]
引数componentName、listenerType、eventTypeに紐付いているイベントタイプリストを返却します。[詳 細]
componentNameに対して以下のリスナタイプマップが紐付けられている場合、
[
イベントリスナ型1 = [イベントハンドラメソッド名1 = アクションクラス1,
イベントハンドラメソッド名2 = アクションクラス2],
イベントリスナ型2 = [イベントハンドラメソッド名2 = アクションクラス3],
イベントリスナ型3 = [イベントハンドラメソッド名3 = アクションクラス4],
]
イベントリスナ型1、イベントハンドラメソッド名1に対してアクションクラス1を返却します。
[備 考]
componentName - アクションクラスを取得するコンポーネント名listenerType - アクションクラスを取得するイベントリスナタイプeventType - アクションクラスを取得するイベントタイプ
public boolean isEventBinding(String componentName)
[概 要]
引数componentNameに対してイベント紐付けが行われているかどうか調べます。[詳 細]
bindInfoフィールドにcomponentNameがキーとして含まれているかどうか調べます。[備 考]
componentName - イベント紐付けが行われているかどうか調べるコンポーネント名
public void addEventBindingImmediately(String componentName,
Class<? extends EventListener> listenerType,
String eventType,
Class<? extends AbstractAction> actionClass)
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
addEventBindingImmediately(Component, Class, String, Class)メソッドに
処理委譲します。
引数componentNameを名前として持つコンポーネントがメモリ上に存在しない場合、
処理は行われません。
[備 考]
componentName - listenerType - eventType - actionClass -
public void addEventBindingImmediately(Component component,
Class<? extends EventListener> listenerType,
String eventType,
Class<? extends AbstractAction> actionClass)
[概 要]
イベント紐付け情報追加メソッドです。[詳 細]
addEventBinding(String, Class, String, Class)オーバーロードメソッドを
呼び出して、イベント紐付け情報保持オブジェクト(bindInfo)に追加します。[備 考]
addEventBinding(String, Class, String, Class)と違い、
登録された情報が画面コンポーネントにイベントリスナ追加されるのはメソッド呼び出し直後です。
component - listenerType - eventType - actionClass - public void removeEventBinding(String componentName)
[概 要]
イベント紐付け情報削除メソッドです.[詳 細]
保持されているコンポーネン紐付け情報から、引数componentName に紐付いている全リスナを削除します。[備 考]
componentName -
public void removeEventBinding(String componentName,
Class<? extends EventListener> listenerType)
[概 要]
イベント紐付け情報削除メソッドです.[詳 細]
保持されているコンポーネン紐付け情報から、引数componentName に紐付いている引数listenerTypeを削除します。[備 考]
componentName - listenerType -
public void removeEventBinding(String componentName,
Class<? extends EventListener> listenerType,
String eventType)
[概 要]
イベント紐付け情報削除メソッドです.[詳 細]
保持されているコンポーネン紐付け情報から、引数componentNameの 引数listenerTypeに紐付いているeventTypeを削除します。[備 考]
componentName - listenerType - eventType -
public void removeEventBindingImmediately(Component component,
Class listenerType,
String eventType,
EventListener listener)
throws SecurityException,
NoSuchFieldException,
IllegalArgumentException,
IllegalAccessException
[概 要]
イベント紐付け情報削除メソッドです。[詳 細]
removeEventBinding(String, Class, String)メソッドを
呼び出して、イベント紐付け情報保持オブジェクト(bindInfo)から
引数情報を元に削除を行います。[備 考]
component - listenerType - eventType - listener -
SecurityException
NoSuchFieldException
IllegalArgumentException
IllegalAccessException
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||