Package ch.rabanti.picoxlsx4j.style
Class BasicStyles
- java.lang.Object
-
- ch.rabanti.picoxlsx4j.style.BasicStyles
-
public final class BasicStyles extends Object
Factory class with the most important predefined styles- Author:
- Raphael stoeckli
-
-
Constructor Summary
Constructors Constructor Description BasicStyles()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Style
Bold()
Gets the bold stylestatic Style
BoldItalic()
Gets the bold and italic stylestatic Style
BorderFrame()
Gets the border frame stylestatic Style
BorderFrameHeader()
Gets the border style for header cellsstatic Style
colorizedBackground(String rgb)
Gets a style to colorize the background of a cellstatic Style
colorizedText(String rgb)
Gets a style to colorize the text of a cellstatic Style
DateFormat()
Gets the date format stylestatic Style
DottedFill_0_125()
Gets the special pattern fill style (for compatibility)static Style
DoubleUnderline()
Gets the double underline stylestatic Style
font(String fontName)
Gets a style with a user defined Font (Font size 11)
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.static Style
font(String fontName, int fontSize)
Gets a style with a user defined Font
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.static Style
font(String fontName, int fontSize, boolean isBold)
Gets a style with a user defined Font
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.static Style
font(String fontName, int fontSize, boolean isBold, boolean isItalic)
Gets a style with a user defined Font
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j.static Style
Italic()
Gets the italic stylestatic Style
MergeCellStyle()
Gets the style used when merging cellsstatic Style
RoundFormat()
Gets the round format stylestatic Style
Strike()
Gets the strike stylestatic Style
TimeFormat()
Gets the time format stylestatic Style
Underline()
Gets the underline style
-
-
-
Method Detail
-
Bold
public static Style Bold()
Gets the bold style- Returns:
- Style object
-
Italic
public static Style Italic()
Gets the italic style- Returns:
- Style object
-
BoldItalic
public static Style BoldItalic()
Gets the bold and italic style- Returns:
- Style object
-
Underline
public static Style Underline()
Gets the underline style- Returns:
- Style object
-
DoubleUnderline
public static Style DoubleUnderline()
Gets the double underline style- Returns:
- Style object
-
Strike
public static Style Strike()
Gets the strike style- Returns:
- Style object
-
DateFormat
public static Style DateFormat()
Gets the date format style- Returns:
- Style object
-
TimeFormat
public static Style TimeFormat()
Gets the time format style- Returns:
- Style object
-
RoundFormat
public static Style RoundFormat()
Gets the round format style- Returns:
- Style object
-
BorderFrame
public static Style BorderFrame()
Gets the border frame style- Returns:
- Style object
-
BorderFrameHeader
public static Style BorderFrameHeader()
Gets the border style for header cells- Returns:
- Style object
-
DottedFill_0_125
public static Style DottedFill_0_125()
Gets the special pattern fill style (for compatibility)- Returns:
- Style object
-
MergeCellStyle
public static Style MergeCellStyle()
Gets the style used when merging cells- Returns:
- Style object
-
colorizedText
public static Style colorizedText(String rgb)
Gets a style to colorize the text of a cell- Parameters:
rgb
- RGB code in hex format (e.g. FF00AC). Alpha will be set to full opacity (FF)- Returns:
- Style with Font color definition
-
colorizedBackground
public static Style colorizedBackground(String rgb)
Gets a style to colorize the background of a cell- Parameters:
rgb
- RGB code in hex format (e.g. FF00AC). Alpha will be set to full opacity (FF)- Returns:
- Style with background color definition
-
font
public static Style font(String fontName)
Gets a style with a user defined Font (Font size 11)
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error- Parameters:
fontName
- Name of the Font- Returns:
- Style with Font definition
-
font
public static Style font(String fontName, int fontSize)
Gets a style with a user defined Font
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error- Parameters:
fontName
- Name of the FontfontSize
- Size of the Font in points- Returns:
- Style with Font definition
-
font
public static Style font(String fontName, int fontSize, boolean isBold)
Gets a style with a user defined Font
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error- Parameters:
fontName
- Name of the FontfontSize
- Size of the Font in pointsisBold
- If true, the Font will be bold- Returns:
- Style with Font definition
-
font
public static Style font(String fontName, int fontSize, boolean isBold, boolean isItalic)
Gets a style with a user defined Font
Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error- Parameters:
fontName
- Name of the FontfontSize
- Size of the Font in pointsisBold
- If true, the Font will be boldisItalic
- If true, the Font will be italic- Returns:
- Style with Font definition
-
-