Package org.zkoss.poi.ss.usermodel

Examples of org.zkoss.poi.ss.usermodel.CellStyle


    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final boolean textWrap = cell.getCellStyle().getWrapText();
    if (wrap == textWrap) { //no change, skip
      return;
    }
    final CellStyle style = cloneCellStyle(cell);
    style.setWrapText(wrap);
    cell.setCellStyle(style);
  }
View Full Code Here


    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, (short)fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

    final String name = font.getFontName();
    final boolean italic = font.getItalic();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

  public static void setBorderRight(Worksheet sheet,int row,int col,String color, short linestyle){
    setBorder(sheet,row,col, BookHelper.HTMLToColor(sheet.getWorkbook(), color), linestyle, 0x2);
  }
  public static void setBorder(Worksheet sheet,int row,int col, short color, short lineStyle, int at){
    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final CellStyle style = cloneCellStyle(cell);
    if((at & BookHelper.BORDER_EDGE_LEFT)!=0) {
      style.setBorderLeft(lineStyle);
    }
    if((at & BookHelper.BORDER_EDGE_TOP)!=0){
      style.setTopBorderColor(color);
      style.setBorderTop(lineStyle);
    }
    if((at & BookHelper.BORDER_EDGE_RIGHT)!=0){
      style.setRightBorderColor(color);
      style.setBorderRight(lineStyle);
    }
    if((at & BookHelper.BORDER_EDGE_BOTTOM)!=0){
      style.setBottomBorderColor(color);
      style.setBorderBottom(lineStyle);
    }
    cell.setCellStyle(style);
  }
View Full Code Here

    cell.setCellStyle(style);
  }
 
  public static void setBorder(Worksheet sheet,int row,int col, Color color, short lineStyle, int at){
    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final CellStyle style = cloneCellStyle(cell);
    if((at & BookHelper.BORDER_EDGE_LEFT)!=0) {
      BookHelper.setLeftBorderColor(style, color);
      style.setBorderLeft(lineStyle);
    }
    if((at & BookHelper.BORDER_EDGE_TOP)!=0){
      BookHelper.setTopBorderColor(style, color);
      style.setBorderTop(lineStyle);
    }
    if((at & BookHelper.BORDER_EDGE_RIGHT)!=0){
      BookHelper.setRightBorderColor(style, color);
      style.setBorderRight(lineStyle);
    }
    if((at & BookHelper.BORDER_EDGE_BOTTOM)!=0){
      BookHelper.setBottomBorderColor(style, color);
      style.setBorderBottom(lineStyle);
    }
    cell.setCellStyle(style);
  }
View Full Code Here

    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

    final String name = font.getFontName();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

    final String name = font.getFontName();
    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final short orgAlign = cell.getCellStyle().getAlignment();
    if (align == orgAlign) { //no change, skip
      return;
    }
    final CellStyle style = cloneCellStyle(cell);
    style.setAlignment(align);
    cell.setCellStyle(style);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.usermodel.CellStyle

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.