Namespace EasyXLS
Class ExcelAutoFormat
System.Object
EasyXLS.ExcelAutoFormat
public class ExcelAutoFormat
extends System.Object
This class stores the table autoformat information like font name, font size, font bold, font italic, word wrap,
font underline style, font subscript, font superscript, font strikethrough, background color,
foreground color, horizontal alignment, vertical alignment, number or date format,
cell locked or hidden, shrink, border type, border color.
A table autoformat can be applied to a range of cells.
-
Constructor Summary
ConstructorsConstructorDescriptionDefines a table autoformat that is initialized with the default style.ExcelAutoFormat(int autoformat) Defines a table autoformat that is one of the predefined autoformats.ExcelAutoFormat(ExcelAutoFormat xlsAutoFormat) Defines a table autoformat based on a predefined autoformat.ExcelAutoFormat(ExcelStyle xlsStyleTable) Defines a table autoformat that is initialized with a specific style.ExcelAutoFormat(ExcelStyle xlsStyleTable, ExcelStyle xlsStyleTableHeaderRow, ExcelStyle xlsStyleTableFooterRow) Defines a table autoformat that is initialized with a specific style and has a specific header row and footer row style.ExcelAutoFormat(ExcelStyle xlsStyleEvenRowStripes, ExcelStyle xlsStyleOddRowStripes, ExcelStyle xlsStyleTableHeaderRow, ExcelStyle xlsStyleTableFooterRow) Defines a table autoformat that is initialized with a specific striped style and has a specific header row and footer row style. -
Method Summary
Modifier and TypeMethodDescriptionClone()Creates and returns a copy of this object.intReturns the type of this autoformat.Returns the style applied to the bottom left cell.Returns the style applied to the bottom right cell.Returns the style applied to the even columns.Returns the style applied to the even rows.Returns the style applied to the footer row.Returns the style applied to the header row.Returns the style applied to the left column.Returns the style applied to the odd columns.Returns the style applied to the odd rows.Returns the style applied to the right column.Returns the style applied to the table.Returns the style applied to the top left cell.Returns the style applied to the top right cell.voidInitAs(int autoformat) Initializes the table autoformat that is one of the predefined autoformats.voidsetBottomLeftCellStyle(ExcelStyle xlsStyle) Sets the style of the bottom left cell.voidsetBottomRightCellStyle(ExcelStyle xlsStyle) Sets the style of the bottom right cell.voidsetEvenColumnStripesStyle(ExcelStyle xlsStyle) Sets the style of the even columns.voidsetEvenRowStripesStyle(ExcelStyle xlsStyle) Sets the style of the even rows.voidsetFooterRowStyle(ExcelStyle xlsStyle) Sets the style of the footer row.voidsetHeaderRowStyle(ExcelStyle xlsStyle) Sets the style of the header row.voidsetLeftColumnStyle(ExcelStyle xlsStyle) Sets the style of the left column.voidsetOddColumnStripesStyle(ExcelStyle xlsStyle) Sets the style of the odd columns.voidsetOddRowStripesStyle(ExcelStyle xlsStyle) Sets the style of the odd rows.voidsetRightColumnStyle(ExcelStyle xlsStyle) Sets the style of the right column.voidsetTableStyle(ExcelStyle xlsStyle) Sets the style of the table.voidsetTopLeftCellStyle(ExcelStyle xlsStyle) Sets the style of the top left cell.voidsetTopRightCellStyle(ExcelStyle xlsStyle) Sets the style of the top right cell.Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExcelAutoFormat
public ExcelAutoFormat()Defines a table autoformat that is initialized with the default style. -
ExcelAutoFormat
public ExcelAutoFormat(int autoformat) Defines a table autoformat that is one of the predefined autoformats.- Parameters:
autoformat- the predefined autoformat. Possible values are available inStylesclass.
-
ExcelAutoFormat
Defines a table autoformat that is initialized with a specific style.- Parameters:
xlsStyleTable- the style applied to the table
-
ExcelAutoFormat
public ExcelAutoFormat(ExcelStyle xlsStyleTable, ExcelStyle xlsStyleTableHeaderRow, ExcelStyle xlsStyleTableFooterRow) Defines a table autoformat that is initialized with a specific style and has a specific header row and footer row style.- Parameters:
xlsStyleTable- the style applied to the tablexlsStyleTableHeaderRow- the style applied to the header rowxlsStyleTableFooterRow- the style applied to the footer row
-
ExcelAutoFormat
public ExcelAutoFormat(ExcelStyle xlsStyleEvenRowStripes, ExcelStyle xlsStyleOddRowStripes, ExcelStyle xlsStyleTableHeaderRow, ExcelStyle xlsStyleTableFooterRow) Defines a table autoformat that is initialized with a specific striped style and has a specific header row and footer row style.- Parameters:
xlsStyleEvenRowStripes- the style applied to the even rowsxlsStyleOddRowStripes- the style applied to the odd rowsxlsStyleTableHeaderRow- the style applied to the header rowxlsStyleTableFooterRow- the style applied to the footer row
-
ExcelAutoFormat
Defines a table autoformat based on a predefined autoformat.- Parameters:
xlsAutoFormat- the table autoformat
-
-
Method Details
-
setTableStyle
Sets the style of the table.- Parameters:
xlsStyle- the style applied to the table- See Also:
-
getTableStyle
Returns the style applied to the table.- Returns:
- the style applied to the table
- See Also:
-
setHeaderRowStyle
Sets the style of the header row.- Parameters:
xlsStyle- the style applied to the header row- See Also:
-
getHeaderRowStyle
Returns the style applied to the header row.- Returns:
- the style applied to the header row
- See Also:
-
setLeftColumnStyle
Sets the style of the left column.- Parameters:
xlsStyle- the style applied to the left column- See Also:
-
getLeftColumnStyle
Returns the style applied to the left column.- Returns:
- the style applied to the left column
- See Also:
-
setRightColumnStyle
Sets the style of the right column.- Parameters:
xlsStyle- the style applied to the right column- See Also:
-
getRightColumnStyle
Returns the style applied to the right column.- Returns:
- the style applied to the right column
- See Also:
-
setTopLeftCellStyle
Sets the style of the top left cell.- Parameters:
xlsStyle- the style applied to the top left cell- See Also:
-
getTopLeftCellStyle
Returns the style applied to the top left cell.- Returns:
- the style applied to the top left cell
- See Also:
-
setTopRightCellStyle
Sets the style of the top right cell.- Parameters:
xlsStyle- the style applied to the top right cell- See Also:
-
getTopRightCellStyle
Returns the style applied to the top right cell.- Returns:
- the style applied to the top right cell
- See Also:
-
setBottomLeftCellStyle
Sets the style of the bottom left cell.- Parameters:
xlsStyle- the style applied to the bottom left cell- See Also:
-
getBottomLeftCellStyle
Returns the style applied to the bottom left cell.- Returns:
- the style applied to the bottom left cell
- See Also:
-
setBottomRightCellStyle
Sets the style of the bottom right cell.- Parameters:
xlsStyle- the style applied to the bottom right cell- See Also:
-
getBottomRightCellStyle
Returns the style applied to the bottom right cell.- Returns:
- the style applied to the bottom right cell
- See Also:
-
setEvenRowStripesStyle
Sets the style of the even rows.- Parameters:
xlsStyle- the style applied to the even rows- See Also:
-
getEvenRowStripesStyle
Returns the style applied to the even rows.- Returns:
- the style applied to the even rows
- See Also:
-
setEvenColumnStripesStyle
Sets the style of the even columns.- Parameters:
xlsStyle- the style applied to the even columns- See Also:
-
getEvenColumnStripesStyle
Returns the style applied to the even columns.- Returns:
- the style applied to the even columns
- See Also:
-
setOddRowStripesStyle
Sets the style of the odd rows.- Parameters:
xlsStyle- the style applied to the odd rows- See Also:
-
getOddRowStripesStyle
Returns the style applied to the odd rows.- Returns:
- the style applied to the odd rows
- See Also:
-
setOddColumnStripesStyle
Sets the style of the odd columns.- Parameters:
xlsStyle- the style applied to the odd columns- See Also:
-
getOddColumnStripesStyle
Returns the style applied to the odd columns.- Returns:
- the style applied to the odd columns
- See Also:
-
InitAs
public void InitAs(int autoformat) Initializes the table autoformat that is one of the predefined autoformats.- Parameters:
autoformat- the predefined autoformat. Possible values are available inStylesclass.
-
getAutoFormatType
public int getAutoFormatType()Returns the type of this autoformat.- Returns:
- the type of this autoformat. A list of predefined autoformats is available in
Stylesclass. The method returns -1 if the autoformat is user defined.
-
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-