@TopNS(prefix="", uri="http://schemas.openxmlformats.org/spreadsheetml/2006/main", value="styleSheet") public class Styles extends Object implements Storageable
NumFmt, Font,
Fill, Border, Verticals and
Horizontals, each Worksheet introduced by subscript.
EEC uses an Integer value to represent a complete pattern, 0-8 bits are stored in NumFmt, 8-14 bits are stored in Font, 14-20 bits are stored in Fill, 20-26 bits are stored in Border, 26-29 bits are stored in Vertical and 29-32 bits are stored in Horizontal. The Build-In number format does not write into styles.
| 限定符和类型 | 方法和说明 |
|---|---|
int |
addBorder(Border border)
Add border
|
int |
addFill(Fill fill)
Add fill
|
int |
addFont(Font font)
Add font
|
int |
addNumFmt(NumFmt numFmt)
Add number format
|
static int |
clearBorder(int style) |
static int |
clearFill(int style) |
static int |
clearFont(int style) |
static int |
clearHorizontal(int style) |
static int |
clearNumfmt(int style) |
static int |
clearVertical(int style) |
static Styles |
create(I18N i18N)
Create a general style
|
static int |
defaultCharBorderStyle() |
static int |
defaultCharStyle() |
static int |
defaultDateBorderStyle() |
static int |
defaultDateStyle() |
static int |
defaultDoubleBorderStyle() |
static int |
defaultDoubleStyle() |
static int |
defaultIntBorderStyle() |
static int |
defaultIntStyle() |
static int |
defaultStringBorderStyle() |
static int |
defaultStringStyle() |
static int |
defaultTimestampBorderStyle() |
static int |
defaultTimestampStyle() |
boolean |
fastTestDateFmt(int styleIndex)
Fast test cell value is data/time value
|
static String |
getAttr(org.dom4j.Element element,
String attr)
Returns the attribute value from Element
|
Border |
getBorder(int style) |
Fill |
getFill(int style) |
Font |
getFont(int style) |
NumFmt |
getNumFmt(int style) |
int |
getVertical(int style) |
static boolean |
hasBorder(int style) |
static boolean |
hasFill(int style) |
static boolean |
hasFont(int style) |
static boolean |
hasHorizontal(int style) |
static boolean |
hasNumFmt(int style) |
static boolean |
hasVertical(int style) |
boolean |
isDate(int styleIndex)
Test the style is data format
|
static Styles |
load(Path path)
Load the style file from disk
|
int |
of(int s)
Returns the style index, if the style not exists it will
be insert into styles
|
static int |
reset(int style,
int newStyle) |
int |
size()
Returns the number of styles
|
static boolean |
testCodeIsDate(String code) |
void |
writeTo(Path styleFile)
Write style to disk
|
public int of(int s)
s - the value of stylepublic int size()
public static Styles load(Path path)
path - the style file pathStyles Objectpublic final int addNumFmt(NumFmt numFmt)
numFmt - the NumFmt entrypublic final int addFont(Font font)
font - the Font entrypublic final int addFill(Fill fill)
fill - the Fill entrypublic final int addBorder(Border border)
border - the Border entrypublic void writeTo(Path styleFile) throws IOException
writeTo 在接口中 StorageablestyleFile - the storage pathIOException - if I/O error occurpublic static int clearNumfmt(int style)
public static int clearFont(int style)
public static int clearFill(int style)
public static int clearBorder(int style)
public static int clearVertical(int style)
public static int clearHorizontal(int style)
public static int reset(int style,
int newStyle)
public static int defaultCharBorderStyle()
public static int defaultStringBorderStyle()
public static int defaultIntBorderStyle()
public static int defaultDateBorderStyle()
public static int defaultTimestampBorderStyle()
public static int defaultDoubleBorderStyle()
public static int defaultCharStyle()
public static int defaultStringStyle()
public static int defaultIntStyle()
public static int defaultDateStyle()
public static int defaultTimestampStyle()
public static int defaultDoubleStyle()
public static boolean hasNumFmt(int style)
public static boolean hasFont(int style)
public static boolean hasFill(int style)
public static boolean hasBorder(int style)
public static boolean hasVertical(int style)
public static boolean hasHorizontal(int style)
public NumFmt getNumFmt(int style)
public Fill getFill(int style)
public Font getFont(int style)
public Border getBorder(int style)
public int getVertical(int style)
public static String getAttr(org.dom4j.Element element, String attr)
element - current elementattr - the attr namepublic boolean isDate(int styleIndex)
styleIndex - the style indexpublic static boolean testCodeIsDate(String code)
public boolean fastTestDateFmt(int styleIndex)
styleIndex - the style indexCopyright © 2020. All rights reserved.