|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.data.XTextBinding
public class XTextBinding
Bind a TextComponent to a data model value/node. The binding allows a model node to
linked to a UI component so that it can be refreshed when new data is written
to the model or conversely when the UI component needs to write data to the
model.
This binding is designed to be used by components such
as TextComponents or TextFields.
Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
| Field Summary | |
|---|---|
protected java.lang.String |
attribStr
|
protected java.lang.Object |
comp
|
protected XModel |
outputModel
|
protected java.lang.String |
outputPath
|
protected XModel |
sourceModel
|
protected java.lang.String |
srcPath
|
| Fields inherited from interface net.xoetrope.xui.data.XDataBinding |
|---|
DEFAULT_OUTPUT_PATH |
| Constructor Summary | |
|---|---|
XTextBinding()
null ctor |
|
XTextBinding(java.lang.Object c,
java.lang.String dataElement)
Construct a new data binding |
|
XTextBinding(java.lang.Object c,
java.lang.String dataElement,
XModel srcModel)
Construct a new data binding |
|
XTextBinding(java.lang.Object c,
java.lang.String dataElement,
XModel srcModel,
java.lang.String attrib)
Construct a new data binding |
|
| Method Summary | |
|---|---|
void |
get()
Updates the TextComponent with the value obtained from the data model. |
java.lang.Object |
getComponent()
Get the component to which this binding is attached |
java.lang.String |
getName()
Gets the name of the model node |
java.lang.String |
getOutputPath()
Get the model path for the output/state data |
java.lang.String |
getSourcePath()
Get the model path for the source data |
void |
set()
Updates the data model with the value retrieved from the TextComponent. |
protected void |
setComponentValue(java.lang.String value)
|
protected void |
setModelValue(java.lang.String value)
Code moved from the set method to enable easier overloading. |
void |
setOutput(XModel newNode,
java.lang.String outputPath)
Update the path values stored by this node. |
void |
setOutputPath(java.lang.String newPath)
Set the model path for the output/state data |
void |
setSource(XModel newNode)
Set the source node for data in the model |
void |
setSourcePath(java.lang.String newPath)
Set the model path for the source data |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object comp
protected XModel sourceModel
protected XModel outputModel
protected java.lang.String srcPath
protected java.lang.String outputPath
protected java.lang.String attribStr
| Constructor Detail |
|---|
public XTextBinding()
public XTextBinding(java.lang.Object c,
java.lang.String dataElement)
c - the component to be bounddataElement - the name of the data in the model
public XTextBinding(java.lang.Object c,
java.lang.String dataElement,
XModel srcModel)
c - the component to be bounddataElement - the name of the data in the modelsrcModel - the source model node
public XTextBinding(java.lang.Object c,
java.lang.String dataElement,
XModel srcModel,
java.lang.String attrib)
c - the component to be bounddataElement - the name of the data in the modelsrcModel - the source model nodeattrib - display an attribute of the source node if non null| Method Detail |
|---|
public void get()
get in interface XDataBindingprotected void setComponentValue(java.lang.String value)
public void set()
set in interface XDataBindingprotected void setModelValue(java.lang.String value)
value - the value to be stored in the model.public java.lang.Object getComponent()
getComponent in interface XDataBindingpublic java.lang.String getSourcePath()
getSourcePath in interface XDataBindingpublic java.lang.String getOutputPath()
getOutputPath in interface XDataBindingpublic void setSource(XModel newNode)
setSource in interface XDataBindingnewNode - the path of the data in the model
public void setOutput(XModel newNode,
java.lang.String outputPath)
setOutput in interface XDataBindingnewNode - the new model for saving the output dataoutputPath - The path to which the outputModel is writing.public void setSourcePath(java.lang.String newPath)
setSourcePath in interface XDataBindingnewPath - The path to which the source model is to be boundpublic void setOutputPath(java.lang.String newPath)
setOutputPath in interface XDataBindingnewPath - The path to which the output model is to be boundpublic java.lang.String getName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||