net.xoetrope.swing.tree
Class XTreeBinding

java.lang.Object
  extended by net.xoetrope.xui.data.XDataBinding
      extended by net.xoetrope.swing.tree.XTreeBinding

public class XTreeBinding
extends XDataBinding

This class provides a means of binding a model node and its children to an XModel node.

Copyright: Copyright (c) Xoetrope Ltd., 2001-2006

License see license.txt


Field Summary
protected  XTreeModelAdapter adapter
           
protected  XTree treeComponent
           
 
Fields inherited from class net.xoetrope.xui.data.XDataBinding
component, currentProject, DEFAULT_OUTPUT_PATH, outputModel, outputPath, reevaluate, sourceModel, sourcePath
 
Constructor Summary
XTreeBinding()
          Construct a new data binding
 
Method Summary
 void get()
          Updates the Tree component with the value obtained from the data model.
 java.lang.String getName()
          Gets the name of the model node.
protected  java.lang.String getTreePath()
          Get the path from the root to the selected node
 java.lang.String getType()
          Get the type of this binding.
 void set()
          Updates the data model with the value retrieved from the TextComponent.
 void setOutput(XModel newNode, java.lang.String outputPath)
          Set the output node where state data for this binding will be saved
 void setSource(XModel newNode)
          Set the source for this bindings's data
 void setup(XProject project, java.lang.Object c, java.util.Hashtable bindingConfig, java.util.Hashtable instanceConfig)
          Setup and configure the binding instance.
 
Methods inherited from class net.xoetrope.xui.data.XDataBinding
getAttributes, getAttributes, getComponent, getOutput, getOutputPath, getReevaluate, getSource, getSourcePath, setOutputPath, setReevaluate, setSourcePath, setupHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treeComponent

protected XTree treeComponent

adapter

protected XTreeModelAdapter adapter
Constructor Detail

XTreeBinding

public XTreeBinding()
Construct a new data binding

Method Detail

setup

public void setup(XProject project,
                  java.lang.Object c,
                  java.util.Hashtable bindingConfig,
                  java.util.Hashtable instanceConfig)
Setup and configure the binding instance. The binding is configured via the XML setup registered for the particular binding type and then, subsequently by attibitional attributes of the binding instance specified in the page declaration, for the individual binding instance. The binding may also obtain configuration or reference information from the component and the project.

Specified by:
setup in class XDataBinding
Parameters:
project - the owning project
c - the component being bound
bindingConfig - the XML element which contains the binding configuration
instanceConfig - the XML element which contains the setup attributes of the binding instance

get

public void get()
Updates the Tree component with the value obtained from the data model. Filters the list by ignoring repeat items (note that this does not guarantee unique list entries unless the useUnique flag is set).

Specified by:
get in class XDataBinding

set

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

Specified by:
set in class XDataBinding

getName

public java.lang.String getName()
Gets the name of the model node.

Returns:
the name

setSource

public void setSource(XModel newNode)
Set the source for this bindings's data

Overrides:
setSource in class XDataBinding
Parameters:
newNode - the path to the data in the model

setOutput

public void setOutput(XModel newNode,
                      java.lang.String outputPath)
Set the output node where state data for this binding will be saved

Overrides:
setOutput in class XDataBinding
Parameters:
newNode - the output node
outputPath - the output path

getTreePath

protected java.lang.String getTreePath()
Get the path from the root to the selected node

Returns:
the path

getType

public java.lang.String getType()
Get the type of this binding.

Specified by:
getType in class XDataBinding
Returns:
the binding type name