com.aspose.cells
Class IconSet

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

public class IconSet 
extends java.lang.Object

Describe the IconSet conditional formatting rule. This conditional formatting rule applies icons to cells according to their values.

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();

Worksheet sheet = workbook.getWorksheets().get(0);

//Adds an empty conditional formatting
int index = sheet.getConditionalFormattings().add();

FormatConditionCollection fcs = sheet.getConditionalFormattings().get(index);

//Sets the conditional format range.
CellArea ca = new CellArea();

ca.StartRow = 0;

ca.EndRow = 2;

ca.StartColumn = 0;

ca.EndColumn = 0;

fcs.addArea(ca);

//Adds condition.
int idx = fcs.addCondtion(FormatConditionType.ICON_SET);

fcs.addArea(ca);

FormatCondition cond = fcs.get(idx);

//Get Icon Set
IconSet iconSet = cond.getIconSet();

//Set Icon Type
iconSet.setType(IconSetType.ARROWS_3);

//Put Cell Values
Cell cell1 = sheet.getCells().get("A1");

cell1.putValue(10);

Cell cell2 = sheet.getCells().get("A2");

cell2.putValue(120);

Cell cell3 = sheet.getCells().get("A3");

cell3.putValue(260);

//Saving the Excel file
workbook.save("D:\\book1.xlsx");

Property Getters/Setters Summary
ConditionalFormattingIconCollectiongetCfIcons()
           Get theConditionalFormattingIcon from the collection
ConditionalFormattingValueCollectiongetCfvos()
           Get the CFValueObjects instance.
booleanisCustom()
           Indicates whether the icon set is custom. Default value is false.
booleangetReverse()
voidsetReverse(boolean value)
           Get or set the flag indicating whether to reverses the default order of the icons in this icon set. Default value is false.
booleangetShowValue()
voidsetShowValue(boolean value)
           Get or set the flag indicating whether to show the values of the cells on which this icon set is applied. Default value is true.
intgetType()
voidsetType(int value)
           Get or Set the icon set type to display. Setting the type will auto check if the current Cfvos's count is accord with the new type. If not accord, old Cfvos will be cleaned and default Cfvos will be added. The value of the property is IconSetType integer constant.
 

Property Getters/Setters Detail

getCfIcons

public ConditionalFormattingIconCollection getCfIcons()
Get theConditionalFormattingIcon from the collection

getCfvos

public ConditionalFormattingValueCollection getCfvos()
Get the CFValueObjects instance.

getType/setType

public int getType() / public void setType(int value)
Get or Set the icon set type to display. Setting the type will auto check if the current Cfvos's count is accord with the new type. If not accord, old Cfvos will be cleaned and default Cfvos will be added. The value of the property is IconSetType integer constant.

isCustom

public boolean isCustom()
Indicates whether the icon set is custom. Default value is false.

getShowValue/setShowValue

public boolean getShowValue() / public void setShowValue(boolean value)
Get or set the flag indicating whether to show the values of the cells on which this icon set is applied. Default value is true.

getReverse/setReverse

public boolean getReverse() / public void setReverse(boolean value)
Get or set the flag indicating whether to reverses the default order of the icons in this icon set. Default value is false.

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