Package org.richfaces.skin

Examples of org.richfaces.skin.Skin


    Zipper2 zipper = new Zipper2(objectArray);
    return new Color[] {zipper.nextColor(), zipper.nextColor()};
  }
 
  protected Object getDataToStore(FacesContext context, Object data) {
    Skin skin = SkinFactory.getInstance().getSkin(context);
    byte[] ret = new byte[6];
    Zipper2 zipper = new Zipper2(ret);
   
    String skinParameterTextColor = "generalTextColor";
    String generalTextColor = (String) skin.getParameter(context, skinParameterTextColor);
    if (null == generalTextColor || "".equals(generalTextColor)) {
      Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
      generalTextColor = (String) defaultSkin.getParameter(context, skinParameterTextColor);
    }
     
    Integer color = HtmlColor.decode( generalTextColor == null ? "#000000":generalTextColor ).getRGB();
     
    zipper.addColor(color);
   
    String skinParameterBackgroundColor = "controlBackgroundColor";
    String generalBackgroundColor = (String) skin.getParameter(context, skinParameterBackgroundColor);
   
    if (null == generalBackgroundColor || "".equals(generalBackgroundColor)) {
      Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
      generalBackgroundColor = (String) defaultSkin.getParameter(context, skinParameterBackgroundColor);
    }
   
    color = HtmlColor.decode( generalTextColor == null ? "#FFFFFF":generalBackgroundColor ).getRGB();
    zipper.addColor(color);
View Full Code Here


    return storeData(context, ICON_COLOR, BACKGROUND_COLOR, BORDER_COLOR);
  }
 
  protected Object storeData(FacesContext context, String colorSkinParam, String backgroundSkinParam, String borderSkinParam) {
   
    Skin skin = SkinFactory.getInstance().getSkin(context);
    Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
     
    byte [] ret = new byte[9];
     
    Color color = null;
    Zipper2 zipper = new Zipper2(ret);
     
    String color1 = (String) skin.getParameter(context, colorSkinParam);
   
    if (null == color1 || "".equals(color1)) {
      color1 = (String) defaultSkin.getParameter(context, colorSkinParam);
   
     
    if (color1 == null) {
      color1 = "#FFFFFF";
    }
     
    color = HtmlColor.decode(color1);
     
    zipper.addColor(color);
     
    String color2 = (String) skin.getParameter(context, backgroundSkinParam);
    if (null == color2 || "".equals(color2))
      color2 = (String) defaultSkin.getParameter(context, backgroundSkinParam);
     
    if (color2 == null) {
      color2 = "#000000";
    }
     
    color = HtmlColor.decode(color2);
    zipper.addColor(color);
     
    String color3 = (String) skin.getParameter(context, borderSkinParam);
    if (null == color3 || "".equals(color3))
      color3 = (String) defaultSkin.getParameter(context, backgroundSkinParam);
     
    if (color3 == null) {
      color3 = "#000000";
    }
     
View Full Code Here

        }
    }

    protected final Integer getHeight(FacesContext context, String heightParamName) {
        SkinFactory skinFactory = SkinFactory.getInstance();
        Skin skin = skinFactory.getSkin(context);

        String height = (String) skin.getParameter(context, heightParamName);
        if (height == null || height.length() == 0) {
            skin = skinFactory.getDefaultSkin(context);
            height = (String) skin.getParameter(context, heightParamName);
        }

        if (height != null && height.length() != 0) {
            return Integer.valueOf(HtmlDimensions.decode(height).intValue());
        } else {
View Full Code Here

    }

    protected String getValueParameter(FacesContext context, String name) {
  SkinFactory skinFactory = SkinFactory.getInstance();

  Skin skin = skinFactory.getSkin(context);
  String value = (String) skin.getParameter(context, name);

  if (value == null || value.length() == 0) {
      skin = skinFactory.getDefaultSkin(context);
      value = (String) skin.getParameter(context, name);
  }

  return value;
    }
View Full Code Here

    }

    String skinStyleSheetUri = null;
    String skinExtendedStyleSheetUri = null;

    Skin skin = null;
    try {
      skin = SkinFactory.getInstance().getSkin(context);
      // For a "NULL" skin, do not collect components stylesheets
      if ("false".equals(skin.getParameter(context,
          Skin.loadStyleSheets))) {
        processStyles = false;
      }
      // Set default style sheet for current skin.
      skinStyleSheetUri = (String) skin.getParameter(context,
          Skin.generalStyleSheet);
      // Set default style sheet for current skin.
      skinExtendedStyleSheetUri = (String) skin.getParameter(context,
          Skin.extendedStyleSheet);
    } catch (SkinNotFoundException e) {
      if (log.isWarnEnabled()) {
        log.warn("Current Skin is not found", e);
      }
View Full Code Here

  /* (non-Javadoc)
   * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, java.lang.Object)
   */
  public Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException {
    if (base instanceof Skin) {
      Skin skin = (Skin) base;
      if(property instanceof String){
        return skin.getParameter(FacesContext.getCurrentInstance(),(String) property).getClass();
      }
      if(log.isDebugEnabled()){
        log.debug(Messages.getMessage(Messages.ACESSING_SKIN_PROPERTY_ERROR));
      }
      return null;
View Full Code Here

  /* (non-Javadoc)
   * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, java.lang.Object)
   */
  public Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException {
    if (base instanceof Skin) {
      Skin skin = (Skin) base;
      if(property instanceof String){
        return skin.getParameter(FacesContext.getCurrentInstance(),(String) property);
      }
      if(log.isDebugEnabled()){
        log.debug(Messages.getMessage(Messages.ACESSING_SKIN_PROPERTY_ERROR));
      }
      return null;
View Full Code Here

                                     final UIComponent component) {
        String opacity = (String) component.getAttributes().get("shadowOpacity");
        String filterOpacity;

        if (null == opacity) {
            Skin skin = SkinFactory.getInstance().getSkin(context);
            opacity = (String) skin.getParameter(context, "shadowOpacity");
        }
        try {
            Double op = Double.valueOf(opacity);
            filterOpacity = Integer.toString(op.intValue() * 10);
            opacity = Double.toString(op.doubleValue() / 10);
View Full Code Here

              .debug("Process component tree for collect used scripts and styles");
        }
        UIViewRoot root = context.getViewRoot();
        ViewResources viewResources = new ViewResources();
        try {
          Skin skin = SkinFactory.getInstance().getSkin(
              context);
          // Set default style sheet for current skin.
          String styleSheetUri = (String) skin.getParameter(context,
              Skin.generalStyleSheet);
          if(null != styleSheetUri){
            String resourceURL = context.getApplication()
            .getViewHandler().getResourceURL(context,
                styleSheetUri);
            viewResources.addStyle(resourceURL);
          }
          // For a "NULL" skin, do not collect components stylesheets
          if("false".equals(skin.getParameter(context, Skin.loadStyleSheets))){
            viewResources.setProcessStyles(false);
          }
        } catch (SkinNotFoundException e) {
          log.warn("Current Skin is not found", e);
        }
View Full Code Here

                                     final UIComponent component) {
        String opacity = (String) component.getAttributes().get("shadowOpacity");
        String filterOpacity;

        if (null == opacity) {
            Skin skin = SkinFactory.getInstance().getSkin(context);
            opacity = (String) skin.getParameter(context, "shadowOpacity");
        }
        try {
            Double op = Double.valueOf(opacity);
            filterOpacity = Integer.toString(op.intValue() * 10);
            opacity = Double.toString(op.doubleValue() / 10);
View Full Code Here

TOP

Related Classes of org.richfaces.skin.Skin

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.