01: package net.xoetrope.xui.data;
02:
03: import java.awt.Component;
04: import net.xoetrope.xml.XmlElement;
05:
06: /**
07: * <p>Describes an interface used to allow components to be updated
08: * when a data model changes and to allow the model to be updated when the user
09: * interface elements change.</p>
10: * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003<br>
11: * License: see license.txt
12: * @version $Revision: 1.14 $
13: */
14: public interface XDataBinding {
15: public static final String DEFAULT_OUTPUT_PATH = "xui_state/";
16:
17: /**
18: * Update the bound component with the value obtained from the data model.
19: */
20: public void get();
21:
22: /**
23: * Update the data model with the value retrieved from the bound component.
24: */
25: public void set();
26:
27: /**
28: * Get the component to which this binding is attached
29: */
30: public Component getComponent();
31:
32: /**
33: * Get the model path for the source data
34: */
35: public String getSourcePath();
36:
37: /**
38: * Get the model path for the output/state data
39: */
40: public String getOutputPath();
41:
42: /**
43: * Set the model path for the source data
44: */
45: public void setSourcePath(String newPath);
46:
47: /**
48: * Set the model path for the output/state data
49: */
50: public void setOutputPath(String newPath);
51:
52: /**
53: * Update the model node used in the binding. Note that this method does not
54: * modify the path values stored by this node.
55: * @param newNode the new model for the data source
56: */
57: public void setSource(XModel newNode);
58:
59: /**
60: * Update the path values stored by this node. The output path is used to
61: * store selection data and state.
62: * @param newNode the new model for saving the output data
63: */
64: public void setOutput(XModel newModel);
65: }
|