[]
        
(Showing Draft Content)

IIcon

Interface IIcon


public interface IIcon
Represents a single icon in an icon set used in a conditional formatting rule.

An IIcon identifies one icon contained in an IIconSet. Use this interface to work with a specific icon in a built-in icon set, such as retrieving its position with getIndex() or accessing its parent icon set with getParent().


 IIconSet iconSet = workbook.getIconSets().get(IconSetType.Icon3TrafficLights1);
 IIcon icon = iconSet.get(2);
 int index = icon.getIndex();
 IIconSet parent = icon.getParent();
 
  • Method Details

    • getIndex

      int getIndex()
      Gets the zero-based index of this IIcon within its parent IIconSet.

      Use this property to identify the position of the icon within its parent IIconSet.

      
       IIconSet iconSet = workbook.getIconSets().get(IconSetType.Icon3TrafficLights1);
       IIcon icon = iconSet.get(2);
       int index = icon.getIndex();
       
      Returns:
      The zero-based index, from 0 through getParent().getCount() - 1. Calling getParent().get(getIndex()) returns the corresponding icon.
    • getParent

      IIconSet getParent()
      Gets the parent IIconSet.

      Returns the parent IIconSet that contains this icon in an icon set used by a conditional formatting rule.

      
       IIcon icon = workbook.getIconSets().get(IconSetType.Icon3TrafficLights1).get(0);
       IIconSet iconSet = icon.getParent();
       IconSetType type = iconSet.getID();
       
      Returns:
      The parent IIconSet that contains this icon.