Package org.ajax4jsf.util

Examples of org.ajax4jsf.util.Zipper2


  protected Object getDataToStore(FacesContext context, Object data){
   
    byte [] ret = new byte[6];
     
    Color color = null;
    Zipper2 zipper = new Zipper2(ret);
       
    color = HtmlColor.decode(ICON_COLOR);
    zipper.addColor(color);
   
    color = HtmlColor.decode(ICON_BORDER);
    zipper.addColor(color);
     
    return ret;
  }
View Full Code Here


   private GradientAlignment gradientAlignment;

   public byte[] toByteArray() {
       if (baseColor != null && gradientColor != null && gradientHeight != null && gradientAlignment != null && gradientType != null) {
     byte[] ret = new byte[12];
     new Zipper2(ret)
       .addByte((byte) gradientType.ordinal())
       .addByte((byte) gradientAlignment.ordinal())
       .addInt(gradientHeight.intValue())
       .addColor(baseColor.intValue())
       .addColor(gradientColor.intValue());
View Full Code Here

    }

    protected Object deserializeData(byte[] objectArray) {
  Data data = createData();
  if (objectArray != null) {
      Zipper2 zipper2 = new Zipper2(objectArray);
      restoreData(data, zipper2);
  }

  return data;
    }
View Full Code Here

   private GradientType gradientType;

   public byte[] toByteArray() {
       if (headerBackgroundColor != null && headerGradientColor != null && gradientType != null) {
     byte[] ret = new byte[7];
     new Zipper2(ret).addColor(headerBackgroundColor.intValue()).addColor(headerGradientColor.intValue()).
     addByte((byte) gradientType.ordinal());
     return ret;
       } else {
     return null;
       }
View Full Code Here

    Skin defaultSkin = skinFactory.getDefaultSkin(context);
   
    byte [] ret = new byte[6];
   
    Color color = null;
    Zipper2 zipper = new Zipper2(ret);
   
    String color1 = getParameterValue(context, skin, defaultSkin,
        iconColorParam,
        defaultIconColorParam);
   
    color = HtmlColor.decode(color1);
   
    zipper.addColor(color);
   
    String color2 = getParameterValue(context, skin, defaultSkin,
        borderColorParam,
        defaultBorderColorParam);
   
    color = HtmlColor.decode(color2);
    zipper.addColor(color);
   
    return ret;
  }
View Full Code Here

  protected Object deserializeData(byte[] objectArray) {
    if (objectArray == null) {
      return null;
    }
   
    Zipper2 zipper = new Zipper2(objectArray);
   
    return new Color[] {zipper.nextColor(), zipper.nextColor()};
  }
View Full Code Here

 
  protected Object deserializeData(byte[] objectArray) {
    if (objectArray == null) {
      return null;
    }
    Zipper2 zipper = new Zipper2(objectArray);
    return new Color[] {zipper.nextColor()};
 
View Full Code Here

  protected Object getDataToStore(FacesContext context, Object data){
   
    byte [] ret = new byte[3];
     
    Color color = null;
    Zipper2 zipper = new Zipper2(ret);
       
    color = HtmlColor.decode(ICON_COLOR);
    zipper.addColor(color);
     
    return ret;
  }
View Full Code Here

 
  protected Object deserializeData(byte[] objectArray) {
    if (objectArray == null) {
      return null;
    }
    Zipper2 zipper = new Zipper2(objectArray);
    return new Color[] {zipper.nextColor(), zipper.nextColor()};
  }
View Full Code Here

  }
 
  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);

    return ret;
  }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.util.Zipper2

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.