/** * Sets the format properties of the given style based on the given map. * * @param style cell style * @param workbook parent workbook * @param properties map of format properties (String -> Object) * @see #getFormatProperties(CellStyle) */ private static void setFormatProperties(CellStyle style, Workbook workbook, Map<String, Object> properties) { style.setAlignment(getHorizontalAlignment(properties, ALIGNMENT)); style.setVerticalAlignment(getVerticalAlignment(properties, VERTICAL_ALIGNMENT)); style.setBorderBottom(getBorderStyle(properties, BORDER_BOTTOM)); style.setBorderLeft(getBorderStyle(properties, BORDER_LEFT)); style.setBorderRight(getBorderStyle(properties, BORDER_RIGHT)); style.setBorderTop(getBorderStyle(properties, BORDER_TOP)); style.setBottomBorderColor(getShort(properties, BOTTOM_BORDER_COLOR)); style.setDataFormat(getShort(properties, DATA_FORMAT)); style.setFillPattern(getFillPattern(properties, FILL_PATTERN)); style.setFillForegroundColor(getShort(properties, FILL_FOREGROUND_COLOR)); style.setFillBackgroundColor(getShort(properties, FILL_BACKGROUND_COLOR)); style.setFont(workbook.getFontAt(getInt(properties, FONT))); style.setHidden(getBoolean(properties, HIDDEN)); style.setIndention(getShort(properties, INDENTION)); style.setLeftBorderColor(getShort(properties, LEFT_BORDER_COLOR)); style.setLocked(getBoolean(properties, LOCKED)); style.setRightBorderColor(getShort(properties, RIGHT_BORDER_COLOR)); style.setRotation(getShort(properties, ROTATION)); style.setTopBorderColor(getShort(properties, TOP_BORDER_COLOR)); style.setWrapText(getBoolean(properties, WRAP_TEXT)); }
/** * Sets the format properties of the given style based on the given map. * * @param style cell style * @param workbook parent workbook * @param properties map of format properties (String -> Object) * @see #getFormatProperties(CellStyle) */ private static void setFormatProperties(CellStyle style, Workbook workbook, Map<String, Object> properties) { style.setAlignment(getHorizontalAlignment(properties, ALIGNMENT)); style.setVerticalAlignment(getVerticalAlignment(properties, VERTICAL_ALIGNMENT)); style.setBorderBottom(getBorderStyle(properties, BORDER_BOTTOM)); style.setBorderLeft(getBorderStyle(properties, BORDER_LEFT)); style.setBorderRight(getBorderStyle(properties, BORDER_RIGHT)); style.setBorderTop(getBorderStyle(properties, BORDER_TOP)); style.setBottomBorderColor(getShort(properties, BOTTOM_BORDER_COLOR)); style.setDataFormat(getShort(properties, DATA_FORMAT)); style.setFillPattern(getFillPattern(properties, FILL_PATTERN)); style.setFillForegroundColor(getShort(properties, FILL_FOREGROUND_COLOR)); style.setFillBackgroundColor(getShort(properties, FILL_BACKGROUND_COLOR)); style.setFont(workbook.getFontAt(getInt(properties, FONT))); style.setHidden(getBoolean(properties, HIDDEN)); style.setIndention(getShort(properties, INDENTION)); style.setLeftBorderColor(getShort(properties, LEFT_BORDER_COLOR)); style.setLocked(getBoolean(properties, LOCKED)); style.setRightBorderColor(getShort(properties, RIGHT_BORDER_COLOR)); style.setRotation(getShort(properties, ROTATION)); style.setTopBorderColor(getShort(properties, TOP_BORDER_COLOR)); style.setWrapText(getBoolean(properties, WRAP_TEXT)); }