Package org.zkoss.zss.ui.impl

Examples of org.zkoss.zss.ui.impl.CellFormatHelper


    if (cell != null) {

      Format format = cell.getFormat();
      boolean wrap = false;
     
      CellFormatHelper cfh = new CellFormatHelper(sheet,row,col,_mergeMatrix);
      String st = cfh.getHtmlStyle();
      String ist = cfh.getInnerHtmlStyle();
      if (st != null && !"".equals(st)){
        jcell.setData("st", st);// style of text cell.
      }
      if (ist != null && !"".equals(ist)){
        jcell.setData("ist", ist);// inner style of text cell
      }
      if (format!=null && format.isTextWrap()){
        wrap = format.isTextWrap();
        jcell.setData("wrap", true);//warp
      }
      if (cfh.hasRightBorder()){
        jcell.setData("rbo",true);//right border, when processing text overflow, must take care this.
      }
     
      String txt = null;
      if (cell != null) {
        txt = cell.getText();
      }
     
      jcell.setData("txt", txt==null?"":Utils.escapeCellText(txt,wrap,wrap));
     
      TextHAlign textHAlign = cell.getTextHAlign();
      if (textHAlign != null) {
        if (textHAlign.equals(TextHAlign.RIGHT)) {
          jcell.setData("hal","r");
        } else if (textHAlign.equals(TextHAlign.CENTER)) {
          jcell.setData("hal","c");
        }
      }
     
     
    }else{
      jcell.setData("txt", "");
      CellFormatHelper cfh = new CellFormatHelper(sheet,row,col,_ctrl.getMergeMatrixHelper(sheet));
      String st = cfh.getHtmlStyle();
      String ist = cfh.getInnerHtmlStyle();
      if (st != null && !"".equals(st)){
        jcell.setData("st", st);// style of text cell.
      }
      if (ist != null && !"".equals(ist)){
        jcell.setData("ist", ist);// inner style of text cell
      }
      if (cfh.hasRightBorder()){
        jcell.setData("rbo",true);//format
      }
    }
   
    MergedRect rect = _mergeMatrix.getMergeRange(row, col);
View Full Code Here


      appendMergeSClass(sb,row,col);
      sb.append("\" ");
     
     
     
      CellFormatHelper cfh = new CellFormatHelper(sheet,row,col,getMergeMatrixHelper(sheet));
      HTMLs.appendAttribute(sb, "style", cfh.getHtmlStyle());
     
      HTMLs.appendAttribute(sb, "z.r",row);
      HTMLs.appendAttribute(sb, "z.c", col);
      if(zsw>=0){
        HTMLs.appendAttribute(sb, "z.zsw",zsw);
      }
      if(zsh>=0){
        HTMLs.appendAttribute(sb, "z.zsh",zsh);
      }
       
     
      if(cell!=null){
        Format format = cell.getFormat();
        if(format != null && format.isTextWrap()){
          HTMLs.appendAttribute(sb, "z.wrap", "t");
        }
       
        TextHAlign textHAlign = cell.getTextHAlign();
        if (textHAlign != null) {
          if (textHAlign.equals(TextHAlign.RIGHT)) {
            HTMLs.appendAttribute(sb, "z.hal", "r");
          } else if (textHAlign.equals(TextHAlign.CENTER)) {
            HTMLs.appendAttribute(sb, "z.hal", "c");
          }
        }
       
        if (cfh.hasRightBorder()){
          HTMLs.appendAttribute(sb, "z.rbo", "t");
        }
      }
     
      MergedRect block;
View Full Code Here

        sb.append(" zshi").append(meta[2]);
      }
      sb.append("\" ");
     
     
      CellFormatHelper cfh = new CellFormatHelper(sheet,row,col,getMergeMatrixHelper(sheet));
      HTMLs.appendAttribute(sb, "style", cfh.getInnerHtmlStyle());
     
      if(cell!=null){
        //no thing to do now.
      }
      return sb.toString();
View Full Code Here

        result.setData("type", "udcell");
       
        Format format = (cell==null)?null:cell.getFormat();
        boolean wrap = false;
       
        CellFormatHelper cfh = new CellFormatHelper(sheet,row,col,getMergeMatrixHelper(sheet));
        String st = cfh.getHtmlStyle();
        String ist = cfh.getInnerHtmlStyle();
        if (st != null && !"".equals(st)){
          result.setData("st", st);// style of text cell.
        }
        if (ist != null && !"".equals(ist)){
          result.setData("ist", ist);// inner style of text cell
        }
        if (format!=null && format.isTextWrap()){
          wrap = true;
          result.setData("wrap", true);
        }
        if (cfh.hasRightBorder()){
          result.setData("rbo",true);
        }
        TextHAlign textHAlign = (cell==null)?null:cell.getTextHAlign();
        if (textHAlign != null) {
          if (textHAlign.equals(TextHAlign.RIGHT)) {
View Full Code Here

        }
      }
     
      //style attr
      if (updateStyle) {
        CellFormatHelper cfh = new CellFormatHelper(sheet, row, col, getMergeMatrixHelper(sheet));
        String style = cfh.getHtmlStyle();
        if (!Strings.isEmpty(style)) {
          int idx = styleAggregation.add(style);
          attrs.put("s", idx);
        }
        String innerStyle = cfh.getInnerHtmlStyle();
        if (!Strings.isEmpty(innerStyle)) {
          int idx = styleAggregation.add(innerStyle);
          attrs.put("is", idx);
        }
        if (cfh.hasRightBorder()) {
          attrs.put("rb", 1);
        }
      }
     
      if (cell != null) {
View Full Code Here

TOP

Related Classes of org.zkoss.zss.ui.impl.CellFormatHelper

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.