org.seasar.uruma.rcp.binding
クラス GenericSelectionListener
java.lang.Object
org.seasar.uruma.rcp.binding.GenericSelectionListener
- すべての実装されたインタフェース:
- ISelectionListener
- 直系の既知のサブクラス:
- NullGenericSelectionListener
public class GenericSelectionListener
- extends Object
- implements ISelectionListener
任意のメソッドを呼び出すことができる、汎用的な ISelectionListener
の実装クラスです。
本クラスは ISelectionListener
として振る舞い、 selectionChanged
メソッドが呼び出された際に、コンストラクタで渡される Object
、Method
の表すメソッドを呼び出します。
このとき、コンストラクタで渡される Method
オブジェクトの表す引数によって、呼び出される際の引数の渡し方が変化します。
- 引数がなしのとき
- 引数には何も渡されません。
- 引数が配列型以外で 1 個のとき
selectionChanged
メソッドで渡される ISelection
オブジェクトの持つ要素が引数の型に代入可能かチェックし、代入可能ならば最初の 1 個を渡します。
- 引数が配列型で 1 個のとき
selectionChanged
メソッドで渡される ISelection
オブジェクトの持つ要素が引数の型に代入可能かチェックし、代入可能ならば全ての要素を渡します。
- 引数が 2 個以上のとき
- コンストラクタ呼び出し時に
IllegalArgumentException
をスローします。
- 作成者:
- y-komori
クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericSelectionListener
public GenericSelectionListener(PartContext context,
SingleParamTypeMethodBinding methodBinding)
GenericSelectionListener
を構築します。
- パラメータ:
context
- PartContext
オブジェクトmethodBinding
- 呼び出し対象の SingleParamTypeMethodBinding
オブジェクト
selectionChanged
public void selectionChanged(IWorkbenchPart part,
ISelection selection)
- イベント処理を行います。
本メソッドでは、以下の処理を順に実行します。
-
WindowContext
へフォームオブジェクトとして、
SingleParamTypeMethodBinding
の保持するターゲットオブジェクトを設定します。
- ターゲットオブジェクトへ、画面の選択状態をバインド(ImportSelection)します。
- ターゲットオブジェクトへ、画面の値をバインド(ImportValue)します。
- コンストラクタで指定された
MethodBinding
の呼び出しを行います。
- 画面へ、ターゲットオブジェクトの値をバインド(ExportValue)します。
- 画面の選択状態ををターゲットオブジェクトのフィールドに従ってバインド(ExportSelection)します。
- 定義:
- インタフェース
ISelectionListener
内の selectionChanged
- 関連項目:
ISelectionListener.selectionChanged(org.eclipse.ui.IWorkbenchPart,
org.eclipse.jface.viewers.ISelection)
Copyright © 2006-2008 The Seasar Foundation. All Rights Reserved.