com.uwyn.rife.site
Class SelectResourceBundle
java.lang.Object
java.util.ResourceBundle
java.util.ListResourceBundle
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)
| 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 |
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
mapmap - a map from possible property values with their corresponding
descriptions
- Throws:
IllegalArgumentException
getContents
protected Object[][] getContents()
- Specified by:
getContents in class ListResourceBundle
Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.