Package com.sun.jsftemplating.component

Examples of com.sun.jsftemplating.component.EventComponent


     *
     *  @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;
    }
View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.component.EventComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.