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
Constructor | Description |
---|---|
Style() | Initializes a new instance of the Style class. |
Methods
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
style | Style | Source Style object |
equals(Object obj)
public boolean equals(Object obj)
Determines whether two Style instances are equal.
Parameters:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The 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:
Value | Type | Format String |
---|---|---|
0 | General | General |
1 | Decimal | 0 |
2 | Decimal | 0.00 |
3 | Decimal | #,##0 |
4 | Decimal | #,##0.00 |
5 | Currency | $#,##0_);($#,##0) |
6 | Currency | $#,##0_);[Red](../$#,##0) |
7 | Currency | $#,##0.00_);($#,##0.00) |
8 | Currency | $#,##0.00_);[Red](../$#,##0.00) |
9 | Percentage | 0% |
10 | Percentage | 0.00% |
11 | Scientific | 0.00E+00 |
12 | Fraction | # ?/? |
13 | Fraction | # ??/?? |
14 | Date | m/d/yyyy |
15 | Date | d-mmm-yy |
16 | Date | d-mmm |
17 | Date | mmm-yy |
18 | Time | h:mm AM/PM |
19 | Time | h:mm:ss AM/PM |
20 | Time | h:mm |
21 | Time | h:mm:ss |
22 | Time | m/d/yyyy h:mm |
37 | Accounting | #,##0_);(#,##0) |
38 | Accounting | #,##0_);[Red](../#,##0) |
39 | Accounting | #,##0.00_);(#,##0.00) |
40 | Accounting | #,##0.00_);[Red](../#,##0.00) |
41 | Accounting | _(* #,##0_);_(* (#,##0);_(* "-"_);_(@_) |
42 | Currency | _($* #,##0_);_($* (#,##0);_($* "-"_);_(@_) |
43 | Accounting | _(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_) |
44 | Currency | _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_) |
45 | Time | mm:ss |
46 | Time | [h]:mm:ss |
47 | Time | mm:ss.0 |
48 | Scientific | ##0.0E+0 |
49 | Text | @ |
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:
Parameter | Type | Description |
---|---|---|
modifyFlag | int | StyleModifyFlag. 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:
Parameter | Type | Description |
---|---|---|
value | boolean |
setBackgroundArgbColor(int value)
public void setBackgroundArgbColor(int value)
Sets the background color with a 32-bit ARGB value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | Color |
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:
Parameter | Type | Description |
---|---|---|
value | ThemeColor |
setBorder(int borderType, int borderStyle, CellsColor borderColor)
public boolean setBorder(int borderType, int borderStyle, CellsColor borderColor)
Sets the borders of the style.
Parameters:
Parameter | Type | Description |
---|---|---|
borderType | int | BorderType. The border(s) to be set, can be combination of BorderType. |
borderStyle | int | CellBorderType. The style of the border. |
borderColor | CellsColor | The 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:
Parameter | Type | Description |
---|---|---|
borderType | int | BorderType. The border(s) to be set, can be combination of BorderType. |
borderStyle | int | CellBorderType. The style of the border. |
borderColor | Color | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Parameter | Type | Description |
---|---|---|
value | java.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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setCustom(String custom, boolean builtinPreference)
public void setCustom(String custom, boolean builtinPreference)
Sets the Custom number format string of a cell.
Parameters:
Parameter | Type | Description |
---|---|---|
custom | java.lang.String | Custom number format string, should be InvariantCulture pattern. |
builtinPreference | boolean | If 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:
Parameter | Type | Description |
---|---|---|
value | boolean |
setFontApplied(boolean value)
public void setFontApplied(boolean value)
Indicate whether the font formatting should be applied.
Remarks
Only for named style.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setForegroundArgbColor(int value)
public void setForegroundArgbColor(int value)
Sets the foreground color with a 32-bit ARGB value.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | Color |
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:
Parameter | Type | Description |
---|---|---|
value | ThemeColor |
setFormulaHidden(boolean value)
public void setFormulaHidden(boolean value)
Represents if the formula will be hidden when the worksheet is protected.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setGradient(boolean value)
public void setGradient(boolean value)
Indicates whether the cell shading is a gradient pattern.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setHorizontalAlignment(int value)
public void setHorizontalAlignment(int value)
Sets the horizontal alignment type of the text in a cell.
See TextAlignmentType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Parameter | Type | Description |
---|---|---|
value | boolean |
setName(String value)
public void setName(String value)
Sets the name of the style.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.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:
Value | Type | Format String |
---|---|---|
0 | General | General |
1 | Decimal | 0 |
2 | Decimal | 0.00 |
3 | Decimal | #,##0 |
4 | Decimal | #,##0.00 |
5 | Currency | $#,##0_);($#,##0) |
6 | Currency | $#,##0_);[Red](../$#,##0) |
7 | Currency | $#,##0.00_);($#,##0.00) |
8 | Currency | $#,##0.00_);[Red](../$#,##0.00) |
9 | Percentage | 0% |
10 | Percentage | 0.00% |
11 | Scientific | 0.00E+00 |
12 | Fraction | # ?/? |
13 | Fraction | # ??/?? |
14 | Date | m/d/yyyy |
15 | Date | d-mmm-yy |
16 | Date | d-mmm |
17 | Date | mmm-yy |
18 | Time | h:mm AM/PM |
19 | Time | h:mm:ss AM/PM |
20 | Time | h:mm |
21 | Time | h:mm:ss |
22 | Time | m/d/yyyy h:mm |
37 | Accounting | #,##0_);(#,##0) |
38 | Accounting | #,##0_);[Red](../#,##0) |
39 | Accounting | #,##0.00_);(#,##0.00) |
40 | Accounting | #,##0.00_);[Red](../#,##0.00) |
41 | Accounting | _(* #,##0_);_(* (#,##0);_(* "-"_);_(@_) |
42 | Currency | _($* #,##0_);_($* (#,##0);_($* "-"_);_(@_) |
43 | Accounting | _(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_) |
44 | Currency | _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_) |
45 | Time | mm:ss |
46 | Time | [h]:mm:ss |
47 | Time | mm:ss.0 |
48 | Scientific | ##0.0E+0 |
49 | Text | @ |
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setNumberFormatApplied(boolean value)
public void setNumberFormatApplied(boolean value)
Indicate whether the number formatting should be applied.
Remarks
Only for named style.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setPattern(int value)
public void setPattern(int value)
Sets the cell background pattern type.
See BackgroundType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setPatternColor(int pattern, Color color1, Color color2)
public void setPatternColor(int pattern, Color color1, Color color2)
Sets the background color.
Parameters:
Parameter | Type | Description |
---|---|---|
pattern | int | BackgroundType. The pattern. |
color1 | Color | The foreground color. |
color2 | Color | The 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:
Parameter | Type | Description |
---|---|---|
value | boolean |
setQuotePrefix(boolean value)
public void setQuotePrefix(boolean value)
Indicates whether the cell’s value starts with single quote mark.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Parameter | Type | Description |
---|---|---|
value | int |
setShrinkToFit(boolean value)
public void setShrinkToFit(boolean value)
Represents if text automatically shrinks to fit in the available column width.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setTextDirection(int value)
public void setTextDirection(int value)
Represents text reading order.
See TextDirectionType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setTextWrapped(boolean value)
public void setTextWrapped(boolean value)
Sets a value indicating whether the text within a cell is wrapped.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
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:
Parameter | Type | Description |
---|---|---|
color1 | Color | One gradient color. |
color2 | Color | Two gradient color. |
gradientStyleType | int | GradientStyleType. Gradient shading style. |
variant | int | The 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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |