org.apache.poi.ss.usermodel
Interface CellStyle

All Known Implementing Classes:
HSSFCellStyle, XSSFCellStyle

public interface CellStyle


Field Summary
static short ALIGN_CENTER
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.CENTER instead.
static short ALIGN_CENTER_SELECTION
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.CENTER_SELECTION instead.
static short ALIGN_FILL
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.FILL instead.
static short ALIGN_GENERAL
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.GENERAL instead.
static short ALIGN_JUSTIFY
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.JUSTIFY instead.
static short ALIGN_LEFT
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.LEFT instead.
static short ALIGN_RIGHT
          Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.RIGHT instead.
static short ALT_BARS
          Deprecated. 3.15 beta 3. Use FillPatternType.ALT_BARS instead.
static short BIG_SPOTS
          Deprecated. 3.15 beta 3. Use FillPatternType.BIG_SPOTS instead.
static short BORDER_DASH_DOT
          Deprecated. 3.15 beta 2. Use BorderStyle.DASH_DOT instead.
static short BORDER_DASH_DOT_DOT
          Deprecated. 3.15 beta 2. Use BorderStyle.DASH_DOT_DOT instead.
static short BORDER_DASHED
          Deprecated. 3.15 beta 2. Use BorderStyle.DASHED instead.
static short BORDER_DOTTED
          Deprecated. 3.15 beta 2. Use BorderStyle.DOTTED instead.
static short BORDER_DOUBLE
          Deprecated. 3.15 beta 2. Use BorderStyle.DOUBLE instead.
static short BORDER_HAIR
          Deprecated. 3.15 beta 2. Use BorderStyle.HAIR instead.
static short BORDER_MEDIUM
          Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM instead.
static short BORDER_MEDIUM_DASH_DOT
          Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM_DASH_DOT instead.
static short BORDER_MEDIUM_DASH_DOT_DOT
          Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM_DASH_DOT_DOT instead.
static short BORDER_MEDIUM_DASHED
          Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM_DASHED instead.
static short BORDER_NONE
          Deprecated. 3.15 beta 2. Use BorderStyle.NONE instead.
static short BORDER_SLANTED_DASH_DOT
          Deprecated. 3.15 beta 2. Use BorderStyle.SLANTED_DASH_DOT instead.
static short BORDER_THICK
          Deprecated. 3.15 beta 2. Use BorderStyle.THICK instead.
static short BORDER_THIN
          Deprecated. 3.15 beta 2. Use BorderStyle.THIN instead.
static short BRICKS
          Deprecated. 3.15 beta 3. Use FillPatternType.BRICKS instead.
static short DIAMONDS
          Deprecated. 3.15 beta 3. Use FillPatternType.DIAMONDS instead.
static short FINE_DOTS
          Deprecated. 3.15 beta 3. Use FillPatternType.FINE_DOTS instead.
static short LEAST_DOTS
          Deprecated. 3.15 beta 3. Use FillPatternType.LEAST_DOTS instead.
static short LESS_DOTS
          Deprecated. 3.15 beta 3. Use FillPatternType.LESS_DOTS instead.
static short NO_FILL
          Deprecated. 3.15 beta 3. Use FillPatternType.NO_FILL instead.
static short SOLID_FOREGROUND
          Deprecated. 3.15 beta 3. Use FillPatternType.SOLID_FOREGROUND instead.
static short SPARSE_DOTS
          Deprecated. 3.15 beta 3. Use FillPatternType.SPARSE_DOTS instead.
static short SQUARES
          Deprecated. 3.15 beta 3. Use FillPatternType.SQUARES instead.
static short THICK_BACKWARD_DIAG
          Deprecated. 3.15 beta 3. Use FillPatternType.THICK_BACKWARD_DIAG instead.
static short THICK_FORWARD_DIAG
          Deprecated. 3.15 beta 3. Use FillPatternType.THICK_FORWARD_DIAG instead.
static short THICK_HORZ_BANDS
          Deprecated. 3.15 beta 3. Use FillPatternType.THICK_HORZ_BANDS instead.
static short THICK_VERT_BANDS
          Deprecated. 3.15 beta 3. Use FillPatternType.THICK_VERT_BANDS instead.
static short THIN_BACKWARD_DIAG
          Deprecated. 3.15 beta 3. Use FillPatternType.THIN_BACKWARD_DIAG instead.
static short THIN_FORWARD_DIAG
          Deprecated. 3.15 beta 3. Use FillPatternType.THIN_FORWARD_DIAG instead.
static short THIN_HORZ_BANDS
          Deprecated. 3.15 beta 3. Use FillPatternType.THIN_HORZ_BANDS instead.
static short THIN_VERT_BANDS
          Deprecated. 3.15 beta 3. Use FillPatternType.THIN_VERT_BANDS instead.
static short VERTICAL_BOTTOM
          Deprecated. POI 3.15 beta 3. Use VerticalAlignment.BOTTOM instead.
static short VERTICAL_CENTER
          Deprecated. POI 3.15 beta 3. Use VerticalAlignment.CENTER instead.
static short VERTICAL_JUSTIFY
          Deprecated. POI 3.15 beta 3. Use VerticalAlignment.JUSTIFY instead.
static short VERTICAL_TOP
          Deprecated. POI 3.15 beta 3. Use VerticalAlignment.TOP instead.
 
Method Summary
 void cloneStyleFrom(CellStyle source)
          Clones all the style information from another CellStyle, onto this one.
 short getAlignment()
          Deprecated. POI 3.15 beta 3. Use getAlignmentEnum() instead.
 HorizontalAlignment getAlignmentEnum()
          get the type of horizontal alignment for the cell
 short getBorderBottom()
          Deprecated. POI 3.15. Use getBorderBottomEnum() instead. This will return a BorderStyle enum in the future.
 BorderStyle getBorderBottomEnum()
          get the type of border to use for the bottom border of the cell
 short getBorderLeft()
          Deprecated. POI 3.15. Use getBorderLeftEnum() instead. This will return a BorderStyle enum in the future.
 BorderStyle getBorderLeftEnum()
          get the type of border to use for the left border of the cell
 short getBorderRight()
          Deprecated. POI 3.15. Use getBorderRightEnum() instead. This will return a BorderStyle enum in the future.
 BorderStyle getBorderRightEnum()
          get the type of border to use for the right border of the cell
 short getBorderTop()
          Deprecated. POI 3.15. Use getBorderTopEnum() instead. This will return a BorderStyle enum in the future.
 BorderStyle getBorderTopEnum()
          get the type of border to use for the top border of the cell
 short getBottomBorderColor()
          get the color to use for the left border
 short getDataFormat()
          get the index of the data format.
 java.lang.String getDataFormatString()
          Get the format string
 short getFillBackgroundColor()
          get the background fill color, if the fill is defined with an indexed color.
 Color getFillBackgroundColorColor()
          Gets the color object representing the current background fill, resolving indexes using the supplied workbook.
 short getFillForegroundColor()
          get the foreground fill color, if the fill is defined with an indexed color.
 Color getFillForegroundColorColor()
          Gets the color object representing the current foreground fill, resolving indexes using the supplied workbook.
 short getFillPattern()
          Deprecated. POI 3.15 beta 3. This method will return FillPatternType in the future. Use setFillPattern(FillPatternType) instead.
 FillPatternType getFillPatternEnum()
          get the fill pattern (??) - set to 1 to fill with foreground color
 short getFontIndex()
          gets the index of the font for this style
 boolean getHidden()
          get whether the cell's using this style are to be hidden
 short getIndention()
          get the number of spaces to indent the text in the cell
 short getIndex()
          get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
 short getLeftBorderColor()
          get the color to use for the left border
 boolean getLocked()
          get whether the cell's using this style are to be locked
 boolean getQuotePrefixed()
          Is "Quote Prefix" or "123 Prefix" enabled for the cell? Having this on is somewhat (but not completely, see IgnoredErrorType) like prefixing the cell value with a ' in Excel
 short getRightBorderColor()
          get the color to use for the left border
 short getRotation()
          get the degree of rotation for the text in the cell.
 boolean getShrinkToFit()
          Should the Cell be auto-sized by Excel to shrink it to fit if this text is too long?
 short getTopBorderColor()
          get the color to use for the top border
 short getVerticalAlignment()
          Deprecated. POI 3.15 beta 3. Use getVerticalAlignmentEnum() instead.
 VerticalAlignment getVerticalAlignmentEnum()
          get the type of vertical alignment for the cell
 boolean getWrapText()
          get whether the text should be wrapped
 void setAlignment(HorizontalAlignment align)
          set the type of horizontal alignment for the cell
 void setAlignment(short align)
          Deprecated. POI 3.15 beta 3. Use setAlignment(HorizontalAlignment) instead.
 void setBorderBottom(BorderStyle border)
          set the type of border to use for the bottom border of the cell
 void setBorderBottom(short border)
          Deprecated. 3.15 beta 2. Use setBorderBottom(BorderStyle) instead.
 void setBorderLeft(BorderStyle border)
          set the type of border to use for the left border of the cell
 void setBorderLeft(short border)
          Deprecated. 3.15 beta 2. Use setBorderLeft(BorderStyle) instead
 void setBorderRight(BorderStyle border)
          set the type of border to use for the right border of the cell
 void setBorderRight(short border)
          Deprecated. 3.15 beta 2. Use setBorderRight(BorderStyle) instead
 void setBorderTop(BorderStyle border)
          set the type of border to use for the top border of the cell
 void setBorderTop(short border)
          Deprecated. 3.15 beta 2. Use setBorderTop(BorderStyle) instead
 void setBottomBorderColor(short color)
          set the color to use for the bottom border
 void setDataFormat(short fmt)
          set the data format (must be a valid format).
 void setFillBackgroundColor(short bg)
          set the background fill color.
 void setFillForegroundColor(short bg)
          set the foreground fill color Note: Ensure Foreground color is set prior to background color.
 void setFillPattern(FillPatternType fp)
          setting to one fills the cell with the foreground color...
 void setFillPattern(short fp)
          Deprecated. POI 3.15 beta 3. Use setFillPattern(FillPatternType) instead.
 void setFont(Font font)
          set the font for this style
 void setHidden(boolean hidden)
          set the cell's using this style to be hidden
 void setIndention(short indent)
          set the number of spaces to indent the text in the cell
 void setLeftBorderColor(short color)
          set the color to use for the left border
 void setLocked(boolean locked)
          set the cell's using this style to be locked
 void setQuotePrefixed(boolean quotePrefix)
          Turn on or off "Quote Prefix" or "123 Prefix" for the style, which is used to tell Excel that the thing which looks like a number or a formula shouldn't be treated as on.
 void setRightBorderColor(short color)
          set the color to use for the right border
 void setRotation(short rotation)
          set the degree of rotation for the text in the cell.
 void setShrinkToFit(boolean shrinkToFit)
          Controls if the Cell should be auto-sized to shrink to fit if the text is too long
 void setTopBorderColor(short color)
          set the color to use for the top border
 void setVerticalAlignment(short align)
          Deprecated. POI 3.15 beta 3. Use setVerticalAlignment(VerticalAlignment) instead.
 void setVerticalAlignment(VerticalAlignment align)
          set the type of vertical alignment for the cell
 void setWrapText(boolean wrapped)
          Set whether the text should be wrapped.
 

Field Detail

ALIGN_GENERAL

@Removal(version="3.17")
static final short ALIGN_GENERAL
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.GENERAL instead.
general (normal) horizontal alignment

See Also:
Constant Field Values

ALIGN_LEFT

@Removal(version="3.17")
static final short ALIGN_LEFT
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.LEFT instead.
left-justified horizontal alignment

See Also:
Constant Field Values

ALIGN_CENTER

@Removal(version="3.17")
static final short ALIGN_CENTER
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.CENTER instead.
center horizontal alignment

See Also:
Constant Field Values

ALIGN_RIGHT

@Removal(version="3.17")
static final short ALIGN_RIGHT
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.RIGHT instead.
right-justified horizontal alignment

See Also:
Constant Field Values

ALIGN_FILL

@Removal(version="3.17")
static final short ALIGN_FILL
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.FILL instead.
fill? horizontal alignment

See Also:
Constant Field Values

ALIGN_JUSTIFY

@Removal(version="3.17")
static final short ALIGN_JUSTIFY
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.JUSTIFY instead.
justified horizontal alignment

See Also:
Constant Field Values

ALIGN_CENTER_SELECTION

@Removal(version="3.17")
static final short ALIGN_CENTER_SELECTION
Deprecated. POI 3.15 beta 3. Use HorizontalAlignment.CENTER_SELECTION instead.
center-selection? horizontal alignment

See Also:
Constant Field Values

VERTICAL_TOP

@Removal(version="3.17")
static final short VERTICAL_TOP
Deprecated. POI 3.15 beta 3. Use VerticalAlignment.TOP instead.
top-aligned vertical alignment

See Also:
Constant Field Values

VERTICAL_CENTER

@Removal(version="3.17")
static final short VERTICAL_CENTER
Deprecated. POI 3.15 beta 3. Use VerticalAlignment.CENTER instead.
center-aligned vertical alignment

See Also:
Constant Field Values

VERTICAL_BOTTOM

@Removal(version="3.17")
static final short VERTICAL_BOTTOM
Deprecated. POI 3.15 beta 3. Use VerticalAlignment.BOTTOM instead.
bottom-aligned vertical alignment

See Also:
Constant Field Values

VERTICAL_JUSTIFY

@Removal(version="3.17")
static final short VERTICAL_JUSTIFY
Deprecated. POI 3.15 beta 3. Use VerticalAlignment.JUSTIFY instead.
vertically justified vertical alignment

See Also:
Constant Field Values

BORDER_NONE

@Removal(version="3.17")
static final short BORDER_NONE
Deprecated. 3.15 beta 2. Use BorderStyle.NONE instead.
No border

See Also:
Constant Field Values

BORDER_THIN

@Removal(version="3.17")
static final short BORDER_THIN
Deprecated. 3.15 beta 2. Use BorderStyle.THIN instead.
Thin border

See Also:
Constant Field Values

BORDER_MEDIUM

@Removal(version="3.17")
static final short BORDER_MEDIUM
Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM instead.
Medium border

See Also:
Constant Field Values

BORDER_DASHED

@Removal(version="3.17")
static final short BORDER_DASHED
Deprecated. 3.15 beta 2. Use BorderStyle.DASHED instead.
dash border

See Also:
Constant Field Values

BORDER_DOTTED

@Removal(version="3.17")
static final short BORDER_DOTTED
Deprecated. 3.15 beta 2. Use BorderStyle.DOTTED instead.
dot border

See Also:
Constant Field Values

BORDER_THICK

@Removal(version="3.17")
static final short BORDER_THICK
Deprecated. 3.15 beta 2. Use BorderStyle.THICK instead.
Thick border

See Also:
Constant Field Values

BORDER_DOUBLE

@Removal(version="3.17")
static final short BORDER_DOUBLE
Deprecated. 3.15 beta 2. Use BorderStyle.DOUBLE instead.
double-line border

See Also:
Constant Field Values

BORDER_HAIR

@Removal(version="3.17")
static final short BORDER_HAIR
Deprecated. 3.15 beta 2. Use BorderStyle.HAIR instead.
hair-line border

See Also:
Constant Field Values

BORDER_MEDIUM_DASHED

@Removal(version="3.17")
static final short BORDER_MEDIUM_DASHED
Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM_DASHED instead.
Medium dashed border

See Also:
Constant Field Values

BORDER_DASH_DOT

@Removal(version="3.17")
static final short BORDER_DASH_DOT
Deprecated. 3.15 beta 2. Use BorderStyle.DASH_DOT instead.
dash-dot border

See Also:
Constant Field Values

BORDER_MEDIUM_DASH_DOT

@Removal(version="3.17")
static final short BORDER_MEDIUM_DASH_DOT
Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM_DASH_DOT instead.
medium dash-dot border

See Also:
Constant Field Values

BORDER_DASH_DOT_DOT

@Removal(version="3.17")
static final short BORDER_DASH_DOT_DOT
Deprecated. 3.15 beta 2. Use BorderStyle.DASH_DOT_DOT instead.
dash-dot-dot border

See Also:
Constant Field Values

BORDER_MEDIUM_DASH_DOT_DOT

@Removal(version="3.17")
static final short BORDER_MEDIUM_DASH_DOT_DOT
Deprecated. 3.15 beta 2. Use BorderStyle.MEDIUM_DASH_DOT_DOT instead.
medium dash-dot-dot border

See Also:
Constant Field Values

BORDER_SLANTED_DASH_DOT

@Removal(version="3.17")
static final short BORDER_SLANTED_DASH_DOT
Deprecated. 3.15 beta 2. Use BorderStyle.SLANTED_DASH_DOT instead.
slanted dash-dot border

See Also:
Constant Field Values

NO_FILL

@Removal(version="3.17")
static final short NO_FILL
Deprecated. 3.15 beta 3. Use FillPatternType.NO_FILL instead.
Fill Pattern: No background

See Also:
Constant Field Values

SOLID_FOREGROUND

@Removal(version="3.17")
static final short SOLID_FOREGROUND
Deprecated. 3.15 beta 3. Use FillPatternType.SOLID_FOREGROUND instead.
Fill Pattern: Solidly filled

See Also:
Constant Field Values

FINE_DOTS

@Removal(version="3.17")
static final short FINE_DOTS
Deprecated. 3.15 beta 3. Use FillPatternType.FINE_DOTS instead.
Fill Pattern: Small fine dots

See Also:
Constant Field Values

ALT_BARS

@Removal(version="3.17")
static final short ALT_BARS
Deprecated. 3.15 beta 3. Use FillPatternType.ALT_BARS instead.
Fill Pattern: Wide dots

See Also:
Constant Field Values

SPARSE_DOTS

@Removal(version="3.17")
static final short SPARSE_DOTS
Deprecated. 3.15 beta 3. Use FillPatternType.SPARSE_DOTS instead.
Fill Pattern: Sparse dots

See Also:
Constant Field Values

THICK_HORZ_BANDS

@Removal(version="3.17")
static final short THICK_HORZ_BANDS
Deprecated. 3.15 beta 3. Use FillPatternType.THICK_HORZ_BANDS instead.
Fill Pattern: Thick horizontal bands

See Also:
Constant Field Values

THICK_VERT_BANDS

@Removal(version="3.17")
static final short THICK_VERT_BANDS
Deprecated. 3.15 beta 3. Use FillPatternType.THICK_VERT_BANDS instead.
Fill Pattern: Thick vertical bands

See Also:
Constant Field Values

THICK_BACKWARD_DIAG

@Removal(version="3.17")
static final short THICK_BACKWARD_DIAG
Deprecated. 3.15 beta 3. Use FillPatternType.THICK_BACKWARD_DIAG instead.
Fill Pattern: Thick backward facing diagonals

See Also:
Constant Field Values

THICK_FORWARD_DIAG

@Removal(version="3.17")
static final short THICK_FORWARD_DIAG
Deprecated. 3.15 beta 3. Use FillPatternType.THICK_FORWARD_DIAG instead.
Fill Pattern: Thick forward facing diagonals

See Also:
Constant Field Values

BIG_SPOTS

@Removal(version="3.17")
static final short BIG_SPOTS
Deprecated. 3.15 beta 3. Use FillPatternType.BIG_SPOTS instead.
Fill Pattern: Large spots

See Also:
Constant Field Values

BRICKS

@Removal(version="3.17")
static final short BRICKS
Deprecated. 3.15 beta 3. Use FillPatternType.BRICKS instead.
Fill Pattern: Brick-like layout

See Also:
Constant Field Values

THIN_HORZ_BANDS

@Removal(version="3.17")
static final short THIN_HORZ_BANDS
Deprecated. 3.15 beta 3. Use FillPatternType.THIN_HORZ_BANDS instead.
Fill Pattern: Thin horizontal bands

See Also:
Constant Field Values

THIN_VERT_BANDS

@Removal(version="3.17")
static final short THIN_VERT_BANDS
Deprecated. 3.15 beta 3. Use FillPatternType.THIN_VERT_BANDS instead.
Fill Pattern: Thin vertical bands

See Also:
Constant Field Values

THIN_BACKWARD_DIAG

@Removal(version="3.17")
static final short THIN_BACKWARD_DIAG
Deprecated. 3.15 beta 3. Use FillPatternType.THIN_BACKWARD_DIAG instead.
Fill Pattern: Thin backward diagonal

See Also:
Constant Field Values

THIN_FORWARD_DIAG

@Removal(version="3.17")
static final short THIN_FORWARD_DIAG
Deprecated. 3.15 beta 3. Use FillPatternType.THIN_FORWARD_DIAG instead.
Fill Pattern: Thin forward diagonal

See Also:
Constant Field Values

SQUARES

@Removal(version="3.17")
static final short SQUARES
Deprecated. 3.15 beta 3. Use FillPatternType.SQUARES instead.
Fill Pattern: Squares

See Also:
Constant Field Values

DIAMONDS

@Removal(version="3.17")
static final short DIAMONDS
Deprecated. 3.15 beta 3. Use FillPatternType.DIAMONDS instead.
Fill Pattern: Diamonds

See Also:
Constant Field Values

LESS_DOTS

@Removal(version="3.17")
static final short LESS_DOTS
Deprecated. 3.15 beta 3. Use FillPatternType.LESS_DOTS instead.
Fill Pattern: Less Dots

See Also:
Constant Field Values

LEAST_DOTS

@Removal(version="3.17")
static final short LEAST_DOTS
Deprecated. 3.15 beta 3. Use FillPatternType.LEAST_DOTS instead.
Fill Pattern: Least Dots

See Also:
Constant Field Values
Method Detail

getIndex

short getIndex()
get the index within the Workbook (sequence within the collection of ExtnededFormat objects)

Returns:
unique index number of the underlying record this style represents (probably you don't care unless you're comparing which one is which)

setDataFormat

void setDataFormat(short fmt)
set the data format (must be a valid format). Built in formats are defined at BuiltinFormats.

See Also:
DataFormat

getDataFormat

short getDataFormat()
get the index of the data format. Built in formats are defined at BuiltinFormats.

See Also:
DataFormat

getDataFormatString

java.lang.String getDataFormatString()
Get the format string


setFont

void setFont(Font font)
set the font for this style

Parameters:
font - a font object created or retrieved from the Workbook object
See Also:
Workbook.createFont(), Workbook.getFontAt(short)

getFontIndex

short getFontIndex()
gets the index of the font for this style

See Also:
Workbook.getFontAt(short)

setHidden

void setHidden(boolean hidden)
set the cell's using this style to be hidden

Parameters:
hidden - - whether the cell using this style should be hidden

getHidden

boolean getHidden()
get whether the cell's using this style are to be hidden

Returns:
hidden - whether the cell using this style should be hidden

setLocked

void setLocked(boolean locked)
set the cell's using this style to be locked

Parameters:
locked - - whether the cell using this style should be locked

getLocked

boolean getLocked()
get whether the cell's using this style are to be locked

Returns:
hidden - whether the cell using this style should be locked

setQuotePrefixed

void setQuotePrefixed(boolean quotePrefix)
Turn on or off "Quote Prefix" or "123 Prefix" for the style, which is used to tell Excel that the thing which looks like a number or a formula shouldn't be treated as on. Turning this on is somewhat (but not completely, see IgnoredErrorType) like prefixing the cell value with a ' in Excel


getQuotePrefixed

boolean getQuotePrefixed()
Is "Quote Prefix" or "123 Prefix" enabled for the cell? Having this on is somewhat (but not completely, see IgnoredErrorType) like prefixing the cell value with a ' in Excel


setAlignment

void setAlignment(short align)
Deprecated. POI 3.15 beta 3. Use setAlignment(HorizontalAlignment) instead.

set the type of horizontal alignment for the cell

Parameters:
align - - the type of alignment
See Also:
ALIGN_GENERAL, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_FILL, ALIGN_JUSTIFY, ALIGN_CENTER_SELECTION

setAlignment

void setAlignment(HorizontalAlignment align)
set the type of horizontal alignment for the cell

Parameters:
align - - the type of alignment

getAlignment

short getAlignment()
Deprecated. POI 3.15 beta 3. Use getAlignmentEnum() instead.

get the type of horizontal alignment for the cell

Returns:
align - the type of alignment
See Also:
ALIGN_GENERAL, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_FILL, ALIGN_JUSTIFY, ALIGN_CENTER_SELECTION

getAlignmentEnum

HorizontalAlignment getAlignmentEnum()
get the type of horizontal alignment for the cell

Returns:
align - the type of alignment

setWrapText

void setWrapText(boolean wrapped)
Set whether the text should be wrapped. Setting this flag to true make all content visible within a cell by displaying it on multiple lines

Parameters:
wrapped - wrap text or not

getWrapText

boolean getWrapText()
get whether the text should be wrapped

Returns:
wrap text or not

setVerticalAlignment

void setVerticalAlignment(short align)
Deprecated. POI 3.15 beta 3. Use setVerticalAlignment(VerticalAlignment) instead.

set the type of vertical alignment for the cell

Parameters:
align - the type of alignment
See Also:
VERTICAL_TOP, VERTICAL_CENTER, VERTICAL_BOTTOM, VERTICAL_JUSTIFY

setVerticalAlignment

void setVerticalAlignment(VerticalAlignment align)
set the type of vertical alignment for the cell

Parameters:
align - the type of alignment

getVerticalAlignment

short getVerticalAlignment()
Deprecated. POI 3.15 beta 3. Use getVerticalAlignmentEnum() instead.

get the type of vertical alignment for the cell

Returns:
align the type of alignment
See Also:
VERTICAL_TOP, VERTICAL_CENTER, VERTICAL_BOTTOM, VERTICAL_JUSTIFY

getVerticalAlignmentEnum

VerticalAlignment getVerticalAlignmentEnum()
get the type of vertical alignment for the cell

Returns:
align the type of alignment

setRotation

void setRotation(short rotation)
set the degree of rotation for the text in the cell. Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges accordingly, however the corresponding getter is returning values in the range mandated by the current type of Excel file-format that this CellStyle is applied to.

Parameters:
rotation - degrees (see note above)

getRotation

short getRotation()
get the degree of rotation for the text in the cell. Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges value-range as used by the type of Excel file-format that this CellStyle is applied to.

Returns:
rotation degrees (see note above)

setIndention

void setIndention(short indent)
set the number of spaces to indent the text in the cell

Parameters:
indent - - number of spaces

getIndention

short getIndention()
get the number of spaces to indent the text in the cell

Returns:
indent - number of spaces

setBorderLeft

@Removal(version="3.17")
void setBorderLeft(short border)
Deprecated. 3.15 beta 2. Use setBorderLeft(BorderStyle) instead

set the type of border to use for the left border of the cell

Parameters:
border - type
See Also:
BORDER_NONE, BORDER_THIN, BORDER_MEDIUM, BORDER_DASHED, BORDER_DOTTED, BORDER_THICK, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM_DASHED, BORDER_DASH_DOT, BORDER_MEDIUM_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_SLANTED_DASH_DOT

setBorderLeft

void setBorderLeft(BorderStyle border)
set the type of border to use for the left border of the cell

Parameters:
border - type
Since:
POI 3.15

getBorderLeft

short getBorderLeft()
Deprecated. POI 3.15. Use getBorderLeftEnum() instead. This will return a BorderStyle enum in the future.

get the type of border to use for the left border of the cell

Returns:
border type

getBorderLeftEnum

BorderStyle getBorderLeftEnum()
get the type of border to use for the left border of the cell

Returns:
border type
Since:
POI 3.15

setBorderRight

@Removal(version="3.17")
void setBorderRight(short border)
Deprecated. 3.15 beta 2. Use setBorderRight(BorderStyle) instead

set the type of border to use for the right border of the cell

Parameters:
border - type
See Also:
BORDER_NONE, BORDER_THIN, BORDER_MEDIUM, BORDER_DASHED, BORDER_DOTTED, BORDER_THICK, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM_DASHED, BORDER_DASH_DOT, BORDER_MEDIUM_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_SLANTED_DASH_DOT

setBorderRight

void setBorderRight(BorderStyle border)
set the type of border to use for the right border of the cell

Parameters:
border - type
Since:
POI 3.15

getBorderRight

short getBorderRight()
Deprecated. POI 3.15. Use getBorderRightEnum() instead. This will return a BorderStyle enum in the future.

get the type of border to use for the right border of the cell

Returns:
border type

getBorderRightEnum

BorderStyle getBorderRightEnum()
get the type of border to use for the right border of the cell

Returns:
border type
Since:
POI 3.15

setBorderTop

@Removal(version="3.17")
void setBorderTop(short border)
Deprecated. 3.15 beta 2. Use setBorderTop(BorderStyle) instead

set the type of border to use for the top border of the cell

Parameters:
border - type
See Also:
BORDER_NONE, BORDER_THIN, BORDER_MEDIUM, BORDER_DASHED, BORDER_DOTTED, BORDER_THICK, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM_DASHED, BORDER_DASH_DOT, BORDER_MEDIUM_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_SLANTED_DASH_DOT

setBorderTop

void setBorderTop(BorderStyle border)
set the type of border to use for the top border of the cell

Parameters:
border - type
Since:
POI 3.15

getBorderTop

short getBorderTop()
Deprecated. POI 3.15. Use getBorderTopEnum() instead. This will return a BorderStyle enum in the future.

get the type of border to use for the top border of the cell

Returns:
border type

getBorderTopEnum

BorderStyle getBorderTopEnum()
get the type of border to use for the top border of the cell

Returns:
border type
Since:
POI 3.15

setBorderBottom

@Removal(version="3.17")
void setBorderBottom(short border)
Deprecated. 3.15 beta 2. Use setBorderBottom(BorderStyle) instead.

set the type of border to use for the bottom border of the cell

Parameters:
border - type
See Also:
BORDER_NONE, BORDER_THIN, BORDER_MEDIUM, BORDER_DASHED, BORDER_DOTTED, BORDER_THICK, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM_DASHED, BORDER_DASH_DOT, BORDER_MEDIUM_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_SLANTED_DASH_DOT

setBorderBottom

void setBorderBottom(BorderStyle border)
set the type of border to use for the bottom border of the cell

Parameters:
border - type
Since:
POI 3.15

getBorderBottom

short getBorderBottom()
Deprecated. POI 3.15. Use getBorderBottomEnum() instead. This will return a BorderStyle enum in the future.

get the type of border to use for the bottom border of the cell

Returns:
border type

getBorderBottomEnum

BorderStyle getBorderBottomEnum()
get the type of border to use for the bottom border of the cell

Returns:
border type
Since:
POI 3.15

setLeftBorderColor

void setLeftBorderColor(short color)
set the color to use for the left border

Parameters:
color - The index of the color definition

getLeftBorderColor

short getLeftBorderColor()
get the color to use for the left border


setRightBorderColor

void setRightBorderColor(short color)
set the color to use for the right border

Parameters:
color - The index of the color definition

getRightBorderColor

short getRightBorderColor()
get the color to use for the left border

Returns:
the index of the color definition

setTopBorderColor

void setTopBorderColor(short color)
set the color to use for the top border

Parameters:
color - The index of the color definition

getTopBorderColor

short getTopBorderColor()
get the color to use for the top border

Returns:
the index of the color definition

setBottomBorderColor

void setBottomBorderColor(short color)
set the color to use for the bottom border

Parameters:
color - The index of the color definition

getBottomBorderColor

short getBottomBorderColor()
get the color to use for the left border

Returns:
the index of the color definition

setFillPattern

void setFillPattern(short fp)
Deprecated. POI 3.15 beta 3. Use setFillPattern(FillPatternType) instead.

setting to one fills the cell with the foreground color... No idea about other values

Parameters:
fp - fill pattern (set to 1 to fill w/foreground color)
See Also:
NO_FILL, SOLID_FOREGROUND, FINE_DOTS, ALT_BARS, SPARSE_DOTS, THICK_HORZ_BANDS, THICK_VERT_BANDS, THICK_BACKWARD_DIAG, THICK_FORWARD_DIAG, BIG_SPOTS, BRICKS, THIN_HORZ_BANDS, THIN_VERT_BANDS, THIN_BACKWARD_DIAG, THIN_FORWARD_DIAG, SQUARES, DIAMONDS

setFillPattern

void setFillPattern(FillPatternType fp)
setting to one fills the cell with the foreground color... No idea about other values

Parameters:
fp - fill pattern (set to FillPatternType.SOLID_FOREGROUND to fill w/foreground color)
Since:
POI 3.15 beta 3
See Also:
NO_FILL, SOLID_FOREGROUND, FINE_DOTS, ALT_BARS, SPARSE_DOTS, THICK_HORZ_BANDS, THICK_VERT_BANDS, THICK_BACKWARD_DIAG, THICK_FORWARD_DIAG, BIG_SPOTS, BRICKS, THIN_HORZ_BANDS, THIN_VERT_BANDS, THIN_BACKWARD_DIAG, THIN_FORWARD_DIAG, SQUARES, DIAMONDS

getFillPattern

short getFillPattern()
Deprecated. POI 3.15 beta 3. This method will return FillPatternType in the future. Use setFillPattern(FillPatternType) instead.

get the fill pattern (??) - set to 1 to fill with foreground color

Returns:
fill pattern

getFillPatternEnum

FillPatternType getFillPatternEnum()
get the fill pattern (??) - set to 1 to fill with foreground color

Returns:
fill pattern
Since:
POI 3.15 beta 3

setFillBackgroundColor

void setFillBackgroundColor(short bg)
set the background fill color.

Parameters:
bg - color

getFillBackgroundColor

short getFillBackgroundColor()
get the background fill color, if the fill is defined with an indexed color.

Returns:
fill color index, or 0 if not indexed (XSSF only)

getFillBackgroundColorColor

Color getFillBackgroundColorColor()
Gets the color object representing the current background fill, resolving indexes using the supplied workbook. This will work for both indexed and rgb defined colors.


setFillForegroundColor

void setFillForegroundColor(short bg)
set the foreground fill color Note: Ensure Foreground color is set prior to background color.

Parameters:
bg - color

getFillForegroundColor

short getFillForegroundColor()
get the foreground fill color, if the fill is defined with an indexed color.

Returns:
fill color, or 0 if not indexed (XSSF only)

getFillForegroundColorColor

Color getFillForegroundColorColor()
Gets the color object representing the current foreground fill, resolving indexes using the supplied workbook. This will work for both indexed and rgb defined colors.


cloneStyleFrom

void cloneStyleFrom(CellStyle source)
Clones all the style information from another CellStyle, onto this one. This CellStyle will then have all the same properties as the source, but the two may be edited independently. Any stylings on this CellStyle will be lost! The source CellStyle could be from another Workbook if you like. This allows you to copy styles from one Workbook to another. However, both of the CellStyles will need to be of the same type (HSSFCellStyle or XSSFCellStyle)


setShrinkToFit

void setShrinkToFit(boolean shrinkToFit)
Controls if the Cell should be auto-sized to shrink to fit if the text is too long


getShrinkToFit

boolean getShrinkToFit()
Should the Cell be auto-sized by Excel to shrink it to fit if this text is too long?



Copyright 2017 The Apache Software Foundation or its licensors, as applicable.