Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.xssf.usermodel
Class XSSFCellStyle

    java.lang.Object
      org.apache.poi.xssf.usermodel.XSSFCellStyle

All Implemented Interfaces:
  org.apache.poi.ss.usermodel.CellStyle

    public class XSSFCellStyle

extends java.lang.Object
implements org.apache.poi.ss.usermodel.CellStyle

High level representation of the the possible formatting information for the contents of the cells on a sheet in a SpreadsheetML document.

See Also:
  `XSSFWorkbook.createCellStyle()`, `XSSFWorkbook.getCellStyleAt(short)`, `XSSFCell.setCellStyle(org.apache.poi.ss.usermodel.CellStyle)`

Field Summary

Fields inherited from interface org.apache.poi.ss.usermodel.CellStyle
`ALIGN_CENTER, ALIGN_CENTER_SELECTION, ALIGN_FILL, ALIGN_GENERAL, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT, ALT_BARS, BIG_SPOTS, BORDER_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM, BORDER_MEDIUM_DASH_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_MEDIUM_DASHED, BORDER_NONE, BORDER_SLANTED_DASH_DOT, BORDER_THICK, BORDER_THIN, BRICKS, DIAMONDS, FINE_DOTS, LEAST_DOTS, LESS_DOTS, NO_FILL, SOLID_FOREGROUND, SPARSE_DOTS, SQUARES, THICK_BACKWARD_DIAG, THICK_FORWARD_DIAG, THICK_HORZ_BANDS, THICK_VERT_BANDS, THIN_BACKWARD_DIAG, THIN_FORWARD_DIAG, THIN_HORZ_BANDS, THIN_VERT_BANDS, VERTICAL_BOTTOM, VERTICAL_CENTER, VERTICAL_JUSTIFY, VERTICAL_TOP`

Constructor Summary
`XSSFCellStyle(int cellXfId, int cellStyleXfId, StylesTable stylesSource, ThemesTable theme)` Creates a Cell Style from the supplied parts
`XSSFCellStyle(StylesTable stylesSource)` Creates an empty Cell Style

Method Summary
`java.lang.Object` | `clone()` Make a copy of this style.
`void` | `cloneStyleFrom(org.apache.poi.ss.usermodel.CellStyle source)` Clones all the style information from another XSSFCellStyle, onto this one.
`boolean` | `equals(java.lang.Object o)` Checks is the supplied style is equal to this style
`short` | `getAlignment()` Get the type of horizontal alignment for the cell
`org.apache.poi.ss.usermodel.HorizontalAlignment` | `getAlignmentEnum()` Get the type of horizontal alignment for the cell
`short` | `getBorderBottom()` Get the type of border to use for the bottom border of the cell
`org.apache.poi.ss.usermodel.BorderStyle` | `getBorderBottomEnum()` Get the type of border to use for the bottom border of the cell
`XSSFColor` | `getBorderColor(XSSFCellBorder.BorderSide side)` Gets border color
`short` | `getBorderLeft()` Get the type of border to use for the left border of the cell
`org.apache.poi.ss.usermodel.BorderStyle` | `getBorderLeftEnum()` Get the type of border to use for the left border of the cell
`short` | `getBorderRight()` Get the type of border to use for the right border of the cell
`org.apache.poi.ss.usermodel.BorderStyle` | `getBorderRightEnum()` Get the type of border to use for the right border of the cell
`short` | `getBorderTop()` Get the type of border to use for the top border of the cell
`org.apache.poi.ss.usermodel.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 bottom border Color is optional.
`XSSFColor` | `getBottomBorderXSSFColor()` Get the color to use for the bottom border as a `XSSFColor`
`org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf` | `getCoreXf()` Used so that StylesSource can figure out our location
`short` | `getDataFormat()` Get the index of the number format (numFmt) record used by this cell format.
`java.lang.String` | `getDataFormatString()` Get the contents of the format string, by looking up the StylesSource
`short` | `getFillBackgroundColor()` Get the background fill color.
`org.apache.poi.ss.usermodel.Color` | `getFillBackgroundColorColor()`
`XSSFColor` | `getFillBackgroundXSSFColor()` Get the background fill color.
`short` | `getFillForegroundColor()` Get the foreground fill color.
`org.apache.poi.ss.usermodel.Color` | `getFillForegroundColorColor()`
`XSSFColor` | `getFillForegroundXSSFColor()` Get the foreground fill color.
`short` | `getFillPattern()` Get the fill pattern
`org.apache.poi.ss.usermodel.FillPatternType` | `getFillPatternEnum()` Get the fill pattern
`XSSFFont` | `getFont()` Gets the font for this style
`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 StylesTable (sequence within the collection of CTXf elements)
`short` | `getLeftBorderColor()` Get the color to use for the left border
`XSSFColor` | `getLeftBorderXSSFColor()` Get the color to use for the left border
`boolean` | `getLocked()` Get whether the cell's using this style are locked
`short` | `getRightBorderColor()` Get the color to use for the right border
`XSSFColor` | `getRightBorderXSSFColor()` Get the color to use for the right border
`short` | `getRotation()` Get the degree of rotation for the text in the cell
`org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf` | `getStyleXf()` Used so that StylesSource can figure out our location
`short` | `getTopBorderColor()` Get the color to use for the top border
`XSSFColor` | `getTopBorderXSSFColor()` Get the color to use for the top border
`short` | `getVerticalAlignment()` Get the type of vertical alignment for the cell
`org.apache.poi.ss.usermodel.VerticalAlignment` | `getVerticalAlignmentEnum()` Get the type of vertical alignment for the cell
`boolean` | `getWrapText()` Whether the text should be wrapped
`int` | `hashCode()` Returns a hash code value for the object.
`void` | `setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment align)` Set the type of horizontal alignment for the cell
`void` | `setAlignment(short align)` Set the type of horizontal alignment for the cell
`void` | `setBorderBottom(org.apache.poi.ss.usermodel.BorderStyle border)` Set the type of border to use for the bottom border of the cell
`void` | `setBorderBottom(short border)` Set the type of border to use for the bottom border of the cell
`void` | `setBorderColor(XSSFCellBorder.BorderSide side, XSSFColor color)` Set the color to use for the selected border
`void` | `setBorderLeft(org.apache.poi.ss.usermodel.BorderStyle border)` Set the type of border to use for the left border of the cell
`void` | `setBorderLeft(short border)` Set the type of border to use for the left border of the cell
`void` | `setBorderRight(org.apache.poi.ss.usermodel.BorderStyle border)` Set the type of border to use for the right border of the cell
`void` | `setBorderRight(short border)` Set the type of border to use for the right border of the cell
`void` | `setBorderTop(org.apache.poi.ss.usermodel.BorderStyle border)` Set the type of border to use for the top border of the cell
`void` | `setBorderTop(short border)` Set the type of border to use for the top border of the cell
`void` | `setBottomBorderColor(short color)` Set the color to use for the bottom border
`void` | `setBottomBorderColor(XSSFColor color)` Set the color to use for the bottom border
`void` | `setDataFormat(short fmt)` Set the index of a data format
`void` | `setFillBackgroundColor(short bg)` Set the background fill color represented as a indexed color value.
`void` | `setFillBackgroundColor(XSSFColor color)` Set the background fill color represented as a `XSSFColor` value.
`void` | `setFillForegroundColor(short fg)` Set the foreground fill color as a indexed color value Note: Ensure Foreground color is set prior to background color.
`void` | `setFillForegroundColor(XSSFColor color)` Set the foreground fill color represented as a `XSSFColor` value.
`void` | `setFillPattern(org.apache.poi.ss.usermodel.FillPatternType ptrn)` This element is used to specify cell fill information for pattern and solid color cell fills.
`void` | `setFillPattern(short fp)` This element is used to specify cell fill information for pattern and solid color cell fills.
`void` | `setFont(org.apache.poi.ss.usermodel.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 as a indexed color value
`void` | `setLeftBorderColor(XSSFColor color)` Set the color to use for the left border as a `XSSFColor` value
`void` | `setLocked(boolean locked)` Set the cell's using this style to be locked
`void` | `setRightBorderColor(short color)` Set the color to use for the right border
`void` | `setRightBorderColor(XSSFColor color)` Set the color to use for the right border as a `XSSFColor` value
`void` | `setRotation(short rotation)` Set the degree of rotation for the text in the cell
`void` | `setTopBorderColor(short color)` Set the color to use for the top border
`void` | `setTopBorderColor(XSSFColor color)` Set the color to use for the top border as a `XSSFColor` value
`void` | `setVerticalAlignment(short align)` Set the type of vertical alignment for the cell
`void` | `setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment align)` Set the type of vertical alignment for the cell
`void` | `setWrapText(boolean wrapped)` Set whether the text should be wrapped.
`void` | `verifyBelongsToStylesSource(StylesTable src)` Verifies that this style belongs to the supplied Workbook Styles Source.

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XSSFCellStyle

    public XSSFCellStyle(int cellXfId,
                         int cellStyleXfId,
                         StylesTable stylesSource,
                         ThemesTable theme)

  Creates a Cell Style from the supplied parts

  Parameters:
    `cellXfId` - The main XF for the cell
    `cellStyleXfId` - Optional, style xf
    `stylesSource` - Styles Source to work off

### XSSFCellStyle

    public XSSFCellStyle(StylesTable stylesSource)

  Creates an empty Cell Style

Method Detail

### getCoreXf

    public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getCoreXf()

  Used so that StylesSource can figure out our location

### getStyleXf

    public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getStyleXf()

  Used so that StylesSource can figure out our location

### verifyBelongsToStylesSource

    public void verifyBelongsToStylesSource(StylesTable src)

  Verifies that this style belongs to the supplied Workbook Styles Source. Will throw an exception if it belongs to a different one. This is normally called when trying to assign a style to a cell, to ensure the cell and the style are from the same workbook (if they're not, it won't work)

  Throws:
    `java.lang.IllegalArgumentException` - if there's a workbook mis-match

### cloneStyleFrom

    public void cloneStyleFrom(org.apache.poi.ss.usermodel.CellStyle source)

  Clones all the style information from another XSSFCellStyle, onto this one. This XSSFCellStyle will then have all the same properties as the source, but the two may be edited independently. Any stylings on this XSSFCellStyle will be lost! The source XSSFCellStyle could be from another XSSFWorkbook if you like. This allows you to copy styles from one XSSFWorkbook to another.

  Specified by:
    `cloneStyleFrom` in interface `org.apache.poi.ss.usermodel.CellStyle`

### getAlignment

    public short getAlignment()

  Get the type of horizontal alignment for the cell

  Specified by:
    `getAlignment` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    short - the type of alignment
  See Also:
    `CellStyle.ALIGN_GENERAL`, `CellStyle.ALIGN_LEFT`, `CellStyle.ALIGN_CENTER`, `CellStyle.ALIGN_RIGHT`, `CellStyle.ALIGN_FILL`, `CellStyle.ALIGN_JUSTIFY`, `CellStyle.ALIGN_CENTER_SELECTION`

### getAlignmentEnum

    public org.apache.poi.ss.usermodel.HorizontalAlignment getAlignmentEnum()

  Get the type of horizontal alignment for the cell

  Returns:
    HorizontalAlignment - the type of alignment
  See Also:
    `HorizontalAlignment`

### getBorderBottom

    public short getBorderBottom()

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

  Specified by:
    `getBorderBottom` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    short - border type
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### getBorderBottomEnum

    public org.apache.poi.ss.usermodel.BorderStyle getBorderBottomEnum()

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

  Returns:
    border type as Java enum
  See Also:
    `BorderStyle`

### getBorderLeft

    public short getBorderLeft()

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

  Specified by:
    `getBorderLeft` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    short - border type, default value is `CellStyle.BORDER_NONE`
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### getBorderLeftEnum

    public org.apache.poi.ss.usermodel.BorderStyle getBorderLeftEnum()

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

  Returns:
    border type, default value is `BorderStyle.NONE`

### getBorderRight

    public short getBorderRight()

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

  Specified by:
    `getBorderRight` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    short - border type, default value is `CellStyle.BORDER_NONE`
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### getBorderRightEnum

    public org.apache.poi.ss.usermodel.BorderStyle getBorderRightEnum()

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

  Returns:
    border type, default value is `BorderStyle.NONE`

### getBorderTop

    public short getBorderTop()

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

  Specified by:
    `getBorderTop` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    short - border type, default value is `CellStyle.BORDER_NONE`
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `#BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### getBorderTopEnum

    public org.apache.poi.ss.usermodel.BorderStyle getBorderTopEnum()

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

  Returns:
    border type, default value is `BorderStyle.NONE`

### getBottomBorderColor

    public short getBottomBorderColor()

  Get the color to use for the bottom border
  Color is optional. When missing, IndexedColors.AUTOMATIC is implied.

  Specified by:
    `getBottomBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    the index of the color definition, default value is `IndexedColors.AUTOMATIC`
  See Also:
    `IndexedColors`

### getBottomBorderXSSFColor

    public XSSFColor getBottomBorderXSSFColor()

  Get the color to use for the bottom border as a `XSSFColor`

  Returns:
    the used color or `null` if not set

### getDataFormat

    public short getDataFormat()

  Get the index of the number format (numFmt) record used by this cell format.

  Specified by:
    `getDataFormat` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    the index of the number format

### getDataFormatString

    public java.lang.String getDataFormatString()

  Get the contents of the format string, by looking up the StylesSource

  Specified by:
    `getDataFormatString` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    the number format string

### getFillBackgroundColor

    public short getFillBackgroundColor()

  Get the background fill color.

  Note - many cells are actually filled with a foreground fill, not a background fill - see `getFillForegroundColor()`

  Specified by:
    `getFillBackgroundColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    fill color, default value is `IndexedColors.AUTOMATIC`
  See Also:
    `IndexedColors`

### getFillBackgroundColorColor

    public org.apache.poi.ss.usermodel.Color getFillBackgroundColorColor()

  Specified by:
    `getFillBackgroundColorColor` in interface `org.apache.poi.ss.usermodel.CellStyle`

### getFillBackgroundXSSFColor

    public XSSFColor getFillBackgroundXSSFColor()

  Get the background fill color.

  Note - many cells are actually filled with a foreground fill, not a background fill - see `getFillForegroundColor()`

  Returns:
    XSSFColor - fill color or `null` if not set
  See Also:
    `XSSFColor.getRgb()`

### getFillForegroundColor

    public short getFillForegroundColor()

  Get the foreground fill color.

  Many cells are filled with this, instead of a background color (`getFillBackgroundColor()`)

  Specified by:
    `getFillForegroundColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    fill color, default value is `IndexedColors.AUTOMATIC`
  See Also:
    `IndexedColors`

### getFillForegroundColorColor

    public org.apache.poi.ss.usermodel.Color getFillForegroundColorColor()

  Specified by:
    `getFillForegroundColorColor` in interface `org.apache.poi.ss.usermodel.CellStyle`

### getFillForegroundXSSFColor

    public XSSFColor getFillForegroundXSSFColor()

  Get the foreground fill color.

  Returns:
    XSSFColor - fill color or `null` if not set

### getFillPattern

    public short getFillPattern()

  Get the fill pattern

  Specified by:
    `getFillPattern` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    fill pattern, default value is `CellStyle.NO_FILL`
  See Also:
    `CellStyle.NO_FILL`, `CellStyle.SOLID_FOREGROUND`, `CellStyle.FINE_DOTS`, `CellStyle.ALT_BARS`, `CellStyle.SPARSE_DOTS`, `CellStyle.THICK_HORZ_BANDS`, `CellStyle.THICK_VERT_BANDS`, `CellStyle.THICK_BACKWARD_DIAG`, `CellStyle.THICK_FORWARD_DIAG`, `CellStyle.BIG_SPOTS`, `CellStyle.BRICKS`, `CellStyle.THIN_HORZ_BANDS`, `CellStyle.THIN_VERT_BANDS`, `CellStyle.THIN_BACKWARD_DIAG`, `CellStyle.THIN_FORWARD_DIAG`, `CellStyle.SQUARES`, `CellStyle.DIAMONDS`

### getFillPatternEnum

    public org.apache.poi.ss.usermodel.FillPatternType getFillPatternEnum()

  Get the fill pattern

  Returns:
    the fill pattern, default value is `FillPatternType.NO_FILL`

### getFont

    public XSSFFont getFont()

  Gets the font for this style

  Returns:
    Font - font

### getFontIndex

    public short getFontIndex()

  Gets the index of the font for this style

  Specified by:
    `getFontIndex` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    short - font index
  See Also:
    `XSSFWorkbook.getFontAt(short)`

### getHidden

    public boolean getHidden()

  Get whether the cell's using this style are to be hidden

  Specified by:
    `getHidden` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    boolean - whether the cell using this style is hidden

### getIndention

    public short getIndention()

  Get the number of spaces to indent the text in the cell

  Specified by:
    `getIndention` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    indent - number of spaces

### getIndex

    public short getIndex()

  Get the index within the StylesTable (sequence within the collection of CTXf elements)

  Specified by:
    `getIndex` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    unique index number of the underlying record this style represents

### getLeftBorderColor

    public short getLeftBorderColor()

  Get the color to use for the left border

  Specified by:
    `getLeftBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    the index of the color definition, default value is `IndexedColors.BLACK`
  See Also:
    `IndexedColors`

### getLeftBorderXSSFColor

    public XSSFColor getLeftBorderXSSFColor()

  Get the color to use for the left border

  Returns:
    the index of the color definition or `null` if not set
  See Also:
    `IndexedColors`

### getLocked

    public boolean getLocked()

  Get whether the cell's using this style are locked

  Specified by:
    `getLocked` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    whether the cell using this style are locked

### getRightBorderColor

    public short getRightBorderColor()

  Get the color to use for the right border

  Specified by:
    `getRightBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    the index of the color definition, default value is `IndexedColors.BLACK`
  See Also:
    `IndexedColors`

### getRightBorderXSSFColor

    public XSSFColor getRightBorderXSSFColor()

  Get the color to use for the right border

  Returns:
    the used color or `null` if not set

### getRotation

    public short getRotation()

  Get the degree of rotation for the text in the cell

  Expressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc.
  For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
  `[degrees below horizon] = 90 - textRotation.`

  Specified by:
    `getRotation` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    rotation degrees (between 0 and 180 degrees)

### getTopBorderColor

    public short getTopBorderColor()

  Get the color to use for the top border

  Specified by:
    `getTopBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    the index of the color definition, default value is `IndexedColors.BLACK`
  See Also:
    `IndexedColors`

### getTopBorderXSSFColor

    public XSSFColor getTopBorderXSSFColor()

  Get the color to use for the top border

  Returns:
    the used color or `null` if not set

### getVerticalAlignment

    public short getVerticalAlignment()

  Get the type of vertical alignment for the cell

  Specified by:
    `getVerticalAlignment` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    align the type of alignment, default value is `CellStyle.VERTICAL_BOTTOM`
  See Also:
    `CellStyle.VERTICAL_TOP`, `CellStyle.VERTICAL_CENTER`, `CellStyle.VERTICAL_BOTTOM`, `CellStyle.VERTICAL_JUSTIFY`

### getVerticalAlignmentEnum

    public org.apache.poi.ss.usermodel.VerticalAlignment getVerticalAlignmentEnum()

  Get the type of vertical alignment for the cell

  Returns:
    the type of alignment, default value is `VerticalAlignment.BOTTOM`
  See Also:
    `VerticalAlignment`

### getWrapText

    public boolean getWrapText()

  Whether the text should be wrapped

  Specified by:
    `getWrapText` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Returns:
    a boolean value indicating if the text in a cell should be line-wrapped within the cell.

### setAlignment

    public void setAlignment(short align)

  Set the type of horizontal alignment for the cell

  Specified by:
    `setAlignment` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `align` - - the type of alignment
  See Also:
    `CellStyle.ALIGN_GENERAL`, `CellStyle.ALIGN_LEFT`, `CellStyle.ALIGN_CENTER`, `CellStyle.ALIGN_RIGHT`, `CellStyle.ALIGN_FILL`, `CellStyle.ALIGN_JUSTIFY`, `CellStyle.ALIGN_CENTER_SELECTION`

### setAlignment

    public void setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment align)

  Set the type of horizontal alignment for the cell

  Parameters:
    `align` - - the type of alignment
  See Also:
    `HorizontalAlignment`

### setBorderBottom

    public void setBorderBottom(short border)

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

  Specified by:
    `setBorderBottom` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `border` - the type of border to use
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### setBorderBottom

    public void setBorderBottom(org.apache.poi.ss.usermodel.BorderStyle border)

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

  Parameters:
    `border` - - type of border to use
  See Also:
    `BorderStyle`

### setBorderLeft

    public void setBorderLeft(short border)

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

  Specified by:
    `setBorderLeft` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `border` - the type of border to use
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### setBorderLeft

    public void setBorderLeft(org.apache.poi.ss.usermodel.BorderStyle border)

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

  Parameters:
    `border` - the type of border to use

### setBorderRight

    public void setBorderRight(short border)

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

  Specified by:
    `setBorderRight` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `border` - the type of border to use
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### setBorderRight

    public void setBorderRight(org.apache.poi.ss.usermodel.BorderStyle border)

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

  Parameters:
    `border` - the type of border to use

### setBorderTop

    public void setBorderTop(short border)

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

  Specified by:
    `setBorderTop` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `border` - the type of border to use
  See Also:
    `CellStyle.BORDER_NONE`, `CellStyle.BORDER_THIN`, `CellStyle.BORDER_MEDIUM`, `CellStyle.BORDER_DASHED`, `CellStyle.BORDER_DOTTED`, `CellStyle.BORDER_THICK`, `CellStyle.BORDER_DOUBLE`, `CellStyle.BORDER_HAIR`, `CellStyle.BORDER_MEDIUM_DASHED`, `CellStyle.BORDER_DASH_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT`, `CellStyle.BORDER_DASH_DOT_DOT`, `CellStyle.BORDER_MEDIUM_DASH_DOT_DOT`, `CellStyle.BORDER_SLANTED_DASH_DOT`

### setBorderTop

    public void setBorderTop(org.apache.poi.ss.usermodel.BorderStyle border)

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

  Parameters:
    `border` - the type of border to use

### setBottomBorderColor

    public void setBottomBorderColor(short color)

  Set the color to use for the bottom border

  Specified by:
    `setBottomBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `color` - the index of the color definition
  See Also:
    `IndexedColors`

### setBottomBorderColor

    public void setBottomBorderColor(XSSFColor color)

  Set the color to use for the bottom border

  Parameters:
    `color` - the color to use, null means no color

### setDataFormat

    public void setDataFormat(short fmt)

  Set the index of a data format

  Specified by:
    `setDataFormat` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `fmt` - the index of a data format

### setFillBackgroundColor

    public void setFillBackgroundColor(XSSFColor color)

  Set the background fill color represented as a `XSSFColor` value.

  For example:

       cs.setFillPattern(XSSFCellStyle.FINE_DOTS );
       cs.setFillBackgroundXSSFColor(new XSSFColor(java.awt.Color.RED));

  optionally a Foreground and background fill can be applied: Note: Ensure Foreground color is set prior to background

       cs.setFillPattern(XSSFCellStyle.FINE_DOTS );
       cs.setFillForegroundColor(new XSSFColor(java.awt.Color.BLUE));
       cs.setFillBackgroundColor(new XSSFColor(java.awt.Color.GREEN));

  or, for the special case of SOLID_FILL:

       cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND );
       cs.setFillForegroundColor(new XSSFColor(java.awt.Color.GREEN));

  It is necessary to set the fill style in order for the color to be shown in the cell.

  Parameters:
    `color` - - the color to use

### setFillBackgroundColor

    public void setFillBackgroundColor(short bg)

  Set the background fill color represented as a indexed color value.

  For example:

       cs.setFillPattern(XSSFCellStyle.FINE_DOTS );
       cs.setFillBackgroundXSSFColor(IndexedColors.RED.getIndex());

  optionally a Foreground and background fill can be applied: Note: Ensure Foreground color is set prior to background

       cs.setFillPattern(XSSFCellStyle.FINE_DOTS );
       cs.setFillForegroundColor(IndexedColors.BLUE.getIndex());
       cs.setFillBackgroundColor(IndexedColors.RED.getIndex());

  or, for the special case of SOLID_FILL:

       cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND );
       cs.setFillForegroundColor(IndexedColors.RED.getIndex());

  It is necessary to set the fill style in order for the color to be shown in the cell.

  Specified by:
    `setFillBackgroundColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `bg` - - the color to use
  See Also:
    `IndexedColors`

### setFillForegroundColor

    public void setFillForegroundColor(XSSFColor color)

  Set the foreground fill color represented as a `XSSFColor` value.
  Note: Ensure Foreground color is set prior to background color.

  Parameters:
    `color` - the color to use
  See Also:
    `)`

### setFillForegroundColor

    public void setFillForegroundColor(short fg)

  Set the foreground fill color as a indexed color value
  Note: Ensure Foreground color is set prior to background color.

  Specified by:
    `setFillForegroundColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `fg` - the color to use
  See Also:
    `IndexedColors`

### setFillPattern

    public void setFillPattern(short fp)

  This element is used to specify cell fill information for pattern and solid color cell fills. For solid cell fills (no pattern), foregorund color is used. For cell fills with patterns specified, then the cell fill color is specified by the background color.

  Specified by:
    `setFillPattern` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `fp` - fill pattern (set to `CellStyle.SOLID_FOREGROUND` to fill w/foreground color)
  See Also:
    `CellStyle.NO_FILL`, `CellStyle.SOLID_FOREGROUND`, `CellStyle.FINE_DOTS`, `CellStyle.ALT_BARS`, `CellStyle.SPARSE_DOTS`, `CellStyle.THICK_HORZ_BANDS`, `CellStyle.THICK_VERT_BANDS`, `CellStyle.THICK_BACKWARD_DIAG`, `CellStyle.THICK_FORWARD_DIAG`, `CellStyle.BIG_SPOTS`, `CellStyle.BRICKS`, `CellStyle.THIN_HORZ_BANDS`, `CellStyle.THIN_VERT_BANDS`, `CellStyle.THIN_BACKWARD_DIAG`, `CellStyle.THIN_FORWARD_DIAG`, `CellStyle.SQUARES`, `CellStyle.DIAMONDS`, `setFillBackgroundColor(short)`, `setFillForegroundColor(short)`

### setFillPattern

    public void setFillPattern(org.apache.poi.ss.usermodel.FillPatternType ptrn)

  This element is used to specify cell fill information for pattern and solid color cell fills. For solid cell fills (no pattern), foreground color is used is used. For cell fills with patterns specified, then the cell fill color is specified by the background color element.

  Parameters:
    `ptrn` - the fill pattern to use
  See Also:
    `setFillBackgroundColor(short)`, `setFillForegroundColor(short)`, `FillPatternType`

### setFont

    public void setFont(org.apache.poi.ss.usermodel.Font font)

  Set the font for this style

  Specified by:
    `setFont` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `font` - a font object created or retreived from the XSSFWorkbook object
  See Also:
    `XSSFWorkbook.createFont()`, `XSSFWorkbook.getFontAt(short)`

### setHidden

    public void setHidden(boolean hidden)

  Set the cell's using this style to be hidden

  Specified by:
    `setHidden` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `hidden` - - whether the cell using this style should be hidden

### setIndention

    public void setIndention(short indent)

  Set the number of spaces to indent the text in the cell

  Specified by:
    `setIndention` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `indent` - - number of spaces

### setLeftBorderColor

    public void setLeftBorderColor(short color)

  Set the color to use for the left border as a indexed color value

  Specified by:
    `setLeftBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `color` - the index of the color definition
  See Also:
    `IndexedColors`

### setLeftBorderColor

    public void setLeftBorderColor(XSSFColor color)

  Set the color to use for the left border as a `XSSFColor` value

  Parameters:
    `color` - the color to use

### setLocked

    public void setLocked(boolean locked)

  Set the cell's using this style to be locked

  Specified by:
    `setLocked` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `locked` - - whether the cell using this style should be locked

### setRightBorderColor

    public void setRightBorderColor(short color)

  Set the color to use for the right border

  Specified by:
    `setRightBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `color` - the index of the color definition
  See Also:
    `IndexedColors`

### setRightBorderColor

    public void setRightBorderColor(XSSFColor color)

  Set the color to use for the right border as a `XSSFColor` value

  Parameters:
    `color` - the color to use

### setRotation

    public void setRotation(short rotation)

  Set the degree of rotation for the text in the cell

  Expressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc.
  For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
  `[degrees below horizon] = 90 - textRotation.`

  Specified by:
    `setRotation` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `rotation` - - the rotation degrees (between 0 and 180 degrees)

### setTopBorderColor

    public void setTopBorderColor(short color)

  Set the color to use for the top border

  Specified by:
    `setTopBorderColor` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `color` - the index of the color definition
  See Also:
    `IndexedColors`

### setTopBorderColor

    public void setTopBorderColor(XSSFColor color)

  Set the color to use for the top border as a `XSSFColor` value

  Parameters:
    `color` - the color to use

### setVerticalAlignment

    public void setVerticalAlignment(short align)

  Set the type of vertical alignment for the cell

  Specified by:
    `setVerticalAlignment` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `align` - - align the type of alignment
  See Also:
    `CellStyle.VERTICAL_TOP`, `CellStyle.VERTICAL_CENTER`, `CellStyle.VERTICAL_BOTTOM`, `CellStyle.VERTICAL_JUSTIFY`, `VerticalAlignment`

### setVerticalAlignment

    public void setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment align)

  Set the type of vertical alignment for the cell

  Parameters:
    `align` - - the type of alignment

### setWrapText

    public void setWrapText(boolean wrapped)

  Set whether the text should be wrapped.

  Setting this flag to `true` make all content visible whithin a cell by displaying it on multiple lines

  Specified by:
    `setWrapText` in interface `org.apache.poi.ss.usermodel.CellStyle`
  Parameters:
    `wrapped` - a boolean value indicating if the text in a cell should be line-wrapped within the cell.

### getBorderColor

    public XSSFColor getBorderColor(XSSFCellBorder.BorderSide side)

  Gets border color

  Parameters:
    `side` - the border side
  Returns:
    the used color

### setBorderColor

    public void setBorderColor(XSSFCellBorder.BorderSide side,
                               XSSFColor color)

  Set the color to use for the selected border

  Parameters:
    `side` - - where to apply the color definition
    `color` - - the color to use

### hashCode

    public int hashCode()

  Returns a hash code value for the object. The hash is derived from the underlying CTXf bean.

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    the hash code value for this style

### equals

    public boolean equals(java.lang.Object o)

  Checks is the supplied style is equal to this style

  Overrides:
    `equals` in class `java.lang.Object`
  Parameters:
    `o` - the style to check
  Returns:
    true if the supplied style is equal to this style

### clone

    public java.lang.Object clone()

  Make a copy of this style. The underlying CTXf bean is cloned, the references to fills and borders remain.

  Overrides:
    `clone` in class `java.lang.Object`
  Returns:
    a copy of this style

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD