KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > gumby > view > Binding


1 package org.sapia.gumby.view;
2
3 /**
4  * A <code>Binding</code> is associated to a UI component and is in charge of
5  * synchronizing the state of that component with a given part of the model.
6  *
7  * @see org.sapia.gumby.view.View
8  *
9  * @author Yanick Duchesne
10  *
11  * <dl>
12  * <dt><b>Copyright: </b>
13  * <dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open
14  * Source Software </a>. All Rights Reserved.</dd>
15  * </dt>
16  * <dt><b>License: </b>
17  * <dd>Read the license.txt file of the jar or visit the <a
18  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
19  * OSS web site</dd>
20  * </dt>
21  * </dl>
22  */

23 public interface Binding {
24
25   /**
26    * @return the ID if the widget that this instance binds to.
27    */

28   public String JavaDoc getId();
29
30   /**
31    * This method is called by the view to which this instance belongs when the
32    * model is first set on the view.
33    *
34    * @see View#setModel(Object)
35    *
36    * @param owner
37    * the <code>View</code> that owns the instance.
38    * @param model
39    * the <code>Object</code> consisting of the model that was
40    * assigned to the given view.
41    */

42   public void onBound(View owner, Object JavaDoc model);
43
44   /**
45    * This method is called by the view to which this instance belongs when the
46    * model is changed - the view currently has a model, but it is replaced by
47    * another instance.
48    *
49    * @see View#setModel(Object)
50    *
51    * @param owner
52    * the <code>View</code> that owns the instance.
53    * @param model
54    * the <code>Object</code> consisting of the model that was
55    * assigned to the given view.
56    */

57   public void onChanged(View owner, Object JavaDoc model);
58
59   /**
60    * This method is called by the view when its <code>fireUpdated()</code>
61    * method is called.
62    *
63    * @see View#fireUpdated()
64    * @see View#fireUpdateModel(String)
65    *
66    * @param owner
67    * the <code>View</code> that owns the instance.
68    * @param model
69    * the <code>Object</code> consisting of the model that was
70    * assigned to the given view.
71    */

72   public void onUpdated(View owner, Object JavaDoc model);
73
74   /**
75    * This method is called by the view when its <code>fireUpdateModel()</code>
76    * method is called.
77    *
78    * @see View#fireUpdateModel()
79    * @see View#fireUpdateModel(String)
80    *
81    * @param owner
82    * the <code>View</code> that owns the instance.
83    * @param model
84    * the <code>Object</code> consisting of the model that was
85    * assigned to the given view.
86    */

87   public void updateModel(View owner, Object JavaDoc model);
88
89 }
90
Popular Tags