|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.data.XStateBinding
public class XStateBinding
Bind a component's state 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 RadioButtons or Checkboxes.
Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
| Field Summary | |
|---|---|
protected java.lang.String |
attribStr
|
protected java.lang.Object |
comp
|
protected boolean |
isLeafNode
|
protected java.lang.String |
offValue
The value which will be used to store the value of the off state of the check/radio components in the model. |
protected java.lang.String |
onValue
The value which will be used to store the value of the on state of the check/radio components in the model. |
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 | |
|---|---|
XStateBinding()
Default constuctor to enable creation of subclassed custom bindings and late binding. |
|
XStateBinding(java.lang.Object c,
java.lang.String dataElement)
Construct a new data binding |
|
XStateBinding(java.lang.Object c,
java.lang.String dataElement,
XModel srcModel,
java.lang.String leafAttrib)
Construct a new data binding |
|
| Method Summary | |
|---|---|
void |
get()
Updates the component state with the value obtained from the data model. |
java.lang.String |
getAttribute()
Retrieve the name of the attribute which is storing the value of the binding |
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 component. |
void |
setAttribute(java.lang.String attrib)
Set the name of the attribute which is to be used for storing and retrieving the model value. |
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)
Update the model node used in the binding. |
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 boolean isLeafNode
protected java.lang.String attribStr
protected java.lang.String onValue
protected java.lang.String offValue
| Constructor Detail |
|---|
public XStateBinding()
public XStateBinding(java.lang.Object c,
java.lang.String dataElement)
c - the component to be bounddataElement - the name of the data in the model
public XStateBinding(java.lang.Object c,
java.lang.String dataElement,
XModel srcModel,
java.lang.String leafAttrib)
c - the component to be bounddataElement - the name of the data in the modelsrcModel - the model node that acts as the data source for this nodeleafAttrib - null or true for a leaf node where the value controls the state,
or false to use the child values to control not only the state but also the enabled/disabled state| Method Detail |
|---|
public void setAttribute(java.lang.String attrib)
attrib - the name of the attribute which will store the value.public java.lang.String getAttribute()
public void get()
get in interface XDataBindingpublic void set()
set in interface XDataBindingpublic 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 new model for the data source
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 | |||||||||