Style

Inheritance: java.lang.Object

public class Style

Represents display style of excel document,such as font,color,alignment,border,etc. The Style object contains all style attributes (font, number format, alignment, and so on) as properties.

Example

         Workbook workbook = new Workbook();
 
         WorksheetCollection sheets = workbook.getWorksheets();
         Cell cell = sheets.get(0).getCells().get("A1");
         Style style =  cell.getStyle();
         style.getFont().setName("Times New Roman");
         style.getFont().setColor(Color.getBlue());
         cell.setStyle(style);

Constructors

ConstructorDescription
Style()Initializes a new instance of the Style class.

Methods

MethodDescription
copy(Style style)Copies data from another style object
equals(Object obj)Determines whether two Style instances are equal.
getBackgroundArgbColor()Gets the background color with a 32-bit ARGB value.
getBackgroundColor()Gets a style’s background color.
getBackgroundThemeColor()Gets the background theme color.
getBorders()Gets the BorderCollection of the style.
getClass()
getCultureCustom()Gets the culture-dependent pattern string for number format.
getCustom()Represents the custom number format string of this style object.
getFont()Gets a ChartArea.getFont() object.
getForegroundArgbColor()Gets the foreground color with a 32-bit ARGB value.
getForegroundColor()Gets a style’s foreground color.
getForegroundThemeColor()Gets the foreground theme color.
getHorizontalAlignment()Gets the horizontal alignment type of the text in a cell.
getIndentLevel()Represents the indent level for the cell or range.
getInvariantCustom()Gets the culture-independent pattern string for number format.
getName()Gets the name of the style.
getNumber()Gets the display format of numbers and dates.
getParentStyle()Gets the parent style of this style.
getPattern()Gets the cell background pattern type.
getQuotePrefix()Indicates whether the cell’s value starts with single quote mark.
getRotationAngle()Represents text rotation angle.
getShrinkToFit()Represents if text automatically shrinks to fit in the available column width.
getTextDirection()Represents text reading order.
getTwoColorGradient()Get the two-color gradient setting.
getTwoColorGradientSetting()Get the two-color gradient setting.
getVerticalAlignment()Gets the vertical alignment type of the text in a cell.
hasBorders()Checks whether there are borders have been set for the style.
hashCode()Serves as a hash function for a Style object.
isAlignmentApplied()Indicate whether the alignment formatting should be applied.
isBorderApplied()Indicate whether the border formatting should be applied.
isDateTime()Indicates whether the number format is a date format.
isFillApplied()Indicate whether the fill formatting should be applied.
isFontApplied()Indicate whether the font formatting should be applied.
isFormulaHidden()Represents if the formula will be hidden when the worksheet is protected.
isGradient()Indicates whether the cell shading is a gradient pattern.
isJustifyDistributed()Indicates if the cells justified or distributed alignment should be used on the last line of text.
isLocked()Gets a value indicating whether a cell can be modified or not.
isModified(int modifyFlag)Checks whether the specified properties of the style have been modified.
isNumberFormatApplied()Indicate whether the number formatting should be applied.
isPercent()Indicates whether the number format is a percent format.
isProtectionApplied()Indicate whether the protection formatting should be applied.
isTextWrapped()Gets a value indicating whether the text within a cell is wrapped.
notify()
notifyAll()
setAlignmentApplied(boolean value)Indicate whether the alignment formatting should be applied.
setBackgroundArgbColor(int value)Sets the background color with a 32-bit ARGB value.
setBackgroundColor(Color value)Sets a style’s background color.
setBackgroundThemeColor(ThemeColor value)Sets the background theme color.
setBorder(int borderType, int borderStyle, CellsColor borderColor)Sets the borders of the style.
setBorder(int borderType, int borderStyle, Color borderColor)Sets the borders of the style.
setBorderApplied(boolean value)Indicate whether the border formatting should be applied.
setCultureCustom(String value)Sets the culture-dependent pattern string for number format.
setCustom(String value)Represents the custom number format string of this style object.
setCustom(String custom, boolean builtinPreference)Sets the Custom number format string of a cell.
setFillApplied(boolean value)Indicate whether the fill formatting should be applied.
setFontApplied(boolean value)Indicate whether the font formatting should be applied.
setForegroundArgbColor(int value)Sets the foreground color with a 32-bit ARGB value.
setForegroundColor(Color value)Sets a style’s foreground color.
setForegroundThemeColor(ThemeColor value)Sets the foreground theme color.
setFormulaHidden(boolean value)Represents if the formula will be hidden when the worksheet is protected.
setGradient(boolean value)Indicates whether the cell shading is a gradient pattern.
setHorizontalAlignment(int value)Sets the horizontal alignment type of the text in a cell.
setIndentLevel(int value)Represents the indent level for the cell or range.
setJustifyDistributed(boolean value)Indicates if the cells justified or distributed alignment should be used on the last line of text.
setLocked(boolean value)Sets a value indicating whether a cell can be modified or not.
setName(String value)Sets the name of the style.
setNumber(int value)Sets the display format of numbers and dates.
setNumberFormatApplied(boolean value)Indicate whether the number formatting should be applied.
setPattern(int value)Sets the cell background pattern type.
setPatternColor(int pattern, Color color1, Color color2)Sets the background color.
setProtectionApplied(boolean value)Indicate whether the protection formatting should be applied.
setQuotePrefix(boolean value)Indicates whether the cell’s value starts with single quote mark.
setRotationAngle(int value)Represents text rotation angle.
setShrinkToFit(boolean value)Represents if text automatically shrinks to fit in the available column width.
setTextDirection(int value)Represents text reading order.
setTextWrapped(boolean value)Sets a value indicating whether the text within a cell is wrapped.
setTwoColorGradient(Color color1, Color color2, int gradientStyleType, int variant)Sets the specified fill to a two-color gradient.
setVerticalAlignment(int value)Sets the vertical alignment type of the text in a cell.
toJson()Convert Style to JSON struct data.
toString()
update()Apply the named style to the styles of the cells which use this named style.
wait()
wait(long arg0)
wait(long arg0, int arg1)

Style()

public Style()

Initializes a new instance of the Style class.

Remarks

NOTE: This constructor is now obsolete. Instead, please use CellsFactory.CreateStyle() method. This property will be removed 6 months later since October 2016. Aspose apologizes for any inconvenience you may have experienced.

copy(Style style)

public void copy(Style style)

Copies data from another style object

Remarks

This method does not copy the name of the style. If you want to copy the name, please call the following codes after copying style: destStyle.Name = style.Name.

Parameters:

ParameterTypeDescription
styleStyleSource Style object

equals(Object obj)

public boolean equals(Object obj)

Determines whether two Style instances are equal.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe Style object to compare with the current Style object.

Returns: boolean - true if the specified Object is equal to the current Object; otherwise, false.

getBackgroundArgbColor()

public int getBackgroundArgbColor()

Gets the background color with a 32-bit ARGB value.

Returns: int

getBackgroundColor()

public Color getBackgroundColor()

Gets a style’s background color.

Remarks

If you want to set a cell’s color, please use Style.ForegroundColor property. Only if the cell style pattern is other than none or solid, this property will take effect.

Returns: Color

getBackgroundThemeColor()

public ThemeColor getBackgroundThemeColor()

Gets the background theme color.

Remarks

If the background color is not a theme color, NULL will be returned.

Returns: ThemeColor

getBorders()

public BorderCollection getBorders()

Gets the BorderCollection of the style.

Returns: BorderCollection

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCultureCustom()

public String getCultureCustom()

Gets the culture-dependent pattern string for number format. If no number format has been set for this object, null will be returned. If number format is builtin, the pattern string corresponding to the builtin number will be returned.

Remarks

For builtin number format, both the pattern content(such as, one builtin date format is “m/d/y” for some locales, but for some other locales it becomes “d/m/y”) and the format specifier(such as, some locales is using character other than ‘y’ to represent the year part for date formatting) are culture-dependent; For user specified custom format, only format specifiers are changed according to the culture, other parts of the formatting pattern will not be modified.

Returns: java.lang.String

getCustom()

public String getCustom()

Represents the custom number format string of this style object. If the custom number format is not set(For example, the number format is builtin), "" will be returned.

Remarks

The returned custom string is culture-independent.

Returns: java.lang.String

getFont()

public Font getFont()

Gets a ChartArea.getFont() object.

Returns: Font

getForegroundArgbColor()

public int getForegroundArgbColor()

Gets the foreground color with a 32-bit ARGB value.

Returns: int

getForegroundColor()

public Color getForegroundColor()

Gets a style’s foreground color.

Remarks

It means no color setting if Color.Empty is returned.

Returns: Color

getForegroundThemeColor()

public ThemeColor getForegroundThemeColor()

Gets the foreground theme color.

Remarks

If the foreground color is not a theme color, NULL will be returned.

Returns: ThemeColor

getHorizontalAlignment()

public int getHorizontalAlignment()

Gets the horizontal alignment type of the text in a cell.

See TextAlignmentType.

Returns: int

getIndentLevel()

public int getIndentLevel()

Represents the indent level for the cell or range. Can only be an integer from 0 to 250.

Remarks

If text horizontal alignment type is set to value other than left or right, indent level will be reset to zero.

Returns: int

getInvariantCustom()

public String getInvariantCustom()

Gets the culture-independent pattern string for number format. If no number format has been set for this object, null will be returned. If number format is builtin, the pattern string corresponding to the builtin number will be returned.

Remarks

For builtin number formats, the returned pattern content is still culture-dependent, such as, for some locales it returns “m/d/y” and for some other locales it returns “d/m/y”. The difference from getCultureCustom() is(that is also what culture-independent means): the format specifiers and separators are kept as standard, such as ‘/’ will always be used as datetime separator and “y” will always be used as the “year” part no matter what other special character is used for the specific locale.

Returns: java.lang.String

getName()

public String getName()

Gets the name of the style.

Returns: java.lang.String

getNumber()

public int getNumber()

Gets the display format of numbers and dates. The formatting patterns are different for different regions.

Remarks

For example, the formatting patterns represented by numbers for en_US region:

ValueTypeFormat String
0GeneralGeneral
1Decimal0
2Decimal0.00
3Decimal#,##0
4Decimal#,##0.00
5Currency$#,##0_);($#,##0)
6Currency$#,##0_);[Red](../$#,##0)
7Currency$#,##0.00_);($#,##0.00)
8Currency$#,##0.00_);[Red](../$#,##0.00)
9Percentage0%
10Percentage0.00%
11Scientific0.00E+00
12Fraction# ?/?
13Fraction# ??/??
14Datem/d/yyyy
15Dated-mmm-yy
16Dated-mmm
17Datemmm-yy
18Timeh:mm AM/PM
19Timeh:mm:ss AM/PM
20Timeh:mm
21Timeh:mm:ss
22Timem/d/yyyy h:mm
37Accounting#,##0_);(#,##0)
38Accounting#,##0_);[Red](../#,##0)
39Accounting#,##0.00_);(#,##0.00)
40Accounting#,##0.00_);[Red](../#,##0.00)
41Accounting_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)
42Currency_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)
43Accounting_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)
44Currency_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)
45Timemm:ss
46Time[h]:mm:ss
47Timemm:ss.0
48Scientific##0.0E+0
49Text@

Returns: int

getParentStyle()

public Style getParentStyle()

Gets the parent style of this style.

Returns: Style

getPattern()

public int getPattern()

Gets the cell background pattern type.

See BackgroundType.

Returns: int

getQuotePrefix()

public boolean getQuotePrefix()

Indicates whether the cell’s value starts with single quote mark.

Returns: boolean

getRotationAngle()

public int getRotationAngle()

Represents text rotation angle.

Remarks

0: Not rotated.

255: Top to Bottom.

-90: Downward.

90: Upward.

You can set 255 or value ranged from -90 to 90.

Returns: int

getShrinkToFit()

public boolean getShrinkToFit()

Represents if text automatically shrinks to fit in the available column width.

Returns: boolean

getTextDirection()

public int getTextDirection()

Represents text reading order.

See TextDirectionType.

Returns: int

getTwoColorGradient()

public Object[] getTwoColorGradient()

Get the two-color gradient setting.

Remarks

NOTE: This method is now obsolete. Instead, please use Style.GetTwoColorGradientSetting() method. This property will be removed 12 months later since December 2022. Aspose apologizes for any inconvenience you may have experienced.

Returns: java.lang.Object[] - Returns all setting about two-color gradient [0] : Color1 [1] : Color2 [2] : GradientStyleType [3] : Variant

getTwoColorGradientSetting()

public TwoColorGradient getTwoColorGradientSetting()

Get the two-color gradient setting.

Returns: TwoColorGradient

getVerticalAlignment()

public int getVerticalAlignment()

Gets the vertical alignment type of the text in a cell.

See TextAlignmentType.

Returns: int

hasBorders()

public boolean hasBorders()

Checks whether there are borders have been set for the style.

Returns: boolean

hashCode()

public int hashCode()

Serves as a hash function for a Style object.

Remarks

This method is only for internal use.

Returns: int - A hash code for the current Object.

isAlignmentApplied()

public boolean isAlignmentApplied()

Indicate whether the alignment formatting should be applied.

Remarks

Only for named style.

Returns: boolean

isBorderApplied()

public boolean isBorderApplied()

Indicate whether the border formatting should be applied.

Remarks

Only for named style.

Returns: boolean

isDateTime()

public boolean isDateTime()

Indicates whether the number format is a date format.

Returns: boolean

isFillApplied()

public boolean isFillApplied()

Indicate whether the fill formatting should be applied.

Remarks

Only for named style.

Returns: boolean

isFontApplied()

public boolean isFontApplied()

Indicate whether the font formatting should be applied.

Remarks

Only for named style.

Returns: boolean

isFormulaHidden()

public boolean isFormulaHidden()

Represents if the formula will be hidden when the worksheet is protected.

Returns: boolean

isGradient()

public boolean isGradient()

Indicates whether the cell shading is a gradient pattern.

Returns: boolean

isJustifyDistributed()

public boolean isJustifyDistributed()

Indicates if the cells justified or distributed alignment should be used on the last line of text.

Remarks

This is typical for East Asian alignments but not typical in other contexts.

Returns: boolean

isLocked()

public boolean isLocked()

Gets a value indicating whether a cell can be modified or not.

Remarks

Locking cells has no effect unless the worksheet is protected.

Returns: boolean

isModified(int modifyFlag)

public boolean isModified(int modifyFlag)

Checks whether the specified properties of the style have been modified. Used for style of ConditionalFormattings to check whether the specified properties of this style should be used when applying the ConditionalFormattings on a cell.

Parameters:

ParameterTypeDescription
modifyFlagintStyleModifyFlag. Style modified flags

Returns: boolean - true if the specified properties have been modified

isNumberFormatApplied()

public boolean isNumberFormatApplied()

Indicate whether the number formatting should be applied.

Remarks

Only for named style.

Returns: boolean

isPercent()

public boolean isPercent()

Indicates whether the number format is a percent format.

Returns: boolean

isProtectionApplied()

public boolean isProtectionApplied()

Indicate whether the protection formatting should be applied.

Remarks

Only for named style.

Returns: boolean

isTextWrapped()

public boolean isTextWrapped()

Gets a value indicating whether the text within a cell is wrapped.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAlignmentApplied(boolean value)

public void setAlignmentApplied(boolean value)

Indicate whether the alignment formatting should be applied.

Remarks

Only for named style.

Parameters:

ParameterTypeDescription
valueboolean

setBackgroundArgbColor(int value)

public void setBackgroundArgbColor(int value)

Sets the background color with a 32-bit ARGB value.

Parameters:

ParameterTypeDescription
valueint

setBackgroundColor(Color value)

public void setBackgroundColor(Color value)

Sets a style’s background color.

Remarks

If you want to set a cell’s color, please use Style.ForegroundColor property. Only if the cell style pattern is other than none or solid, this property will take effect.

Parameters:

ParameterTypeDescription
valueColor

setBackgroundThemeColor(ThemeColor value)

public void setBackgroundThemeColor(ThemeColor value)

Sets the background theme color.

Remarks

If the background color is not a theme color, NULL will be returned.

Parameters:

ParameterTypeDescription
valueThemeColor

setBorder(int borderType, int borderStyle, CellsColor borderColor)

public boolean setBorder(int borderType, int borderStyle, CellsColor borderColor)

Sets the borders of the style.

Parameters:

ParameterTypeDescription
borderTypeintBorderType. The border(s) to be set, can be combination of BorderType.
borderStyleintCellBorderType. The style of the border.
borderColorCellsColorThe color of the border.

Returns: boolean - Whether current border settings have been changed.

setBorder(int borderType, int borderStyle, Color borderColor)

public boolean setBorder(int borderType, int borderStyle, Color borderColor)

Sets the borders of the style.

Parameters:

ParameterTypeDescription
borderTypeintBorderType. The border(s) to be set, can be combination of BorderType.
borderStyleintCellBorderType. The style of the border.
borderColorColorThe color of the border.

Returns: boolean - Whether current border settings have been changed.

setBorderApplied(boolean value)

public void setBorderApplied(boolean value)

Indicate whether the border formatting should be applied.

Remarks

Only for named style.

Parameters:

ParameterTypeDescription
valueboolean

setCultureCustom(String value)

public void setCultureCustom(String value)

Sets the culture-dependent pattern string for number format. If no number format has been set for this object, null will be returned. If number format is builtin, the pattern string corresponding to the builtin number will be returned.

Remarks

For builtin number format, both the pattern content(such as, one builtin date format is “m/d/y” for some locales, but for some other locales it becomes “d/m/y”) and the format specifier(such as, some locales is using character other than ‘y’ to represent the year part for date formatting) are culture-dependent; For user specified custom format, only format specifiers are changed according to the culture, other parts of the formatting pattern will not be modified.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCustom(String value)

public void setCustom(String value)

Represents the custom number format string of this style object. If the custom number format is not set(For example, the number format is builtin), "" will be returned.

Remarks

The returned custom string is culture-independent.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCustom(String custom, boolean builtinPreference)

public void setCustom(String custom, boolean builtinPreference)

Sets the Custom number format string of a cell.

Parameters:

ParameterTypeDescription
customjava.lang.StringCustom number format string, should be InvariantCulture pattern.
builtinPreferencebooleanIf given Custom number format string matches one of the built-in number formats corresponding to current regional settings, whether set the number format as built-in instead of Custom.

setFillApplied(boolean value)

public void setFillApplied(boolean value)

Indicate whether the fill formatting should be applied.

Remarks

Only for named style.

Parameters:

ParameterTypeDescription
valueboolean

setFontApplied(boolean value)

public void setFontApplied(boolean value)

Indicate whether the font formatting should be applied.

Remarks

Only for named style.

Parameters:

ParameterTypeDescription
valueboolean

setForegroundArgbColor(int value)

public void setForegroundArgbColor(int value)

Sets the foreground color with a 32-bit ARGB value.

Parameters:

ParameterTypeDescription
valueint

setForegroundColor(Color value)

public void setForegroundColor(Color value)

Sets a style’s foreground color.

Remarks

It means no color setting if Color.Empty is returned.

Parameters:

ParameterTypeDescription
valueColor

setForegroundThemeColor(ThemeColor value)

public void setForegroundThemeColor(ThemeColor value)

Sets the foreground theme color.

Remarks

If the foreground color is not a theme color, NULL will be returned.

Parameters:

ParameterTypeDescription
valueThemeColor

setFormulaHidden(boolean value)

public void setFormulaHidden(boolean value)

Represents if the formula will be hidden when the worksheet is protected.

Parameters:

ParameterTypeDescription
valueboolean

setGradient(boolean value)

public void setGradient(boolean value)

Indicates whether the cell shading is a gradient pattern.

Parameters:

ParameterTypeDescription
valueboolean

setHorizontalAlignment(int value)

public void setHorizontalAlignment(int value)

Sets the horizontal alignment type of the text in a cell.

See TextAlignmentType.

Parameters:

ParameterTypeDescription
valueint

setIndentLevel(int value)

public void setIndentLevel(int value)

Represents the indent level for the cell or range. Can only be an integer from 0 to 250.

Remarks

If text horizontal alignment type is set to value other than left or right, indent level will be reset to zero.

Parameters:

ParameterTypeDescription
valueint

setJustifyDistributed(boolean value)

public void setJustifyDistributed(boolean value)

Indicates if the cells justified or distributed alignment should be used on the last line of text.

Remarks

This is typical for East Asian alignments but not typical in other contexts.

Parameters:

ParameterTypeDescription
valueboolean

setLocked(boolean value)

public void setLocked(boolean value)

Sets a value indicating whether a cell can be modified or not.

Remarks

Locking cells has no effect unless the worksheet is protected.

Parameters:

ParameterTypeDescription
valueboolean

setName(String value)

public void setName(String value)

Sets the name of the style.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setNumber(int value)

public void setNumber(int value)

Sets the display format of numbers and dates. The formatting patterns are different for different regions.

Remarks

For example, the formatting patterns represented by numbers for en_US region:

ValueTypeFormat String
0GeneralGeneral
1Decimal0
2Decimal0.00
3Decimal#,##0
4Decimal#,##0.00
5Currency$#,##0_);($#,##0)
6Currency$#,##0_);[Red](../$#,##0)
7Currency$#,##0.00_);($#,##0.00)
8Currency$#,##0.00_);[Red](../$#,##0.00)
9Percentage0%
10Percentage0.00%
11Scientific0.00E+00
12Fraction# ?/?
13Fraction# ??/??
14Datem/d/yyyy
15Dated-mmm-yy
16Dated-mmm
17Datemmm-yy
18Timeh:mm AM/PM
19Timeh:mm:ss AM/PM
20Timeh:mm
21Timeh:mm:ss
22Timem/d/yyyy h:mm
37Accounting#,##0_);(#,##0)
38Accounting#,##0_);[Red](../#,##0)
39Accounting#,##0.00_);(#,##0.00)
40Accounting#,##0.00_);[Red](../#,##0.00)
41Accounting_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)
42Currency_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)
43Accounting_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)
44Currency_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)
45Timemm:ss
46Time[h]:mm:ss
47Timemm:ss.0
48Scientific##0.0E+0
49Text@

Parameters:

ParameterTypeDescription
valueint

setNumberFormatApplied(boolean value)

public void setNumberFormatApplied(boolean value)

Indicate whether the number formatting should be applied.

Remarks

Only for named style.

Parameters:

ParameterTypeDescription
valueboolean

setPattern(int value)

public void setPattern(int value)

Sets the cell background pattern type.

See BackgroundType.

Parameters:

ParameterTypeDescription
valueint

setPatternColor(int pattern, Color color1, Color color2)

public void setPatternColor(int pattern, Color color1, Color color2)

Sets the background color.

Parameters:

ParameterTypeDescription
patternintBackgroundType. The pattern.
color1ColorThe foreground color.
color2ColorThe background color. Only works when pattern is not BackgroundType.None and BackgroundType.Solid.

setProtectionApplied(boolean value)

public void setProtectionApplied(boolean value)

Indicate whether the protection formatting should be applied.

Remarks

Only for named style.

Parameters:

ParameterTypeDescription
valueboolean

setQuotePrefix(boolean value)

public void setQuotePrefix(boolean value)

Indicates whether the cell’s value starts with single quote mark.

Parameters:

ParameterTypeDescription
valueboolean

setRotationAngle(int value)

public void setRotationAngle(int value)

Represents text rotation angle.

Remarks

0: Not rotated.

255: Top to Bottom.

-90: Downward.

90: Upward.

You can set 255 or value ranged from -90 to 90.

Parameters:

ParameterTypeDescription
valueint

setShrinkToFit(boolean value)

public void setShrinkToFit(boolean value)

Represents if text automatically shrinks to fit in the available column width.

Parameters:

ParameterTypeDescription
valueboolean

setTextDirection(int value)

public void setTextDirection(int value)

Represents text reading order.

See TextDirectionType.

Parameters:

ParameterTypeDescription
valueint

setTextWrapped(boolean value)

public void setTextWrapped(boolean value)

Sets a value indicating whether the text within a cell is wrapped.

Parameters:

ParameterTypeDescription
valueboolean

setTwoColorGradient(Color color1, Color color2, int gradientStyleType, int variant)

public void setTwoColorGradient(Color color1, Color color2, int gradientStyleType, int variant)

Sets the specified fill to a two-color gradient.

Parameters:

ParameterTypeDescription
color1ColorOne gradient color.
color2ColorTwo gradient color.
gradientStyleTypeintGradientStyleType. Gradient shading style.
variantintThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setVerticalAlignment(int value)

public void setVerticalAlignment(int value)

Sets the vertical alignment type of the text in a cell.

See TextAlignmentType.

Parameters:

ParameterTypeDescription
valueint

toJson()

public String toJson()

Convert Style to JSON struct data.

Returns: java.lang.String -

toString()

public String toString()

Returns: java.lang.String

update()

public void update()

Apply the named style to the styles of the cells which use this named style. It works like clicking the “ok” button after you finished modifying the style. Only applies for named style.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int