net.xoetrope.optional.data
Class XTableTableBinding

java.lang.Object
  extended by net.xoetrope.optional.data.XTableTableBinding
All Implemented Interfaces:
XDataBinding

public class XTableTableBinding
extends java.lang.Object

    
implements XDataBinding

    

A binding that binds a table component to a database table. Normally this object should be setup by the XOptionalBindingFactory

Copyright Xoetrope(c) 2003-2004

$Revision: 2.8 $ License: see license.txt


Field Summary
protected  XModel outputNode
           
protected  java.lang.String outputPath
           
protected  XModel sourceNode
           
protected  java.lang.String sourcePath
           
protected  XModelHolder target
           
protected  boolean useUnique
           
 
Fields inherited from interface net.xoetrope.xui.data.XDataBinding
DEFAULT_OUTPUT_PATH
 
Constructor Summary
XTableTableBinding(java.lang.Object comp, XModel xmodel)
          An XTable binding ctor
 
Method Summary
 void get()
          Updates the table component with the value obtained from the data model.
 java.lang.Object getComponent()
          Get the UI component that participates in this binding
 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 table component.
 void setOutput(XModel newModel, java.lang.String path)
          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

target

protected XModelHolder target

useUnique

protected boolean useUnique

outputNode

protected XModel outputNode

sourceNode

protected XModel sourceNode

outputPath

protected java.lang.String outputPath

sourcePath

protected java.lang.String sourcePath
Constructor Detail

XTableTableBinding

public XTableTableBinding(java.lang.Object comp,
                          XModel xmodel)
An XTable binding ctor

Parameters:
comp - The table object being bound
xmodel - The model to which the table is to be bound
Method Detail

get

public void get()
Updates the table component with the value obtained from the data model. This method does nothing as the table should dynamically pull its data from the model. Any change in the model is effected by the setSore or setSourcePath methods.

Specified by:
get in interface XDataBinding

set

public void set()
Updates the data model with the value retrieved from the table component.

Specified by:
set in interface XDataBinding

getComponent

public java.lang.Object getComponent()
Get the UI component that participates in this binding

Specified by:
getComponent in interface XDataBinding
Returns:
the component

getSourcePath

public java.lang.String getSourcePath()
Get the model path for the source data

Specified by:
getSourcePath in interface XDataBinding
Returns:
The raw path to which the source model is bound

getOutputPath

public java.lang.String getOutputPath()
Get the model path for the output/state data

Specified by:
getOutputPath in interface XDataBinding
Returns:
The raw path to which the output model is bound

setSourcePath

public void setSourcePath(java.lang.String newPath)
Set the model path for the source data

Specified by:
setSourcePath in interface XDataBinding
Parameters:
newPath - The path to which the source model is to be bound

setOutputPath

public void setOutputPath(java.lang.String newPath)
Set the model path for the output/state data

Specified by:
setOutputPath in interface XDataBinding
Parameters:
newPath - The path to which the output model is to be bound

setSource

public void setSource(XModel newNode)
Update the model node used in the binding. Note that this method does not modify the path values stored by this node.

Specified by:
setSource in interface XDataBinding
Parameters:
newNode - the new model for the data source

setOutput

public void setOutput(XModel newModel,
                      java.lang.String path)
Update the path values stored by this node. The output path is used to store selection data and state.

Specified by:
setOutput in interface XDataBinding
Parameters:
newModel - the new model for saving the output data
path - The path to which the outputModel is writing.