Class ExcelAutoColumnSizer
java.lang.Object
io.jmix.gridexportflowui.exporter.excel.ExcelAutoColumnSizer
Calculates the width of a column, based on the values within it.
For each new value added to the column, call isNotificationRequired(int)
.
If the result is true, call notifyCellValue(java.lang.String, org.apache.poi.ss.usermodel.Font)
.
-
Field Summary
Modifier and TypeFieldDescriptionprotected short
protected Map<Short,
FontMetrics> Maps a Short (HSSF font index) to a FontMetrics objectprotected Graphics2D
Graphics context used for obtaining FontMetrics objectsprotected static final int[]
protected static final int[]
protected static final short
protected static final short
protected static final short
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
protected FontMetrics
getFontMetrics
(org.apache.poi.ss.usermodel.Font hf) short
getWidth()
boolean
isNotificationRequired
(int row) When you add a new value to a column, call this method to ask whether the AutoColumnSizer is interested in it.void
notifyCellValue
(String val, org.apache.poi.ss.usermodel.Font font)
-
Field Details
-
WIDTH_MIN
protected static final short WIDTH_MIN- See Also:
-
WIDTH_MAX
protected static final short WIDTH_MAX- See Also:
-
WIDTH_PADDING
protected static final short WIDTH_PADDING- See Also:
-
ROW_BAND
protected static final int[] ROW_BAND -
ROW_BAND_SAMPLE_FREQUENCY
protected static final int[] ROW_BAND_SAMPLE_FREQUENCY -
graphics
Graphics context used for obtaining FontMetrics objects -
fontMetrics
Maps a Short (HSSF font index) to a FontMetrics object -
currentWidth
protected short currentWidth
-
-
Constructor Details
-
ExcelAutoColumnSizer
public ExcelAutoColumnSizer()
-
-
Method Details
-
getFontMetrics
-
isNotificationRequired
public boolean isNotificationRequired(int row) When you add a new value to a column, call this method to ask whether the AutoColumnSizer is interested in it. -
notifyCellValue
-
getWidth
public short getWidth() -
dispose
public void dispose()
-