org.formaria.data
Class LocalisedListBinding

java.lang.Object
  extended by org.formaria.aria.data.DataBinding
      extended by org.formaria.aria.data.ListBinding
          extended by org.formaria.data.LocalisedListBinding

public class LocalisedListBinding
extends ListBinding

A list binding that supports localization of the list content

Copyright Formaria (c) 2008

$Revision: 2.8 $ License: see license.txt


Field Summary
protected  java.util.Vector keys
           
protected  java.util.ResourceBundle languageResourceBundle
           
 
Fields inherited from class org.formaria.aria.data.ListBinding
attribStr, bDirty, listHolder, model, saveToSourceNode, useActiveField, useUnique
 
Fields inherited from class org.formaria.aria.data.DataBinding
component, currentProject, DEFAULT_OUTPUT_PATH, outputModel, outputPath, reevaluate, sourceModel, sourcePath
 
Constructor Summary
LocalisedListBinding()
           
 
Method Summary
protected  java.lang.String addItem(java.lang.String s)
          translate the text at this point
 java.lang.String getKey(int idx)
          Get the untranslated key for a list item
 void setup(Project project, java.lang.Object c, java.util.Hashtable bindingConfig, java.util.Hashtable instanceConfig)
          Setup and configure the binding instance.
protected  java.lang.String translate(java.lang.String key)
          Translate the text being added to the list.
 
Methods inherited from class org.formaria.aria.data.ListBinding
addItem, get, getAttributes, getDirty, getName, getType, set, setDirty, setOutput, setSource, setUseUnique
 
Methods inherited from class org.formaria.aria.data.DataBinding
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

languageResourceBundle

protected java.util.ResourceBundle languageResourceBundle

keys

protected java.util.Vector keys
Constructor Detail

LocalisedListBinding

public LocalisedListBinding()
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.

Overrides:
setup in class ListBinding
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

translate

protected java.lang.String translate(java.lang.String key)
Translate the text being added to the list.

Parameters:
key - the key to be look up in the resourcebundle
Returns:
the translated key or the key itself if no translation found

addItem

protected java.lang.String addItem(java.lang.String s)
translate the text at this point

Parameters:
s - the text to be translated
Returns:
The passed String

getKey

public java.lang.String getKey(int idx)
Get the untranslated key for a list item

Parameters:
idx - the list index
Returns:
the key at the specified index