*
* @return <code>parent</code>.
*/
public UIComponent create(FacesContext context, LayoutComponent descriptor, UIComponent parent) {
// Create an Event component for this
EventComponent event = new EventComponent();
if (parent != null) {
addChild(context, descriptor, parent, event);
}
// Get the inputs
String baseName = (String) descriptor.getEvaluatedOption(context, "basename", parent);
String var = (String) descriptor.getEvaluatedOption(context, "var", parent);
Locale locale = (Locale) descriptor.getEvaluatedOption(context, "locale", parent);
// Create a handler (needed to execute code each time displayed)...
HandlerDefinition def = LayoutDefinitionManager.
getGlobalHandlerDefinition("setResourceBundle");
Handler handler = new Handler(def);
handler.setInputValue("bundle", baseName);
handler.setInputValue("key", var);
handler.setInputValue("locale", locale);
List<Handler> handlers = new ArrayList<Handler>();
handlers.add(handler);
event.getAttributes().put("beforeEncode", handlers);
// Return (parent)
return event;
}