Example #1
0
    public StyleVO(HSSFCellStyle style, Workbook workbook) {
      alignment = style.getAlignment();
      borderBottom = style.getBorderBottom();
      borderLeft = style.getBorderLeft();
      borderRight = style.getBorderRight();
      borderTop = style.getBorderTop();
      bottomBorderColor = style.getBottomBorderColor();
      dataFormat = style.getDataFormat();
      fillBackgroundColor = style.getFillBackgroundColor();
      fillForegroundColor = style.getFillForegroundColor();
      fillPattern = style.getFillPattern();
      fontIndex = style.getFontIndex();

      hidden = style.getHidden();
      indention = style.getIndention();
      leftBorderColor = style.getLeftBorderColor();
      locked = style.getLocked();
      rightBorderColor = style.getRightBorderColor();
      rotation = style.getRotation();
      topBorderColor = style.getTopBorderColor();
      verticalAlignment = style.getVerticalAlignment();
      wrapText = style.getWrapText();

      fontVal = new FontVO(style.getFont(workbook));
    }
Example #2
0
 /**
  * Создает новый стиль в документе Excel который полностью копирует свойства некоторого исходного
  * стиля этого же документа. Данный метод используется для того чтобы в последствии поменять в
  * новом стиле один или несколько свойств не затрагивая при этом свойства исходного стиля.
  *
  * @param wb документ Excel.
  * @param src стиль ячейки взятый в качестве шаблона.
  * @return созданная копия исходного стиля в этом же документе.
  */
 public static HSSFCellStyle copyStyle(final HSSFWorkbook wb, final HSSFCellStyle src) {
   final HSSFCellStyle dst = wb.createCellStyle();
   dst.setAlignment(src.getAlignment());
   dst.setBorderBottom(src.getBorderBottom());
   dst.setBorderLeft(src.getBorderLeft());
   dst.setBorderRight(src.getBorderRight());
   dst.setBorderTop(src.getBorderTop());
   dst.setBottomBorderColor(src.getBottomBorderColor());
   dst.setDataFormat(src.getDataFormat());
   dst.setFillForegroundColor(src.getFillForegroundColor());
   dst.setFillBackgroundColor(src.getFillBackgroundColor());
   dst.setFillPattern(src.getFillPattern());
   dst.setFont(src.getFont(wb));
   dst.setHidden(src.getHidden());
   dst.setIndention(src.getIndention());
   dst.setLeftBorderColor(src.getLeftBorderColor());
   dst.setLocked(src.getLocked());
   dst.setRightBorderColor(src.getRightBorderColor());
   dst.setRotation(src.getRotation());
   dst.setTopBorderColor(src.getTopBorderColor());
   dst.setVerticalAlignment(src.getVerticalAlignment());
   dst.setWrapText(src.getWrapText());
   return dst;
 }