1 /**
2 * Copyright 2010 The Kuali Foundation Licensed under the
3 * Educational Community License, Version 2.0 (the "License"); you may
4 * not use this file except in compliance with the License. You may
5 * obtain a copy of the License at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing,
10 * software distributed under the License is distributed on an "AS IS"
11 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 package org.kuali.student.common.ui.client.configurable.mvc.binding;
17
18 import org.kuali.student.common.ui.client.mvc.DataModel;
19
20 /**
21 * A model widget binding is used to translate data from the model to something the client side widget
22 * can use to display it's data. It is also used to translate from widget data to the appropriate expected
23 * model data.
24 *
25 * @author Kuali Student Team
26 */
27 public interface ModelWidgetBinding<WidgetType> {
28
29 /**
30 * Sets the model with the value from the widget
31 * @param widget Widget to interpret the data from
32 * @param DataModel model to have a value/values added to
33 * @param path where in the model to store the data
34 */
35 public abstract void setModelValue(WidgetType widget, DataModel model, String path);
36
37 /**
38 * Sets the passed in widget with the appropriate data from the model
39 * @param widget the widget to have its value set
40 * @param model DataModel to retrieve the data from
41 * @param path where in the model to get the data
42 */
43 public abstract void setWidgetValue(WidgetType widget, DataModel model, String path);
44
45 }