Package org.apache.myfaces.tobago.component

Examples of org.apache.myfaces.tobago.component.UIStyle


public class StyleRenderer extends RendererBase {

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    UIStyle styleComponent = (UIStyle) component;
    String file = styleComponent.getFile();
    if (file != null) {
      FacesContextUtils.addStyleFile(facesContext, file);
    }
    String style = styleComponent.getStyle();
    if (style != null) {
      FacesContextUtils.addStyleBlock(facesContext, style);
    }
  }
View Full Code Here


  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UIStyle component = (UIStyle) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (style != null) {
      component.setValueExpression("style", style);
    }

    if (file != null) {
      component.setValueExpression("file", file);
    }

  }
View Full Code Here

  @Override
  public int doAfterBody() throws javax.servlet.jsp.JspException {
    final String content = bodyContent.getString();
    bodyContent.clearBody();
    if (StringUtils.isNotBlank(content)) {
      final UIStyle component = (UIStyle) getComponentInstance();
      component.setStyle(content.trim());
    }
    return super.doAfterBody();
  }
View Full Code Here

public class StyleRenderer extends RendererBase {

  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    UIStyle styleComponent = (UIStyle) component;
    String file = styleComponent.getFile();
    if (file != null) {
      FacesContextUtils.addStyleFile(facesContext, file);
    }
    String style = styleComponent.getStyle();
    if (style != null) {
      FacesContextUtils.addStyleBlock(facesContext, style);
    }
  }
View Full Code Here

public class StyleRenderer extends RendererBase {

  public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    final UIStyle styleComponent = (UIStyle) component;
    final String file = styleComponent.getFile();
    if (file != null) {
      FacesContextUtils.addStyleFile(facesContext, file);
    }
    final String style = styleComponent.getStyle();
    if (style != null) {
      FacesContextUtils.addStyleBlock(facesContext, style);
    }
  }
View Full Code Here

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UIStyle component = (UIStyle) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (style != null) {
      component.setValueExpression("style", style);
    }

    if (file != null) {
      component.setValueExpression("file", file);
    }

  }
View Full Code Here

  @Override
  public int doAfterBody() throws javax.servlet.jsp.JspException {
    final String content = bodyContent.getString();
    bodyContent.clearBody();
    if (StringUtils.isNotBlank(content)) {
      final UIStyle component = (UIStyle) getComponentInstance();
      component.setStyle(content.trim());
    }
    return super.doAfterBody();
  }
View Full Code Here

public class StyleRenderer extends RendererBase {

  public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);
    final UIStyle styleComponent = (UIStyle) component;
    final String file = styleComponent.getFile();
    if (file != null) {
      FacesContextUtils.addStyleFile(facesContext, file);
    }
    final String style = styleComponent.getStyle();
    if (style != null) {
      FacesContextUtils.addStyleBlock(facesContext, style);
    }
  }
View Full Code Here

  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

TOP

Related Classes of org.apache.myfaces.tobago.component.UIStyle

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.