com.aspose.cells
Classes 
AboveAverage
AbstractCalculationEngine
AbstractCalculationMonitor
AbstractGlobalizationSettings
AbstractInterruptMonitor
AbstractTextLoadOptions
ActiveXControl
ActiveXControlBase
ArcShape
Area
AutoFilter
AutoFitterOptions
AutomaticFill
AutoNumberedBulletValue
Axis
AxisBins
BaseShapeGuide
Bevel
Border
BorderCollection
BuiltInDocumentPropertyCollection
Bullet
BulletValue
Button
CalculationCell
CalculationData
CalculationOptions
Cell
CellArea
Cells
CellsColor
CellsDataTableFactory
CellsDrawing
CellsException
CellsFactory
CellsHelper
CellWatch
CellWatchCollection
CharacterBulletValue
Chart
ChartArea
ChartCollection
ChartDataTable
ChartFrame
ChartGlobalizationSettings
ChartPoint
ChartPointCollection
ChartShape
ChartTextFrame
CheckBox
CheckBoxActiveXControl
CheckBoxCollection
CollectionBase
Color
ColorFilter
ColorHelper
ColorScale
Column
ColumnCollection
ComboBox
ComboBoxActiveXControl
CommandButtonActiveXControl
Comment
CommentCollection
CommentShape
ConditionalFormattingCollection
ConditionalFormattingIcon
ConditionalFormattingIconCollection
ConditionalFormattingResult
ConditionalFormattingValue
ConditionalFormattingValueCollection
ConnectionParameter
ConnectionParameterCollection
ContentTypeProperty
ContentTypePropertyCollection
CopyOptions
CustomDocumentPropertyCollection
CustomFilter
CustomFilterCollection
CustomGeometry
CustomImplementationFactory
CustomProperty
CustomPropertyCollection
CustomXmlPart
CustomXmlPartCollection
CustomXmlShape
DataBar
DataBarBorder
DataLabels
DataSorter
DataSorterKey
DataSorterKeyCollection
DateTime
DateTimeGroupItem
DBConnection
DefaultStyleSettings
DeleteOptions
DialogBox
DifSaveOptions
DigitalSignature
DigitalSignatureCollection
DisplayUnitLabel
DocumentProperty
DocumentPropertyCollection
DocxSaveOptions
DrawObject
DrawObjectEventHandler
DropBars
DxfCollection
DynamicFilter
Encoding
ErrorBar
ErrorCheckOption
ErrorCheckOptionCollection
ExportObjectEvent
ExportRangeToJsonOptions
ExportTableOptions
ExternalConnection
ExternalConnectionCollection
ExternalLink
ExternalLinkCollection
FileFontSource
FileFormatInfo
FileFormatUtil
Fill
FillFormat
FilterColumn
FilterColumnCollection
FindOptions
Floor
FolderFontSource
Font
FontConfigs
FontSetting
FontSettingCollection
FontSourceBase
Format3D
FormatCondition
FormatConditionCollection
FormulaParseOptions
FormulaSettings
Geometry
GlobalizationSettings
GlowEffect
GradientFill
GradientStop
GradientStopCollection
GroupBox
GroupFill
GroupShape
HeaderFooterCommand
HorizontalPageBreak
HorizontalPageBreakCollection
HtmlLoadOptions
HtmlSaveOptions
Hyperlink
HyperlinkCollection
IconFilter
IconSet
ImageActiveXControl
ImageFormat
ImageOrPrintOptions
ImageSaveOptions
ImportTableOptions
IndividualFontConfigs
InsertOptions
InterruptMonitor
JsonLayoutOptions
JsonLoadOptions
JsonSaveOptions
JsonUtility
Label
LabelActiveXControl
Legend
LegendEntry
LegendEntryCollection
License
Line
LineFormat
LineShape
ListBox
ListBoxActiveXControl
ListColumn
ListColumnCollection
ListObject
ListObjectCollection
LoadFilter
LoadOptions
MarkdownSaveOptions
Marker
MemoryFontSource
MetadataOptions
Metered
MsoFillFormat
MsoFillFormatHelper
MsoFormatPicture
MsoLineFormat
MsoLineFormatHelper
MsoTextFrame
MultipleFilterCollection
Name
NameCollection
NegativeBarFormat
NoneBulletValue
NoneFill
OdsCellField
OdsCellFieldCollection
OdsLoadOptions
OdsPageBackground
OdsSaveOptions
OleObject
OleObjectCollection
OoxmlSaveOptions
Outline
Oval
PageEndSavingArgs
PageSavingArgs
PageSetup
PageStartSavingArgs
PaginatedSaveOptions
PaneCollection
PasteOptions
PatternFill
PdfBookmarkEntry
PdfSaveOptions
PdfSecurityOptions
PicFormatOption
Picture
PictureBulletValue
PictureCollection
PivotField
PivotFieldCollection
PivotFilter
PivotFilterCollection
PivotFormatCondition
PivotFormatConditionCollection
PivotItem
PivotItemCollection
PivotOptions
PivotPageFields
PivotTable
PivotTableCollection
PlotArea
PptxSaveOptions
ProtectedRange
ProtectedRangeCollection
Protection
QueryTable
QueryTableCollection
RadioButton
RadioButtonActiveXControl
Range
RangeCollection
RectangleShape
ReferredArea
ReferredAreaCollection
ReflectionEffect
ReplaceOptions
Revision
RevisionAutoFormat
RevisionCellChange
RevisionCellComment
RevisionCellMove
RevisionCollection
RevisionCustomView
RevisionDefinedName
RevisionFormat
RevisionInsertDelete
RevisionInsertSheet
RevisionLog
RevisionLogCollection
RevisionMergeConflict
RevisionQueryTable
RevisionRenameSheet
Row
RowCollection
SaveOptions
Scenario
ScenarioCollection
ScenarioInputCell
ScenarioInputCellCollection
ScrollBar
ScrollBarActiveXControl
Series
SeriesCollection
SeriesLayoutProperties
ShadowEffect
Shape
ShapeCollection
ShapeFormat
ShapeGuide
ShapeGuideCollection
ShapePath
ShapePathCollection
ShapePathPoint
ShapePathPointCollection
ShapePropertyCollection
ShapeSegmentPath
ShapeSegmentPathCollection
ShapeTextAlignment
SheetPrintingPreview
SheetRender
SheetSet
SignatureLine
Slicer
SlicerCache
SlicerCacheItem
SlicerCacheItemCollection
SlicerCollection
SmartArtShape
SmartTag
SmartTagCollection
SmartTagOptions
SmartTagProperty
SmartTagPropertyCollection
SmartTagSetting
SolidFill
Sparkline
SparklineCollection
SparklineGroup
SparklineGroupCollection
SpinButtonActiveXControl
Spinner
SpreadsheetML2003SaveOptions
StreamProviderOptions
Style
StyleFlag
SubtotalSetting
SvgSaveOptions
SxRng
TableStyle
TableStyleCollection
TableStyleElement
TableStyleElementCollection
TableToRangeOptions
TextBox
TextBoxActiveXControl
TextBoxCollection
TextEffectFormat
TextOptions
TextParagraph
TextParagraphCollection
TextTabStop
TextTabStopCollection
TextureFill
ThemeColor
ThreadedComment
ThreadedCommentAuthor
ThreadedCommentAuthorCollection
ThreadedCommentCollection
ThreeDFormat
TickLabelItem
TickLabels
TilePicOption
Timeline
TimelineCollection
Title
ToggleButtonActiveXControl
Top10
Top10Filter
Trendline
TrendlineCollection
TxtLoadOptions
TxtSaveOptions
UnionRange
UnknownControl
Validation
ValidationCollection
VbaModule
VbaModuleCollection
VbaProject
VbaProjectReference
VbaProjectReferenceCollection
VerticalPageBreak
VerticalPageBreakCollection
VmlShapeGuide
Walls
WarningInfo
WebExtension
WebExtensionBinding
WebExtensionBindingCollection
WebExtensionCollection
WebExtensionProperty
WebExtensionPropertyCollection
WebExtensionReference
WebExtensionReferenceCollection
WebExtensionShape
WebExtensionTaskPane
WebExtensionTaskPaneCollection
WebQueryConnection
Workbook
WorkbookDesigner
WorkbookMetadata
WorkbookPrintingPreview
WorkbookRender
WorkbookSettings
Worksheet
WorksheetCollection
WriteProtection
XlsbSaveOptions
XlsSaveOptions
XmlColumnProperty
XmlDataBinding
XmlLoadOptions
XmlMap
XmlMapCollection
XmlSaveOptions
XpsSaveOptions
Interfaces 
ICellsDataTable
ICustomFunction
ICustomParser
IExportObjectListener
IFilePathProvider
IPageSavingCallback
ISmartMarkerCallBack
IStreamProvider
IWarningCallback
LightCellsDataHandler
LightCellsDataProvider
Constants 
AccessCacheOptions
ActiveXPersistenceType
AutoFillType
AutoFitMergedCellsType
AutoFitWrappedTextType
AutoShapeType
AxisType
BackgroundMode
BackgroundType
Bar3DShapeType
BevelPresetType
BevelType
BorderType
BubbleSizeRepresents
BuiltinStyleType
BulletType
CalcModeType
CalculationPrecisionStrategy
CategoryType
CellBorderType
CellValueFormatStrategy
CellValueType
ChartLineFormattingType
ChartMarkerType
ChartSplitType
ChartTextDirectionType
ChartType
CheckValueType
ColorDepth
ColorType
CommentTitleType
ConnectionDataSourceType
ConnectionParameterType
ConsolidationFunction
ControlBorderType
ControlCaptionAlignmentType
ControlListStyle
ControlMatchEntryType
ControlMousePointerType
ControlPictureAlignmentType
ControlPicturePositionType
ControlPictureSizeMode
ControlScrollBarType
ControlScrollOrientation
ControlSpecialEffectType
ControlType
CopyFormatType
CountryCode
CredentialsMethodType
CrossType
DataBarAxisPosition
DataBarBorderType
DataBarFillType
DataBarNegativeColorType
DataLabelShapeType
DataLabelsSeparatorType
DataLablesSeparatorType
DateTimeGroupingType
DefaultEditLanguage
DirectoryType
DisplayDrawingObjects
DisplayUnitType
DrawObjectEnum
DropButtonStyle
DynamicFilterType
EmfRenderSetting
EncryptionType
ErrorBarDisplayType
ErrorBarType
ErrorCheckType
ExceptionType
ExternalLinkType
FileFormatType
FillPattern
FillPictureType
FillType
FilterOperatorType
FilterType
FontSchemeType
FontSourceType
FontUnderlineType
FormatConditionType
FormatConditionValueType
FormatSetType
FormattingType
GradientColorType
GradientDirectionType
GradientFillType
GradientPresetType
GradientStyleType
GridlineType
HeaderFooterCommandType
HtmlCrossType
HtmlExportDataOptions
HtmlFormatHandlingType
HtmlHiddenColDisplayType
HtmlHiddenRowDisplayType
HtmlLinkTargetType
IconSetType
ImageType
InputMethodEditorMode
LabelPositionType
LegendPositionType
LightRigDirectionType
LightRigType
LineCapType
LineJoinType
LineSpaceSizeType
LineType
LoadDataFilterOptions
LoadFormat
LookAtType
LookInType
MapChartLabelLayout
MapChartProjectionType
MapChartRegionType
MemorySetting
MetadataType
MirrorType
MsoArrowheadLength
MsoArrowheadStyle
MsoArrowheadWidth
MsoDrawingType
MsoLineDashStyle
MsoLineStyle
MsoPresetTextEffect
MsoPresetTextEffectShape
NameScopeType
NumberCategoryType
OdsCellFieldType
OdsGeneratorType
OdsPageBackgroundGraphicPositionType
OdsPageBackgroundGraphicType
OdsPageBackgroundType
OLEDBCommandType
OoxmlCompliance
OoxmlCompressionType
OperatorType
PageLayoutAlignmentType
PageOrientationType
PaneStateType
PaperSizeType
ParameterType
PasteOperationType
PasteType
PdfCompliance
PdfCompressionCore
PdfCustomPropertiesExport
PdfFontEncoding
PdfOptimizationType
PivotConditionFormatRuleType
PivotConditionFormatScopeType
PivotFieldDataDisplayFormat
PivotFieldSubtotalType
PivotFieldType
PivotFilterType
PivotGroupByType
PivotItemPosition
PivotMissingItemLimitType
PivotTableAutoFormatType
PivotTableStyleType
PlacementType
PlotDataByType
PlotEmptyCellsType
PresetCameraType
PresetMaterialType
PresetShadowType
PresetWordArtStyle
PrintCommentsType
PrintErrorsType
PrintingPageType
PrintOrderType
PrintSizeType
PropertyType
ProtectionType
QuartileCalculationType
ReConnectionMethodType
RectangleAlignmentType
ReflectionEffectType
RenameStrategy
ResourceLoadingType
RevisionActionType
RevisionType
SaveFormat
SelectionType
ShapeAnchorType
ShapeLockType
ShapePathType
SheetType
ShiftType
ShowDropButtonType
SlicerCacheCrossFilterType
SlicerCacheItemSortType
SlicerStyleType
SmartTagShowType
SortOnType
SortOrder
SparklineAxisMinMaxType
SparklinePresetStyleType
SparklineType
SqlDataType
StyleModifyFlag
TableDataSourceType
TableStyleElementType
TableStyleType
TargetModeType
TextAlignmentType
TextAutonumberScheme
TextCapsType
TextCrossType
TextDirectionType
TextFontAlignType
TextNodeType
TextOrientationType
TextOverflowType
TextStrikeType
TextTabAlignmentType
TextureType
TextVerticalType
ThemeColorType
TickLabelPositionType
TickMarkType
TiffCompression
TimePeriodType
TimeUnit
TotalsCalculation
TrendlineType
TxtLoadStyleStrategy
TxtValueQuoteType
UpdateLinksType
ValidationAlertType
ValidationType
VbaModuleType
VbaProjectReferenceType
ViewType
VisibilityType
WarningType
WebExtensionStoreType
WeightType
XAdESType

com.aspose.cells
Class Style

java.lang.Object
    extended by com.aspose.cells.Style

public class Style 
extends java.lang.Object

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);


Constructor Summary
Style()
           Initializes a new instance of the Style class.
 
Property Getters/Setters Summary
intgetBackgroundArgbColor()
voidsetBackgroundArgbColor(int)
           Gets and sets the background color with a 32-bit ARGB value.
com.aspose.cells.ColorgetBackgroundColor()
voidsetBackgroundColor(com.aspose.cells.Color)
           Gets or sets a style's background color.
ThemeColorgetBackgroundThemeColor()
voidsetBackgroundThemeColor(ThemeColor)
           Gets and sets the background theme color.
BorderCollectiongetBorders()
           Gets the BorderCollection of the style.
java.lang.StringgetCultureCustom()
voidsetCultureCustom(java.lang.String)
           Gets and 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.
java.lang.StringgetCustom()
voidsetCustom(java.lang.String)
           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.
FontgetFont()
           Gets a Font object.
intgetForegroundArgbColor()
voidsetForegroundArgbColor(int)
           Gets and sets the foreground color with a 32-bit ARGB value.
com.aspose.cells.ColorgetForegroundColor()
voidsetForegroundColor(com.aspose.cells.Color)
           Gets or sets a style's foreground color.
ThemeColorgetForegroundThemeColor()
voidsetForegroundThemeColor(ThemeColor)
           Gets and sets the foreground theme color.
booleanhasBorders()
           Checks whether there are borders have been set for the style.
intgetHorizontalAlignment()
voidsetHorizontalAlignment(int)
           Gets or sets the horizontal alignment type of the text in a cell. The value of the property is TextAlignmentType integer constant.
intgetIndentLevel()
voidsetIndentLevel(int)
           Represents the indent level for the cell or range. Can only be an integer from 0 to 250.
java.lang.StringgetInvariantCustom()
           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.
booleanisDateTime()
           Indicates whether the number format is a date format.
booleanisFormulaHidden()
voidsetFormulaHidden(boolean)
           Represents if the formula will be hidden when the worksheet is protected.
booleanisGradient()
voidsetGradient(boolean)
           Indicates whether the cell shading is a gradient pattern.
booleanisJustifyDistributed()
voidsetJustifyDistributed(boolean)
           Indicates if the cells justified or distributed alignment should be used on the last line of text.
booleanisLocked()
voidsetLocked(boolean)
           Gets or sets a value indicating whether a cell can be modified or not.
booleanisPercent()
           Indicates whether the number format is a percent format.
booleanisTextWrapped()
voidsetTextWrapped(boolean)
           Gets or sets a value indicating whether the text within a cell is wrapped.
java.lang.StringgetName()
voidsetName(java.lang.String)
           Gets or sets the name of the style.
intgetNumber()
voidsetNumber(int)
           Gets or sets the display format of numbers and dates. The formatting patterns are different for different regions.
StylegetParentStyle()
           Gets the parent style of this style.
intgetPattern()
voidsetPattern(int)
           Gets or sets the cell background pattern type. The value of the property is BackgroundType integer constant.
booleangetQuotePrefix()
voidsetQuotePrefix(boolean)
           Indicates whether the cell's value starts with single quote mark.
intgetRotationAngle()
voidsetRotationAngle(int)
           Represents text rotation angle.
booleangetShrinkToFit()
voidsetShrinkToFit(boolean)
           Represents if text automatically shrinks to fit in the available column width.
intgetTextDirection()
voidsetTextDirection(int)
           Represents text reading order. The value of the property is TextDirectionType integer constant.
intgetVerticalAlignment()
voidsetVerticalAlignment(int)
           Gets or sets the vertical alignment type of the text in a cell. The value of the property is TextAlignmentType integer constant.
 
Method Summary
voidcopy(Style style)
           Copies data from another style object
booleanequals(java.lang.Object obj)
           Determines whether two Style instances are equal.
inthashCode()
           Serves as a hash function for a Style object.
booleanisModified(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.
booleansetBorder(int borderEdge, int borderStyle, com.aspose.cells.Color borderColor)
           Sets the borders of the style.
voidsetCustom(java.lang.String custom, boolean builtinPreference)
           Sets the Custom number format string of a cell.
voidsetPatternColor(int pattern, com.aspose.cells.Color color1, com.aspose.cells.Color color2)
           Sets the background color.
voidsetTwoColorGradient(com.aspose.cells.Color color1, com.aspose.cells.Color color2, int gradientStyleType, int variant)
           Sets the specified fill to a two-color gradient.
voidupdate()
           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.
 

Constructor Detail

Style

public Style()
Initializes a new instance of the Style class. 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.

Property Getters/Setters Detail

getBackgroundThemeColor/setBackgroundThemeColor

public ThemeColor getBackgroundThemeColor() / public void setBackgroundThemeColor(ThemeColor value)
Gets and sets the background theme color. If the background color is not a theme color, NULL will be returned.

getForegroundThemeColor/setForegroundThemeColor

public ThemeColor getForegroundThemeColor() / public void setForegroundThemeColor(ThemeColor value)
Gets and sets the foreground theme color. If the foreground color is not a theme color, NULL will be returned.

getName/setName

public java.lang.String getName() / public void setName(java.lang.String value)
Gets or sets the name of the style.

getPattern/setPattern

public int getPattern() / public void setPattern(int value)
Gets or sets the cell background pattern type. The value of the property is BackgroundType integer constant.

getBorders

public BorderCollection getBorders()
Gets the BorderCollection of the style.

getBackgroundColor/setBackgroundColor

public com.aspose.cells.Color getBackgroundColor() / public void setBackgroundColor(com.aspose.cells.Color value)
Gets or sets a style's background color. 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.

getBackgroundArgbColor/setBackgroundArgbColor

public int getBackgroundArgbColor() / public void setBackgroundArgbColor(int value)
Gets and sets the background color with a 32-bit ARGB value.

getForegroundColor/setForegroundColor

public com.aspose.cells.Color getForegroundColor() / public void setForegroundColor(com.aspose.cells.Color value)
Gets or sets a style's foreground color. It means no color setting if Color.Empty is returned.

getForegroundArgbColor/setForegroundArgbColor

public int getForegroundArgbColor() / public void setForegroundArgbColor(int value)
Gets and sets the foreground color with a 32-bit ARGB value.

hasBorders

public boolean hasBorders()
Checks whether there are borders have been set for the style.

getParentStyle

public Style getParentStyle()
Gets the parent style of this style.

getIndentLevel/setIndentLevel

public int getIndentLevel() / public void setIndentLevel(int value)
Represents the indent level for the cell or range. Can only be an integer from 0 to 250. If text horizontal alignment type is set to value other than left or right, indent level will be reset to zero.

getFont

public Font getFont()
Gets a Font object.

getRotationAngle/setRotationAngle

public int getRotationAngle() / public void setRotationAngle(int value)
Represents text rotation angle.

0: Not rotated.

255: Top to Bottom.

-90: Downward.

90: Upward.

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

getHorizontalAlignment/setHorizontalAlignment

public int getHorizontalAlignment() / public void setHorizontalAlignment(int value)
Gets or sets the horizontal alignment type of the text in a cell. The value of the property is TextAlignmentType integer constant.

getVerticalAlignment/setVerticalAlignment

public int getVerticalAlignment() / public void setVerticalAlignment(int value)
Gets or sets the vertical alignment type of the text in a cell. The value of the property is TextAlignmentType integer constant.

isTextWrapped/setTextWrapped

public boolean isTextWrapped() / public void setTextWrapped(boolean value)
Gets or sets a value indicating whether the text within a cell is wrapped.

getNumber/setNumber

public int getNumber() / public void setNumber(int value)
Gets or sets the display format of numbers and dates. The formatting patterns are different for different regions. 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@

isLocked/setLocked

public boolean isLocked() / public void setLocked(boolean value)
Gets or sets a value indicating whether a cell can be modified or not. Locking cells has no effect unless the worksheet is protected.

getCustom/setCustom

public java.lang.String getCustom() / public void setCustom(java.lang.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. The returned custom string is culture-independent.

getCultureCustom/setCultureCustom

public java.lang.String getCultureCustom() / public void setCultureCustom(java.lang.String value)
Gets and 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. 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.

getInvariantCustom

public java.lang.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. 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 CultureCustom 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.

isFormulaHidden/setFormulaHidden

public boolean isFormulaHidden() / public void setFormulaHidden(boolean value)
Represents if the formula will be hidden when the worksheet is protected.

getShrinkToFit/setShrinkToFit

public boolean getShrinkToFit() / public void setShrinkToFit(boolean value)
Represents if text automatically shrinks to fit in the available column width.

getTextDirection/setTextDirection

public int getTextDirection() / public void setTextDirection(int value)
Represents text reading order. The value of the property is TextDirectionType integer constant.

isJustifyDistributed/setJustifyDistributed

public boolean isJustifyDistributed() / public void setJustifyDistributed(boolean value)
Indicates if the cells justified or distributed alignment should be used on the last line of text. This is typical for East Asian alignments but not typical in other contexts.

getQuotePrefix/setQuotePrefix

public boolean getQuotePrefix() / public void setQuotePrefix(boolean value)
Indicates whether the cell's value starts with single quote mark.

isGradient/setGradient

public boolean isGradient() / public void setGradient(boolean value)
Indicates whether the cell shading is a gradient pattern.

isPercent

public boolean isPercent()
Indicates whether the number format is a percent format.

isDateTime

public boolean isDateTime()
Indicates whether the number format is a date format.

Method Detail

setTwoColorGradient

public void setTwoColorGradient(com.aspose.cells.Color color1, com.aspose.cells.Color color2, int gradientStyleType, int variant)
Sets the specified fill to a two-color gradient.
Parameters:
color1 - One gradient color.
color2 - Two gradient color.
gradientStyleType - A GradientStyleType value. Gradient shading style.
variant - 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.

setPatternColor

public void setPatternColor(int pattern, com.aspose.cells.Color color1, com.aspose.cells.Color color2)
Sets the background color.
Parameters:
pattern - A BackgroundType value. The pattern.
color1 - The foreground color.
color2 - The background color. Only works when pattern is not BackgroundType.None and BackgroundType.Solid.

copy

public void copy(Style style)
Copies data from another style object 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:
style - Source Style object

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.

isModified

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:
modifyFlag - A StyleModifyFlag value. Style modified flags
Returns:
true if the specified properties have been modified

equals

public boolean equals(java.lang.Object obj)
Determines whether two Style instances are equal.
Parameters:
obj - The Style object to compare with the current Style object.
Returns:
true if the specified Object is equal to the current Object; otherwise, false.

hashCode

public int hashCode()
Serves as a hash function for a Style object. This method is only for internal use.
Returns:
A hash code for the current Object.

setBorder

public boolean setBorder(int borderEdge, int borderStyle, com.aspose.cells.Color borderColor)
Sets the borders of the style.
Parameters:
borderEdge - A BorderType value. The type fo the border.
borderStyle - A CellBorderType value. The style of the border.
borderColor - The color of the border.
Returns:
Returns whether changing the current borders.

setCustom

public void setCustom(java.lang.String custom, boolean builtinPreference)
Sets the Custom number format string of a cell.
Parameters:
custom - Custom number format string, should be InvariantCulture pattern.
builtinPreference - 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.

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.