Namespace EasyXLS
Class ExcelCondition
System.Object
EasyXLS.ExcelCondition
public class ExcelCondition
extends System.Object
This class stores the condition of the conditional formatting information like
type, operator, first and second formula, font, border and pattern style.
-
Constructor Summary
ConstructorsConstructorDescriptionDefines an instance of the condition.ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula) Defines an instance of the condition, having the specified operator and formula restrictions.ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula, bool isBold, bool isItalic, System.Drawing.Color foreground) Defines an instance of the condition, having the specified operator, formula restrictions and font settings.ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula, bool isBold, bool isItalic, System.Drawing.Color foreground, System.Drawing.Color background) Defines an instance of the condition, having the specified operator, formula restrictions, font settings and background.ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula, System.Drawing.Color background) Defines an instance of the condition, having the specified operator, formula restrictions and background. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all the background settings.voidRemoves all the border settings.voidRemoves all the font settings.Clone()Creates and returns a copy of this object.boolInternal use onlyboolInternal use onlyboolInternal use onlySystem.Drawing.ColorReturns the color of the conditional formatting background.Returns the color of the conditional formatting background.System.Drawing.ColorReturns the color of the conditional formatting bottom border.intReturns the style of the conditional formatting bottom border.Returns the color of the conditional formatting bottom border.intReturns the conditional formatting type.System.StringReturns the conditional formatting first formulaSystem.Drawing.ColorReturns the foreground of the conditional formatting font.Returns the foreground of the conditional formatting font.System.Drawing.ColorReturns the color of the conditional formatting left border.intReturns the style of the conditional formatting left border.Returns the color of the conditional formatting left border.intReturns the conditional formatting operator.System.Drawing.ColorReturns the color of the conditional formatting right border.intReturns the style of the conditional formatting right border.Returns the color of the conditional formatting right border.System.StringReturns the conditional formatting second formulaSystem.Drawing.ColorReturns the color of the conditional formatting top border.intReturns the style of the conditional formatting top border.Returns the color of the conditional formatting top border.intReturns the underline style of the conditional formatting font.boolReturns true if the condition modifies the background of the cell font, false otherwise.boolIsBold()Returns the bold setting of the conditional formatting font.boolReturns true if the condition modifies the bottom border style of the cell, false otherwise.boolReturns true if the condition modifies the style property of the cell font, false otherwise.boolReturns true if the condition modifies the color of the cell font, false otherwise.boolReturns true if the condition modifies the strikethrough property of the cell font, false otherwise.boolReturns true if the condition modifies the underline property of the cell font, false otherwise.boolIsItalic()Returns the italic setting of the conditional formatting font.boolReturns true if the condition modifies the left border style of the cell, false otherwise.boolReturns true if the condition modifies the right border style of the cell, false otherwise.boolReturns the strikethrough setting of the conditional formatting font.boolReturns true if the condition modifies the top border style of the cell, false otherwise.voidsetBackground(ThemeColor themeColor) Sets the color of the conditional formatting background.
This method is overridden as setBackground_2 in COM+ version of EasyXLS.voidsetBackground(System.Drawing.Color color) Sets the color of the conditional formatting background.voidsetBold(bool isBold) Sets the bold setting of the conditional formatting font.voidsetBorderColors(ThemeColor borderTop, ThemeColor borderBottom, ThemeColor borderLeft, ThemeColor borderRight) Sets the color of the conditional formatting borders.
This method is overridden as setBorderColors_2 in COM+ version of EasyXLS.voidsetBorderColors(System.Drawing.Color borderTop, System.Drawing.Color borderBottom, System.Drawing.Color borderLeft, System.Drawing.Color borderRight) Sets the color of the conditional formatting borders.voidsetBorderStyles(int borderTop, int borderBottom, int borderLeft, int borderRight) Sets the style of the conditional formatting borders.voidsetBottomColor_Border(ThemeColor themeColor) Sets the color of the conditional formatting bottom border.
This method is overridden as setBottomColor_Border_2 in COM+ version of EasyXLS.voidsetBottomColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting bottom border.voidsetBottomStyle_Border(int borderStyle) Sets the style of the conditional formatting bottom border.voidsetConditionType(int type) Sets the conditional formatting type.voidsetFirstFormula(System.String firstFormula) Sets the conditional formatting first formula.voidsetForeground(ThemeColor themeColor) Sets the foreground of the conditional formatting font.
This method is overridden as setForeground_2 in COM+ version of EasyXLS.voidsetForeground(System.Drawing.Color color) Sets the foreground of the conditional formatting font.voidsetItalic(bool isItalic) Sets the italic setting of the conditional formatting font.voidsetLeftColor_Border(ThemeColor themeColor) Sets the color of the conditional formatting left border.
This method is overridden as setLeftColor_Border_2 in COM+ version of EasyXLS.voidsetLeftColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting left border.voidsetLeftStyle_Border(int borderStyle) Sets the style of the conditional formatting left border.voidsetOperator(int nOperator) Sets the conditional formatting operator.voidsetRightColor_Border(ThemeColor themeColor) Sets the color of the conditional formatting right border.
This method is overridden as setRightColor_Border_2 in COM+ version of EasyXLS.voidsetRightColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting right border.voidsetRightStyle_Border(int borderStyle) Sets the style of the conditional formatting right border.voidsetSecondFormula(System.String secondFormula) Sets the conditional formatting second formula.voidsetStrikethrough(bool isStrikethrough) Sets the strikethrough setting of the conditional formatting font.voidsetTopColor_Border(ThemeColor themeColor) Sets the color of the conditional formatting top border.
This method is overridden as setTopColor_Border_2 in COM+ version of EasyXLS.voidsetTopColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting top border.voidsetTopStyle_Border(int borderStyle) Sets the style of the conditional formatting top border.voidsetUnderlineStyle(int underlineStyle) Sets the underline style of the conditional formatting font.Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExcelCondition
public ExcelCondition()Defines an instance of the condition. -
ExcelCondition
public ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula) Defines an instance of the condition, having the specified operator and formula restrictions.- Parameters:
nOperator- the conditional formatting operator. Possible values are available inConditionalFormattingclass.firstFormula- the conditional formatting first formulasecondFormula- the conditional formatting second formula
-
ExcelCondition
public ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula, System.Drawing.Color background) Defines an instance of the condition, having the specified operator, formula restrictions and background.- Parameters:
nOperator- the conditional formatting operator. Possible values are available inConditionalFormattingclass.firstFormula- the conditional formatting first formulasecondFormula- the conditional formatting second formulabackground- the color of the conditional formatting background
-
ExcelCondition
public ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula, bool isBold, bool isItalic, System.Drawing.Color foreground) Defines an instance of the condition, having the specified operator, formula restrictions and font settings.- Parameters:
nOperator- the conditional formatting operator. Possible values are available inConditionalFormattingclass.firstFormula- the conditional formatting first formulasecondFormula- the conditional formatting second formulaisBold- the bold setting of the conditional formatting fontisItalic- the italic setting of the conditional formatting fontforeground- the foreground of the conditional formatting font
-
ExcelCondition
public ExcelCondition(int nOperator, System.String firstFormula, System.String secondFormula, bool isBold, bool isItalic, System.Drawing.Color foreground, System.Drawing.Color background) Defines an instance of the condition, having the specified operator, formula restrictions, font settings and background.- Parameters:
nOperator- the conditional formatting operator. Possible values are available inConditionalFormattingclass.firstFormula- the conditional formatting first formulasecondFormula- the conditional formatting second formulaisBold- the bold setting of the conditional formatting fontisItalic- the italic setting of the conditional formatting fontforeground- the foreground of the conditional formatting fontbackground- the color of the conditional formatting background
-
-
Method Details
-
IsFontUnderlineModified
public bool IsFontUnderlineModified()Returns true if the condition modifies the underline property of the cell font, false otherwise.- Returns:
- true if the condition modifies the underline property of the cell font, false otherwise
- See Also:
-
IsFontBoldItalicModified
public bool IsFontBoldItalicModified()Returns true if the condition modifies the style property of the cell font, false otherwise.- Returns:
- true if the condition modifies the style property of the cell font, false otherwise
- See Also:
-
IsFontStrikethroughModified
public bool IsFontStrikethroughModified()Returns true if the condition modifies the strikethrough property of the cell font, false otherwise.- Returns:
- true if the condition modifies the strikethrough property of the cell font, false otherwise
- See Also:
-
IsFontColorModified
public bool IsFontColorModified()Returns true if the condition modifies the color of the cell font, false otherwise.- Returns:
- true if the condition modifies the color of the cell font, false otherwise
- See Also:
-
clearFontSettings
public void clearFontSettings()Removes all the font settings. -
IsLeftBorderModified
public bool IsLeftBorderModified()Returns true if the condition modifies the left border style of the cell, false otherwise.- Returns:
- true if the condition modifies the left border style of the cell, false otherwise
- See Also:
-
IsRightBorderModified
public bool IsRightBorderModified()Returns true if the condition modifies the right border style of the cell, false otherwise.- Returns:
- true if the condition modifies the right border style of the cell, false otherwise
- See Also:
-
IsTopBorderModified
public bool IsTopBorderModified()Returns true if the condition modifies the top border style of the cell, false otherwise.- Returns:
- true if the condition modifies the top border style of the cell, false otherwise
- See Also:
-
IsBottomBorderModified
public bool IsBottomBorderModified()Returns true if the condition modifies the bottom border style of the cell, false otherwise.- Returns:
- true if the condition modifies the bottom border style of the cell, false otherwise
- See Also:
-
clearBorderSettings
public void clearBorderSettings()Removes all the border settings. -
IsBackgroundModified
public bool IsBackgroundModified()Returns true if the condition modifies the background of the cell font, false otherwise.- Returns:
- true if the condition modifies the background of the cell font, false otherwise
- See Also:
-
clearBackgroundSettings
public void clearBackgroundSettings()Removes all the background settings. -
ContainsFontFormatting
public bool ContainsFontFormatting()Internal use only- Returns:
- true if the condition contains any font formatting, false otherwise
-
ContainsPatternFormatting
public bool ContainsPatternFormatting()Internal use only- Returns:
- true if the condition contains pattern formatting, false otherwise
-
ContainsBorderFormatting
public bool ContainsBorderFormatting()Internal use only- Returns:
- true if the condition contains any border formatting, false otherwise
-
getConditionType
public int getConditionType()Returns the conditional formatting type. Possible values are available inConditionalFormattingclass.- Returns:
- the conditional formatting type
- See Also:
-
setConditionType
public void setConditionType(int type) Sets the conditional formatting type. Possible values are available inConditionalFormattingclass.- Parameters:
type- the conditional formatting type- See Also:
-
getOperator
public int getOperator()Returns the conditional formatting operator. Possible values are available inConditionalFormattingclass.- Returns:
- the conditional formatting operator
- See Also:
-
setOperator
public void setOperator(int nOperator) Sets the conditional formatting operator. Possible values are available inConditionalFormattingclass.- Parameters:
nOperator- the conditional formatting operator- See Also:
-
getFirstFormula
public System.String getFirstFormula()Returns the conditional formatting first formula- Returns:
- the conditional formatting first formula
- See Also:
-
setFirstFormula
public void setFirstFormula(System.String firstFormula) Sets the conditional formatting first formula. The formula must start with "=" symbol.- Parameters:
firstFormula- the conditional formatting first formula- See Also:
-
getSecondFormula
public System.String getSecondFormula()Returns the conditional formatting second formula- Returns:
- the conditional formatting second formula
- See Also:
-
setSecondFormula
public void setSecondFormula(System.String secondFormula) Sets the conditional formatting second formula. The formula must start with "=" symbol.- Parameters:
secondFormula- the conditional formatting second formula- See Also:
-
getForeground
public System.Drawing.Color getForeground()Returns the foreground of the conditional formatting font.- Returns:
- the foreground of the conditional formatting font
- See Also:
-
getForegroundThemeColor
Returns the foreground of the conditional formatting font.- Returns:
- the foreground of the conditional formatting font
- See Also:
-
setForeground
public void setForeground(System.Drawing.Color color) Sets the foreground of the conditional formatting font.- Parameters:
color- the foreground of the conditional formatting font- See Also:
-
setForeground
Sets the foreground of the conditional formatting font.
This method is overridden as setForeground_2 in COM+ version of EasyXLS.- Parameters:
themeColor- the foreground of the conditional formatting font- See Also:
-
IsBold
public bool IsBold()Returns the bold setting of the conditional formatting font.- Returns:
- the bold setting of the conditional formatting font
- See Also:
-
setBold
public void setBold(bool isBold) Sets the bold setting of the conditional formatting font.- Parameters:
isBold- the bold setting of the conditional formatting font- See Also:
-
IsItalic
public bool IsItalic()Returns the italic setting of the conditional formatting font.- Returns:
- the italic setting of the conditional formatting font
- See Also:
-
setItalic
public void setItalic(bool isItalic) Sets the italic setting of the conditional formatting font.- Parameters:
isItalic- the italic setting of the conditional formatting font- See Also:
-
IsStrikethrough
public bool IsStrikethrough()Returns the strikethrough setting of the conditional formatting font.- Returns:
- the strikethrough setting of the conditional formatting font
- See Also:
-
setStrikethrough
public void setStrikethrough(bool isStrikethrough) Sets the strikethrough setting of the conditional formatting font.- Parameters:
isStrikethrough- the strikethrough setting of the conditional formatting font- See Also:
-
getUnderlineStyle
public int getUnderlineStyle()Returns the underline style of the conditional formatting font. Possible values are available inFontSettings- Returns:
- the underline style of the conditional formatting font
- See Also:
-
setUnderlineStyle
public void setUnderlineStyle(int underlineStyle) Sets the underline style of the conditional formatting font. Possible values are available inFontSettings- Parameters:
underlineStyle- the underline style of the conditional formatting font- See Also:
-
setBorderStyles
public void setBorderStyles(int borderTop, int borderBottom, int borderLeft, int borderRight) Sets the style of the conditional formatting borders. Possible values are available inBorderclass.- Parameters:
borderTop- the style of the conditional formatting top borderborderBottom- the style of the conditional formatting bottom borderborderLeft- the style of the conditional formatting left borderborderRight- the style of the conditional formatting right border- See Also:
-
getTopStyle_Border
public int getTopStyle_Border()Returns the style of the conditional formatting top border. Possible values are available inBorderclass.- Returns:
- the style of the conditional formatting top border
- See Also:
-
setTopStyle_Border
public void setTopStyle_Border(int borderStyle) Sets the style of the conditional formatting top border. Possible values are available inBorderclass.- Parameters:
borderStyle- the style of the conditional formatting top border- See Also:
-
getBottomStyle_Border
public int getBottomStyle_Border()Returns the style of the conditional formatting bottom border. Possible values are available inBorderclass.- Returns:
- the style of the conditional formatting bottom border
- See Also:
-
setBottomStyle_Border
public void setBottomStyle_Border(int borderStyle) Sets the style of the conditional formatting bottom border. Possible values are available inBorderclass.- Parameters:
borderStyle- the style of the conditional formatting bottom border- See Also:
-
getLeftStyle_Border
public int getLeftStyle_Border()Returns the style of the conditional formatting left border. Possible values are available inBorderclass.- Returns:
- the style of the conditional formatting left border
- See Also:
-
setLeftStyle_Border
public void setLeftStyle_Border(int borderStyle) Sets the style of the conditional formatting left border. Possible values are available inBorderclass.- Parameters:
borderStyle- the style of the conditional formatting left border- See Also:
-
getRightStyle_Border
public int getRightStyle_Border()Returns the style of the conditional formatting right border. Possible values are available inBorderclass.- Returns:
- the style of the conditional formatting right border
- See Also:
-
setRightStyle_Border
public void setRightStyle_Border(int borderStyle) Sets the style of the conditional formatting right border. Possible values are available inBorderclass.- Parameters:
borderStyle- the style of the conditional formatting right border- See Also:
-
setBorderColors
public void setBorderColors(System.Drawing.Color borderTop, System.Drawing.Color borderBottom, System.Drawing.Color borderLeft, System.Drawing.Color borderRight) Sets the color of the conditional formatting borders.- Parameters:
borderTop- the color of the conditional formatting top borderborderBottom- the color of the conditional formatting bottom borderborderLeft- the color of the conditional formatting left borderborderRight- the color of the conditional formatting right border- See Also:
-
setBorderColors
public void setBorderColors(ThemeColor borderTop, ThemeColor borderBottom, ThemeColor borderLeft, ThemeColor borderRight) Sets the color of the conditional formatting borders.
This method is overridden as setBorderColors_2 in COM+ version of EasyXLS.- Parameters:
borderTop- the color of the conditional formatting top borderborderBottom- the color of the conditional formatting bottom borderborderLeft- the color of the conditional formatting left borderborderRight- the color of the conditional formatting right border- See Also:
-
getTopColor_Border
public System.Drawing.Color getTopColor_Border()Returns the color of the conditional formatting top border.- Returns:
- the color of the conditional formatting top border
- See Also:
-
getTopThemeColor_Border
Returns the color of the conditional formatting top border.- Returns:
- the color of the conditional formatting top border
- See Also:
-
setTopColor_Border
public void setTopColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting top border.- Parameters:
color- the color of the conditional formatting top border- See Also:
-
setTopColor_Border
Sets the color of the conditional formatting top border.
This method is overridden as setTopColor_Border_2 in COM+ version of EasyXLS.- Parameters:
themeColor- the color of the conditional formatting top border- See Also:
-
getBottomColor_Border
public System.Drawing.Color getBottomColor_Border()Returns the color of the conditional formatting bottom border.- Returns:
- the color of the conditional formatting bottom border
- See Also:
-
getBottomThemeColor_Border
Returns the color of the conditional formatting bottom border.- Returns:
- the color of the conditional formatting bottom border
- See Also:
-
setBottomColor_Border
public void setBottomColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting bottom border.- Parameters:
color- the color of the conditional formatting bottom border- See Also:
-
setBottomColor_Border
Sets the color of the conditional formatting bottom border.
This method is overridden as setBottomColor_Border_2 in COM+ version of EasyXLS.- Parameters:
themeColor- the color of the conditional formatting bottom border- See Also:
-
getLeftColor_Border
public System.Drawing.Color getLeftColor_Border()Returns the color of the conditional formatting left border.- Returns:
- the color of the conditional formatting left border
- See Also:
-
getLeftThemeColor_Border
Returns the color of the conditional formatting left border.- Returns:
- the color of the conditional formatting left border
- See Also:
-
setLeftColor_Border
public void setLeftColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting left border.- Parameters:
color- the color of the conditional formatting left border- See Also:
-
setLeftColor_Border
Sets the color of the conditional formatting left border.
This method is overridden as setLeftColor_Border_2 in COM+ version of EasyXLS.- Parameters:
themeColor- the color of the conditional formatting left border- See Also:
-
getRightColor_Border
public System.Drawing.Color getRightColor_Border()Returns the color of the conditional formatting right border.- Returns:
- the color of the conditional formatting right border
- See Also:
-
getRightThemeColor_Border
Returns the color of the conditional formatting right border.- Returns:
- the color of the conditional formatting right border
- See Also:
-
setRightColor_Border
public void setRightColor_Border(System.Drawing.Color color) Sets the color of the conditional formatting right border.- Parameters:
color- the color of the conditional formatting right border- See Also:
-
setRightColor_Border
Sets the color of the conditional formatting right border.
This method is overridden as setRightColor_Border_2 in COM+ version of EasyXLS.- Parameters:
themeColor- the color of the conditional formatting right border- See Also:
-
getBackground
public System.Drawing.Color getBackground()Returns the color of the conditional formatting background.- Returns:
- the color of the conditional formatting background
- See Also:
-
getBackgroundThemeColor
Returns the color of the conditional formatting background.- Returns:
- the color of the conditional formatting background
- See Also:
-
setBackground
public void setBackground(System.Drawing.Color color) Sets the color of the conditional formatting background.- Parameters:
color- the color of the conditional formatting background- See Also:
-
setBackground
Sets the color of the conditional formatting background.
This method is overridden as setBackground_2 in COM+ version of EasyXLS.- Parameters:
themeColor- the color of the conditional formatting background- See Also:
-
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-