1 /*
2 * Copyright 2004-2008 the Seasar Foundation and the Others.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.seasar.uruma.binding.value;
17
18 import org.seasar.framework.beans.PropertyDesc;
19 import org.seasar.uruma.component.UIComponent;
20
21 /**
22 * ウィジットクラス毎のバインディングを行うためのインターフェースです。<br />
23 *
24 * @author y-komori
25 */
26 public interface ValueBinder {
27 /**
28 * ウィジットの値をフォームへ設定します。<br />
29 *
30 * @param widget
31 * ウィジット側オブジェクト
32 * @param formObj
33 * フォーム側オブジェクト
34 * @param propDesc
35 * フォーム側のプロパティを表す {@link PropertyDesc} オブジェクト
36 * @param uiComp
37 * コンポーネント
38 */
39 public void importValue(Object widget, Object formObj,
40 PropertyDesc propDesc, UIComponent uiComp);
41
42 /**
43 * フォームの値をウィジットへ設定します。<br />
44 *
45 * @param widget
46 * ウィジット側オブジェクト
47 * @param formObj
48 * フォーム側オブジェクト
49 * @param propDesc
50 * フォーム側のプロパティを表す {@link PropertyDesc} オブジェクト
51 * @param uiComp
52 * コンポーネント
53 */
54 public void exportValue(Object widget, Object formObj,
55 PropertyDesc propDesc, UIComponent uiComp);
56
57 /**
58 * ウィジットで選択されているオブジェクトをフォームへ設定します。<br />
59 *
60 * @param widget
61 * ウィジット側オブジェクト
62 * @param formObj
63 * フォーム側オブジェクト
64 * @param propDesc
65 * フォーム側のプロパティを表す {@link PropertyDesc} オブジェクト
66 * @param uiComp
67 * コンポーネント
68 */
69 public void importSelection(Object widget, Object formObj,
70 PropertyDesc propDesc, UIComponent uiComp);
71
72 /**
73 * フォームの持つオブジェクトをウィジットの選択状態として設定します。<br />
74 *
75 * @param widget
76 * ウィジット側オブジェクト
77 * @param formObj
78 * フォーム側オブジェクト
79 * @param propDesc
80 * フォーム側のプロパティを表す {@link PropertyDesc} オブジェクト
81 * @param uiComp
82 * コンポーネント
83 */
84 public void exportSelection(Object widget, Object formObj,
85 PropertyDesc propDesc, UIComponent uiComp);
86
87 /**
88 * 対応するウィジットの {@link Class} オブジェクトを返します。<br />
89 *
90 * @return 対応するウィジットの {@link Class} オブジェクト
91 */
92 public Class<?> getWidgetType();
93 }