net.xoetrope.optional.data
Class XLocalisedListBinding

java.lang.Object
  extended by net.xoetrope.xui.data.XDataBinding
      extended by net.xoetrope.xui.data.XListBinding
          extended by net.xoetrope.optional.data.XLocalisedListBinding

public class XLocalisedListBinding
extends XListBinding

A list binding that supports localization of the list content

Copyright Xoetrope (c) 2001-2004

$Revision: 2.8 $ License: see license.txt


Field Summary
protected  java.util.Vector keys
           
protected  java.util.ResourceBundle languageResourceBundle
           
 
Fields inherited from class net.xoetrope.xui.data.XListBinding
attribStr, bDirty, listHolder, model, saveToSourceNode, useUnique
 
Fields inherited from class net.xoetrope.xui.data.XDataBinding
component, currentProject, DEFAULT_OUTPUT_PATH, outputModel, outputPath, reevaluate, sourceModel, sourcePath
 
Constructor Summary
XLocalisedListBinding()
           
 
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(XProject 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 net.xoetrope.xui.data.XListBinding
get, getAttributes, getDirty, getName, getType, set, setDirty, setOutput, setSource, setUseUnique
 
Methods inherited from class net.xoetrope.xui.data.XDataBinding
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

XLocalisedListBinding

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

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

Overrides:
addItem in class XListBinding
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