Package org.zkoss.poi.ss.usermodel

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


            }
                if (srcCells != null) {
              for(Entry<Integer, Cell> cellEntry : srcCells.entrySet()) {
                final int colnum = cellEntry.getKey().intValue();
                final Cell srcCell = cellEntry.getValue();
                final CellStyle cellStyle = srcCell.getCellStyle();
                Cell dstCell = row.getCell(colnum);
                if (dstCell == null) {
                  dstCell = row.createCell(colnum);
                }
                dstCell.setCellStyle(BookHelper.copyFromStyleExceptBorder(getBook(), cellStyle));
View Full Code Here


      public void handle(CellVisitorContext context) {
        Font srcFont = context.getFont();
        Font font = context.getOrCreateFont(boldWeight, color,
            fontHeight, fontName, italic, strikeout, typeOffset, underline);
        if (!srcFont.equals(font)) {
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(font);
          context.getRange().setStyle(newStyle);
        }
      }});
  }
View Full Code Here

          Font srcFont = context.getFont();

          Color fontColor = BookHelper.HTMLToColor(book, color);
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(), fontColor, srcFont.getFontHeight(), srcFont.getFontName(),
              srcFont.getItalic(), srcFont.getStrikeout(), srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          newStyle.setFontColorColor(fontColor);
          context.getRange().setStyle(newStyle);
        }
      }});
  }
View Full Code Here

        if (srcFontName != fontName) {
          final Workbook book = sheet.getWorkbook();
          Font srcFont = context.getFont();
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(), BookHelper.getFontColor(book, srcFont), srcFont.getFontHeight(), fontName,
              srcFont.getItalic(), srcFont.getStrikeout(), srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          context.getRange().setStyle(newStyle);
        }
      }
    });
  }
View Full Code Here

        if (srcFontHgh != fontHeight) {
          final Workbook book = sheet.getWorkbook();
          Font srcFont = context.getFont();
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(), BookHelper.getFontColor(book, srcFont), fontHeight, srcFont.getFontName(),
            srcFont.getItalic(), srcFont.getStrikeout(), srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          context.getRange().setStyle(newStyle);
        }
      }});
  }
View Full Code Here

        if (srcBold != isBold) {
          final Workbook book = sheet.getWorkbook();
          Font srcFont = context.getFont();
          Font newFont = context.getOrCreateFont(isBold ? Font.BOLDWEIGHT_BOLD : Font.BOLDWEIGHT_NORMAL, BookHelper.getFontColor(book, srcFont), srcFont.getFontHeight(), srcFont.getFontName(),
              srcFont.getItalic(), srcFont.getStrikeout(), srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          context.getRange().setStyle(newStyle);
        }
      }});
  }
View Full Code Here

        if (srcItalic != isItalic) {
          final Workbook book = sheet.getWorkbook();
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(), BookHelper.getFontColor(book, srcFont), srcFont.getFontHeight(), srcFont.getFontName(),
              isItalic, srcFont.getStrikeout(), srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          context.getRange().setStyle(newStyle);
        }
      }});
  }
View Full Code Here

        if (srcUnderline != underline) {
          final Workbook book = sheet.getWorkbook();
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(), BookHelper.getFontColor(book, srcFont),
            srcFont.getFontHeight(), srcFont.getFontName(),
            srcFont.getItalic(), srcFont.getStrikeout(), srcFont.getTypeOffset(), underline);
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          context.getRange().setStyle(newStyle);
        }
      } 
    });
  }
View Full Code Here

        if (srcStrikeout != isStrikeout) {
          final Workbook book = sheet.getWorkbook();
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(),
              BookHelper.getFontColor(book, srcFont), srcFont.getFontHeight(), srcFont.getFontName(),
              srcFont.getItalic(), isStrikeout, srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle cellStyle = context.cloneCellStyle();
          cellStyle.setFont(newFont);
          context.getRange().setStyle(cellStyle);
        }
      }});
  }
View Full Code Here

      @Override
      public void handle(CellVisitorContext context) {
        final short srcAlign = context.getAlignment();

        if (srcAlign != alignment) {
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setAlignment(alignment);
          context.getRange().setStyle(newStyle);
        }
      }});
  }
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.