@TopNS(prefix="", uri="http://schemas.openxmlformats.org/spreadsheetml/2006/main", value="styleSheet") public class Styles extends Object implements Storable
NumFmt, Font,
Fill, Border, Verticals and
Horizontals, each Worksheet introduced by subscript.
EEC uses an Integer value to store Extended Format:
The Build-In number format does not write into styles.Bit | Contents ------+--------- 0, 8 | NumFmt 8, 6 | Font 14, 6 | Fill 20, 6 | Border 26, 3 | Vertical 29, 3 | Horizontal
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
INDEX_BORDER |
static int |
INDEX_FILL |
static int |
INDEX_FONT |
static int |
INDEX_HORIZONTAL |
static int |
INDEX_NUMBER_FORMAT |
static int |
INDEX_VERTICAL |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
addBorder(Border border)
Add border
|
void |
addDateFmtCache(int xf)
Append a date format back into cache
|
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 |
defaultDoubleBorderStyle() |
static int |
defaultDoubleStyle() |
static int |
defaultIntBorderStyle() |
static int |
defaultIntStyle() |
static int |
defaultStringBorderStyle() |
static int |
defaultStringStyle() |
boolean |
fastTestDateFmt(int styleIndex)
Fast test cell value is data/time value
|
static Styles |
forReader()
Create a general style
|
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 static final int INDEX_NUMBER_FORMAT
public static final int INDEX_FONT
public static final int INDEX_FILL
public static final int INDEX_BORDER
public static final int INDEX_VERTICAL
public static final int INDEX_HORIZONTAL
public int of(int s)
s - the value of stylepublic int size()
public static Styles forReader()
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 在接口中 StorablestyleFile - 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 defaultDoubleBorderStyle()
public static int defaultCharStyle()
public static int defaultStringStyle()
public static int defaultIntStyle()
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 indexpublic void addDateFmtCache(int xf)
xf - the XFRecord idCopyright © 2020. All rights reserved.