com.uwyn.rife.site
Class SelectResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by java.util.ListResourceBundle
          extended by com.uwyn.rife.site.SelectResourceBundle

public class SelectResourceBundle
extends ListResourceBundle

A ResourceBundle implementation which facilitates the use of select boxes in forms for properties with inList constraints. Example use:

Template t = ...
 List<Club> clubs = ...;
 ClubSelectionBean bean = ...;
 
 Map<String,String> names = new HashMap<String,String>(clubs.size());
 for (Club club : clubs) {
     names.put(club.getUniqueName(), club.getFullName());
 }
  
 bean.getConstrainedProperty("clubUniqueName")
     .setInList(names.keySet());
 t.addResourceBundle(new SelectResourceBundle("clubUniqueName", names));
  
 generateForm(t, bean);
 print(t);

Since:
1.0
Version:
$Revision: 3308 $
Author:
Keith Lea ,, Geert Bevin (gbevin[remove] at uwyn dot com)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.ResourceBundle
ResourceBundle.Control
 
Field Summary
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
SelectResourceBundle(String property, Map<? extends CharSequence,? extends CharSequence> map)
          Creates a new select tag resource bundle with the given input form property and the given map from values to displayed strings.
 
Method Summary
protected  Object[][] getContents()
           
 
Methods inherited from class java.util.ListResourceBundle
getKeys, handleGetObject, handleKeySet
 
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, keySet, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectResourceBundle

public SelectResourceBundle(String property,
                            Map<? extends CharSequence,? extends CharSequence> map)
                     throws IllegalArgumentException
Creates a new select tag resource bundle with the given input form property and the given map from values to displayed strings.

Parameters:
property - the property whose possible values are described in map
map - a map from possible property values with their corresponding descriptions
Throws:
IllegalArgumentException
Method Detail

getContents

protected Object[][] getContents()
Specified by:
getContents in class ListResourceBundle


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.