Class ColumnHelper
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.helpers.ColumnHelper
-
public class ColumnHelper extends java.lang.ObjectHelper class for dealing with the Column settings on a CTWorksheet (the data part of a sheet). Note - within POI, we use 0 based column indexes, but the column definitions in the XML are 1 based!
-
-
Constructor Summary
Constructors Constructor Description ColumnHelper(CTWorksheet worksheet)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CTColsaddCleanColIntoCols(CTCols cols, CTCol newCol)voidcleanColumns()CTColcloneCol(CTCols cols, CTCol col)booleancolumnExists(CTCols cols, long index)Does the column at the given 0 based index exist in the supplied list of column definitions?intgetColDefaultStyle(long index)CTColgetColumn(long index, boolean splitColumns)Returns the Column at the given 0 based indexCTColgetColumn1Based(long index1, boolean splitColumns)Returns the Column at the given 1 based index.intgetIndexOfColumn(CTCols cols, CTCol searchCol)voidsetColBestFit(long index, boolean bestFit)voidsetColDefaultStyle(long index, int styleId)voidsetColDefaultStyle(long index, CellStyle style)voidsetColHidden(long index, boolean hidden)voidsetColumnAttributes(CTCol fromCol, CTCol toCol)voidsetColWidth(long index, double width)voidsetCustomWidth(long index, boolean bestFit)static voidsortColumns(CTCols newCols)
-
-
-
Constructor Detail
-
ColumnHelper
public ColumnHelper(CTWorksheet worksheet)
-
-
Method Detail
-
cleanColumns
public void cleanColumns()
-
sortColumns
public static void sortColumns(CTCols newCols)
-
getColumn
public CTCol getColumn(long index, boolean splitColumns)
Returns the Column at the given 0 based index
-
getColumn1Based
public CTCol getColumn1Based(long index1, boolean splitColumns)
Returns the Column at the given 1 based index. POI default is 0 based, but the file stores as 1 based.
-
columnExists
public boolean columnExists(CTCols cols, long index)
Does the column at the given 0 based index exist in the supplied list of column definitions?
-
setColBestFit
public void setColBestFit(long index, boolean bestFit)
-
setCustomWidth
public void setCustomWidth(long index, boolean bestFit)
-
setColWidth
public void setColWidth(long index, double width)
-
setColHidden
public void setColHidden(long index, boolean hidden)
-
setColDefaultStyle
public void setColDefaultStyle(long index, CellStyle style)
-
setColDefaultStyle
public void setColDefaultStyle(long index, int styleId)
-
getColDefaultStyle
public int getColDefaultStyle(long index)
-
-