com.aspose.cells
Class ConditionalFormattingIconCollection

java.lang.Object
  extended by CollectionBase
      extended by com.aspose.cells.ConditionalFormattingIconCollection
All Implemented Interfaces:
java.lang.Iterable

public class ConditionalFormattingIconCollection 
extends CollectionBase

Represents a collection of ConditionalFormattingIcon objects.

Example:

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

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

//Get Conditional Formatting
ConditionalFormattingCollection cformattings = sheet.getConditionalFormattings();

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

//Get newly added Conditional formatting
FormatConditionCollection fcs = cformattings.get(index);

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

ca.StartRow = 0;

ca.EndRow = 0;

ca.StartColumn = 0;

ca.EndColumn = 0;

fcs.addArea(ca);

ca = new CellArea();

ca.StartRow = 1;

ca.EndRow = 1;

ca.StartColumn = 1;

ca.EndColumn = 1;

fcs.addArea(ca);

//Sets condition
 int idx = fcs.addCondition(FormatConditionType.ICON_SET);
 
 FormatCondition cond = fcs.get(idx);
   
 //Sets condition's type
 cond.getIconSet().setType(IconSetType.ARROWS_GRAY_3);

//Add custom iconset condition.
 ConditionalFormattingIcon cfIcon = cond.getIconSet().getCfIcons().get(0);
 
 cfIcon.setType(IconSetType.ARROWS_3);
 
 cfIcon.setIndex(0);
 
 ConditionalFormattingIcon cfIcon1 = cond.getIconSet().getCfIcons().get(1);
 
  cfIcon1.setType(IconSetType.ARROWS_GRAY_3);
  
  cfIcon1.setIndex(1);
  
  ConditionalFormattingIcon cfIcon2 = cond.getIconSet().getCfIcons().get(2);
  
  cfIcon2.setType(IconSetType.BOXES_5);
  
  cfIcon2.setIndex(2);

//Saving the Excel file
workbook.save("output.xls");


Property Getters/Setters Summary
intgetCount()→ inherited from com.aspose.cells.CollectionBase
          
ConditionalFormattingIconget(int)
           Gets the ConditionalFormattingIcon element at the specified index.
 
Method Summary
intadd(ConditionalFormattingIcon cficon)
           Adds ConditionalFormattingIcon object.
intadd(int type, int index)
           Adds ConditionalFormattingIcon object.
intadd(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
voidclear()→ inherited from com.aspose.cells.CollectionBase
          
booleancontains(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
intindexOf(java.lang.Object value)→ inherited from com.aspose.cells.CollectionBase
          Reserved for internal use.
java.util.Iteratoriterator()→ inherited from com.aspose.cells.CollectionBase
          
voidremoveAt(int index)→ inherited from com.aspose.cells.CollectionBase
          
 

Property Getters/Setters Detail

getCount

→ inherited from com.aspose.cells.CollectionBase
public int getCount()

get

public ConditionalFormattingIcon get(int index)
Gets the ConditionalFormattingIcon element at the specified index.
Parameters:
index - The zero based index of the element.
Returns:
The element at the specified index.

Method Detail

add

public int add(int type, int index)
Adds ConditionalFormattingIcon object.
Parameters:
type - A IconSetType value. The value type.
index - The Index.
Returns:
Returns the index of new object in the list.

add

public int add(ConditionalFormattingIcon cficon)
Adds ConditionalFormattingIcon object.
Parameters:
cficon - Returns the index of new object in the list.

clear

→ inherited from com.aspose.cells.CollectionBase
public void clear()

removeAt

→ inherited from com.aspose.cells.CollectionBase
public void removeAt(int index)

iterator

→ inherited from com.aspose.cells.CollectionBase
public java.util.Iterator iterator()

contains

→ inherited from com.aspose.cells.CollectionBase
public boolean contains(java.lang.Object value)
Reserved for internal use.

add

→ inherited from com.aspose.cells.CollectionBase
public int add(java.lang.Object value)
Reserved for internal use.

indexOf

→ inherited from com.aspose.cells.CollectionBase
public int indexOf(java.lang.Object value)
Reserved for internal use.

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