com.aspose.cells
Class StyleCollection

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

public class StyleCollection 
extends java.lang.Object

Encapsulates a collection of Style objects.

Example:

Workbook workbook = new Workbook();
StyleCollection styles = workbook.getStyles();
int styleIndex = styles.add();
Style style = workbook.getStyles().get(styleIndex);

Property Getters/Setters Summary
intgetCount()
           Gets the count of elements in the collection.
Styleget(int index)
           Gets the Style element at the specified index.
Styleget(java.lang.String name)
           Gets the Style element at the specified name.
 
Method Summary
intadd()
           Adds a Style to the collection.
StylecreateBuiltinStyle(int type)
          
StylegetThemeStyle(int themeColorType, double tint)
           Gets the theme style.
 

Property Getters/Setters Detail

getCount

public int getCount()
Gets the count of elements in the collection.

get

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

Example:

StyleCollection styles = excel.getStyles();
int styleIndex = styles.add();
Style style = styles.get(styleIndex);

get

public Style get(java.lang.String name)
Gets the Style element at the specified name.
Parameters:
name - Style name
Returns:
The element at the specified name.

Example:

StyleCollection styles = excel.getStyles();
int styleIndex = styles.add();
Style style = styles.get(styleIndex);
style.setName("MyStyle");
//.....................
Style newStyle = styles.get("MyStyle");

Method Detail

getThemeStyle

public Style getThemeStyle(int themeColorType, double tint)
Gets the theme style.
Parameters:
themeColorType - A ThemeColorType value. The theme color type.
tint - The tint value.
Returns:

createBuiltinStyle

public Style createBuiltinStyle(int type)
Parameters:
type - A BuiltinStyleType value.
Returns:

add

public int add()
Adds a Style to the collection. If using this method to create a new style and the style name is set, a new style will be added to the style dialog of MS Excel. To avoid this, you can leave the style name blank.
Returns:
Style object index.

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