Package org.spdx.spreadsheetstore.ods
Class OdsCellStyle
java.lang.Object
org.spdx.spreadsheetstore.ods.OdsCellStyle
- All Implemented Interfaces:
org.apache.poi.ss.usermodel.CellStyle
Adapter for Apache POI
CellStyle over the SODS Style.
Manages borders, fonts, alignments, and backgrounds mapping for ODS cells.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloneStyleFrom(org.apache.poi.ss.usermodel.CellStyle source) org.apache.poi.ss.usermodel.HorizontalAlignmentorg.apache.poi.ss.usermodel.BorderStyleorg.apache.poi.ss.usermodel.BorderStyleorg.apache.poi.ss.usermodel.BorderStyleorg.apache.poi.ss.usermodel.BorderStyleshortshortshortorg.apache.poi.ss.usermodel.Colorshortorg.apache.poi.ss.usermodel.Colororg.apache.poi.ss.usermodel.FillPatternTypeintintbooleanshortshortgetIndex()shortbooleanbooleanshortshortbooleanshortorg.apache.poi.ss.usermodel.VerticalAlignmentbooleanvoidvoidsetAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment align) voidsetBorderBottom(org.apache.poi.ss.usermodel.BorderStyle border) voidsetBorderLeft(org.apache.poi.ss.usermodel.BorderStyle border) voidsetBorderRight(org.apache.poi.ss.usermodel.BorderStyle border) voidsetBorderTop(org.apache.poi.ss.usermodel.BorderStyle border) voidsetBottomBorderColor(short color) voidsetDataFormat(short fmt) Sets the data format for the cell.voidsetFillBackgroundColor(short bg) voidsetFillBackgroundColor(org.apache.poi.ss.usermodel.Color color) voidsetFillForegroundColor(short bg) voidsetFillForegroundColor(org.apache.poi.ss.usermodel.Color color) voidsetFillPattern(org.apache.poi.ss.usermodel.FillPatternType fp) voidsetFont(org.apache.poi.ss.usermodel.Font font) voidsetHidden(boolean hidden) voidsetIndention(short indent) voidsetLeftBorderColor(short color) voidsetLocked(boolean locked) voidsetQuotePrefixed(boolean quotePrefix) voidsetRightBorderColor(short color) voidsetRotation(short rotation) voidsetShrinkToFit(boolean shrinkToFit) voidsetTopBorderColor(short color) voidsetVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment align) voidsetWrapText(boolean wrapped)
-
Constructor Details
-
OdsCellStyle
Creates an ODS cell style adapter.- Parameters:
workbook- Parent ODS workbook.
-
-
Method Details
-
setAlignment
public void setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment align) - Specified by:
setAlignmentin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getAlignment
public org.apache.poi.ss.usermodel.HorizontalAlignment getAlignment()- Specified by:
getAlignmentin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setVerticalAlignment
public void setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment align) - Specified by:
setVerticalAlignmentin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getVerticalAlignment
public org.apache.poi.ss.usermodel.VerticalAlignment getVerticalAlignment()- Specified by:
getVerticalAlignmentin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setBorderBottom
public void setBorderBottom(org.apache.poi.ss.usermodel.BorderStyle border) - Specified by:
setBorderBottomin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getBorderBottom
public org.apache.poi.ss.usermodel.BorderStyle getBorderBottom()- Specified by:
getBorderBottomin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setBorderLeft
public void setBorderLeft(org.apache.poi.ss.usermodel.BorderStyle border) - Specified by:
setBorderLeftin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getBorderLeft
public org.apache.poi.ss.usermodel.BorderStyle getBorderLeft()- Specified by:
getBorderLeftin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setBorderRight
public void setBorderRight(org.apache.poi.ss.usermodel.BorderStyle border) - Specified by:
setBorderRightin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getBorderRight
public org.apache.poi.ss.usermodel.BorderStyle getBorderRight()- Specified by:
getBorderRightin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setBorderTop
public void setBorderTop(org.apache.poi.ss.usermodel.BorderStyle border) - Specified by:
setBorderTopin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getBorderTop
public org.apache.poi.ss.usermodel.BorderStyle getBorderTop()- Specified by:
getBorderTopin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setFillForegroundColor
public void setFillForegroundColor(short bg) - Specified by:
setFillForegroundColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFillForegroundColor
public short getFillForegroundColor()- Specified by:
getFillForegroundColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setFillPattern
public void setFillPattern(org.apache.poi.ss.usermodel.FillPatternType fp) - Specified by:
setFillPatternin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFillPattern
public org.apache.poi.ss.usermodel.FillPatternType getFillPattern()- Specified by:
getFillPatternin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setFont
public void setFont(org.apache.poi.ss.usermodel.Font font) - Specified by:
setFontin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setDataFormat
public void setDataFormat(short fmt) Sets the data format for the cell.Due to limitations in the underlying SODS library, exact POI data format patterns are not fully supported. If the provided format index corresponds to a recognized Date format, it will be mapped to the ISO date style ("YYYY-MM-DD") to ensure dates are properly displayed. Other formats are currently stored but may not affect the final ODS cell rendering.
This is display-only: the full
HH:mm:sstimestamp is still stored inoffice:date-valueand returned unchanged byCell.getDateCellValue(), even though time-inclusive formats render as date-only in spreadsheet applications.- Specified by:
setDataFormatin interfaceorg.apache.poi.ss.usermodel.CellStyle- Parameters:
fmt- the data format index
-
getDataFormat
public short getDataFormat()- Specified by:
getDataFormatin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setWrapText
public void setWrapText(boolean wrapped) - Specified by:
setWrapTextin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getWrapText
public boolean getWrapText()- Specified by:
getWrapTextin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFontIndex
public int getFontIndex()- Specified by:
getFontIndexin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFontIndexAsInt
public int getFontIndexAsInt()- Specified by:
getFontIndexAsIntin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getIndex
public short getIndex()- Specified by:
getIndexin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
cloneStyleFrom
public void cloneStyleFrom(org.apache.poi.ss.usermodel.CellStyle source) - Specified by:
cloneStyleFromin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setBottomBorderColor
public void setBottomBorderColor(short color) - Specified by:
setBottomBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getBottomBorderColor
public short getBottomBorderColor()- Specified by:
getBottomBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setLeftBorderColor
public void setLeftBorderColor(short color) - Specified by:
setLeftBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getLeftBorderColor
public short getLeftBorderColor()- Specified by:
getLeftBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setRightBorderColor
public void setRightBorderColor(short color) - Specified by:
setRightBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getRightBorderColor
public short getRightBorderColor()- Specified by:
getRightBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setTopBorderColor
public void setTopBorderColor(short color) - Specified by:
setTopBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getTopBorderColor
public short getTopBorderColor()- Specified by:
getTopBorderColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setFillBackgroundColor
public void setFillBackgroundColor(short bg) - Specified by:
setFillBackgroundColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFillBackgroundColor
public short getFillBackgroundColor()- Specified by:
getFillBackgroundColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setHidden
public void setHidden(boolean hidden) - Specified by:
setHiddenin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getHidden
public boolean getHidden()- Specified by:
getHiddenin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setLocked
public void setLocked(boolean locked) - Specified by:
setLockedin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getLocked
public boolean getLocked()- Specified by:
getLockedin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setQuotePrefixed
public void setQuotePrefixed(boolean quotePrefix) - Specified by:
setQuotePrefixedin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getQuotePrefixed
public boolean getQuotePrefixed()- Specified by:
getQuotePrefixedin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setIndention
public void setIndention(short indent) - Specified by:
setIndentionin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getIndention
public short getIndention()- Specified by:
getIndentionin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setRotation
public void setRotation(short rotation) - Specified by:
setRotationin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getRotation
public short getRotation()- Specified by:
getRotationin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getDataFormatString
- Specified by:
getDataFormatStringin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setShrinkToFit
public void setShrinkToFit(boolean shrinkToFit) - Specified by:
setShrinkToFitin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getShrinkToFit
public boolean getShrinkToFit()- Specified by:
getShrinkToFitin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
invalidateCachedProperties
public void invalidateCachedProperties()- Specified by:
invalidateCachedPropertiesin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFormatProperties
- Specified by:
getFormatPropertiesin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFillForegroundColorColor
public org.apache.poi.ss.usermodel.Color getFillForegroundColorColor()- Specified by:
getFillForegroundColorColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
getFillBackgroundColorColor
public org.apache.poi.ss.usermodel.Color getFillBackgroundColorColor()- Specified by:
getFillBackgroundColorColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setFillForegroundColor
public void setFillForegroundColor(org.apache.poi.ss.usermodel.Color color) - Specified by:
setFillForegroundColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-
setFillBackgroundColor
public void setFillBackgroundColor(org.apache.poi.ss.usermodel.Color color) - Specified by:
setFillBackgroundColorin interfaceorg.apache.poi.ss.usermodel.CellStyle
-