Package org.apache.myfaces.tobago.context

Examples of org.apache.myfaces.tobago.context.TobagoFacesContext


public class StyleRenderer extends RendererBase {

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    if (facesContext instanceof TobagoFacesContext) {
      TobagoFacesContext pageFacesContext = (TobagoFacesContext) facesContext;
      UIStyle styleComponent = (UIStyle) component;
      String file = styleComponent.getFile();
      if (file != null) {
        pageFacesContext.getStyleFiles().add(file);
      }
      String style = styleComponent.getStyle();
      if (style != null) {
        pageFacesContext.getStyleBlocks().add(style);
      }
    }
  }
View Full Code Here


public class ScriptRenderer extends RendererBase {

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    if (facesContext instanceof TobagoFacesContext) {
      TobagoFacesContext pageFacesContext = (TobagoFacesContext) facesContext;
      UIScript scriptComponent = (UIScript) component;
      String exit = scriptComponent.getOnexit();
      if (exit != null) {
        pageFacesContext.getOnexitScripts().add(exit);
      }
      String submit = scriptComponent.getOnsubmit();
      if (submit != null) {
        pageFacesContext.getOnsubmitScripts().add(submit);
      }
      String load = scriptComponent.getOnload();
      if (load != null) {
        pageFacesContext.getOnloadScripts().add(load);
      }
      String unload = scriptComponent.getOnunload();
      if (unload != null) {
        pageFacesContext.getOnunloadScripts().add(unload);
      }
      String script = scriptComponent.getScript();
      if (script != null) {
        pageFacesContext.getScriptBlocks().add(script);
      }
      String file = scriptComponent.getFile();
      if (file != null) {
        pageFacesContext.getScriptFiles().add(file);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.context.TobagoFacesContext

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.