org.formaria.editor.project.data
Class EditorDataBinding

java.lang.Object
  extended by org.formaria.aria.data.DataBinding
      extended by org.formaria.editor.project.data.EditorDataBinding

public class EditorDataBinding
extends DataBinding

A processsor for Page annotations

Copyright (c) Formaria Ltd., 2002-2006

License: see license.txt

$Revision: 1.9 $


Field Summary
 
Fields inherited from class org.formaria.aria.data.DataBinding
component, currentProject, DEFAULT_OUTPUT_PATH, outputModel, outputPath, reevaluate, sourceModel, sourcePath
 
Constructor Summary
EditorDataBinding(DataBinding db, java.util.Hashtable config)
          Creates a new instance of EditorDataBinding
 
Method Summary
 void get()
          Update the bound component with the value obtained from the data model.
 java.util.Vector getAttributes(boolean required)
          Get the names of the attributes used by this binding class
 java.lang.Object getComponent()
          Get the component to which this binding is attached
 java.util.Hashtable getInstanceConfig()
          Get the extra attributes of the binding
 DataModel getOutput()
          Get the output model
 java.lang.String getOutputPath()
          Get the model path for the output/state data
 boolean getReevaluate()
          Get the reevaluate flag.
 DataModel getSource()
          Get the source model
 java.lang.String getSourcePath()
          Get the model path for the source data
 java.lang.String getType()
          Get the type of this binding
 void set()
          Update the data model with the value retrieved from the bound component.
 void setOutput(DataModel newNode, 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 setReevaluate(boolean b)
          Set the reevaluate flag.
 void setSource(DataModel newNode)
          Set the source node for data in the model
 void setSourcePath(java.lang.String newPath)
          Set the model path for the source data
 void setup(Project project, java.lang.Object c, java.util.Hashtable bindingConfig, java.util.Hashtable instanceConfig)
          Setup and configure the binding instance.
 
Methods inherited from class org.formaria.aria.data.DataBinding
getAttributes, setupHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorDataBinding

public EditorDataBinding(DataBinding db,
                         java.util.Hashtable config)
Creates a new instance of EditorDataBinding

Method Detail

setup

public void setup(Project 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 DataBinding
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()
Update the bound component with the value obtained from the data model.

Specified by:
get in class DataBinding

set

public void set()
Update the data model with the value retrieved from the bound component.

Specified by:
set in class DataBinding

getComponent

public java.lang.Object getComponent()
Get the component to which this binding is attached

Overrides:
getComponent in class DataBinding
Returns:
The component which is being bound

getSourcePath

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

Overrides:
getSourcePath in class DataBinding
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

Overrides:
getOutputPath in class DataBinding
Returns:
The raw path to which the output model is bound

setSource

public void setSource(DataModel newNode)
Set the source node for data in the model

Overrides:
setSource in class DataBinding
Parameters:
newNode - the path of the data in the model

setOutput

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

Overrides:
setOutput in class DataBinding
Parameters:
newNode - the new model for saving the output data
path - The path to which the outputModel is writing.

getSource

public DataModel getSource()
Get the source model

Overrides:
getSource in class DataBinding
Returns:
the model node

getOutput

public DataModel getOutput()
Get the output model

Overrides:
getOutput in class DataBinding
Returns:
the model node

setSourcePath

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

Overrides:
setSourcePath in class DataBinding
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

Overrides:
setOutputPath in class DataBinding
Parameters:
newPath - The path to which the output model is to be bound

getReevaluate

public boolean getReevaluate()
Get the reevaluate flag. The reevaluate flag controls whether or not the binding paths are revaluated when a page is displayed/redisplayed. By default the value is true. A binding can optionally specify a 'reeval' attribute to control the setting.

Overrides:
getReevaluate in class DataBinding
Returns:
true if the binding paths are to be reevaluated

setReevaluate

public void setReevaluate(boolean b)
Set the reevaluate flag. The reevaluate flag controls whether or not the binding paths are revaluated when a page is displayed/redisplayed. By default the value is true. A binding can optionally specify a 'reeval' attribute to control the setting.

Overrides:
setReevaluate in class DataBinding
Parameters:
b - true if the binding paths are to be reevaluated

getAttributes

public java.util.Vector getAttributes(boolean required)
Get the names of the attributes used by this binding class

Overrides:
getAttributes in class DataBinding
Parameters:
required - true to list only the require attribues, false for all attributes

getType

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

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

getInstanceConfig

public java.util.Hashtable getInstanceConfig()
Get the extra attributes of the binding