Package io.keikai.model.impl.sys
Class FormatEngineImpl
- java.lang.Object
-
- io.keikai.model.impl.sys.FormatEngineImpl
-
- All Implemented Interfaces:
FormatEngine
- Direct Known Subclasses:
FormatEngineEx
public class FormatEngineImpl extends Object implements FormatEngine
- Since:
- 3.5.0
- Author:
- Hawk
-
-
Constructor Summary
Constructors Constructor Description FormatEngineImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatResult
format(SCell cell, FormatContext context)
Format the cell by it's formatFormatResult
format(String format, Object value, FormatContext context, int cellWidth)
Format the valueprotected CellFormat
getCellFormat(String formatStr, Locale locale)
static int
getCellWidth256(SCell cell)
static String
getDateTimeString(double val, Locale locale)
String
getEditText(SCell cell, FormatContext context)
Get the editText of cellSTableStyle
getExistTableStyle(SBook book, String name)
Returns TableStyle of the specified name of the specified book if exists; or return null if not exists.String
getFormat(SCell cell, FormatContext context)
Get the format of the cell, ifSCellStyle.isDirectDataFormat()
if false, the return value will be localizedprotected String
getFormulaEditText(SCell cell)
String
getLocalizedFormat(String format, FormatContext context)
Get the localized-format , if the format is global-format, it will be transfer it to localized one (for example, m/d/yyyy will becom yyyy/m/d in zh_TW)STableStyle
getTableStyle(SBook book, String name)
Returns TableStyle of the specified name of the specified book.
-
-
-
Method Detail
-
format
public FormatResult format(SCell cell, FormatContext context)
Description copied from interface:FormatEngine
Format the cell by it's format- Specified by:
format
in interfaceFormatEngine
- See Also:
FormatEngine.getFormat(SCell, FormatContext)
-
format
public FormatResult format(String format, Object value, FormatContext context, int cellWidth)
Description copied from interface:FormatEngine
Format the value- Specified by:
format
in interfaceFormatEngine
- See Also:
FormatEngine.getLocalizedFormat(String, FormatContext)
-
getCellFormat
protected CellFormat getCellFormat(String formatStr, Locale locale)
-
getLocalizedFormat
public String getLocalizedFormat(String format, FormatContext context)
Description copied from interface:FormatEngine
Get the localized-format , if the format is global-format, it will be transfer it to localized one (for example, m/d/yyyy will becom yyyy/m/d in zh_TW)- Specified by:
getLocalizedFormat
in interfaceFormatEngine
-
getFormat
public String getFormat(SCell cell, FormatContext context)
Description copied from interface:FormatEngine
Get the format of the cell, ifSCellStyle.isDirectDataFormat()
if false, the return value will be localized- Specified by:
getFormat
in interfaceFormatEngine
- See Also:
FormatEngine.getLocalizedFormat(String, FormatContext)
-
getEditText
public String getEditText(SCell cell, FormatContext context)
Description copied from interface:FormatEngine
Get the editText of cell- Specified by:
getEditText
in interfaceFormatEngine
-
getCellWidth256
public static int getCellWidth256(SCell cell)
-
getTableStyle
public STableStyle getTableStyle(SBook book, String name)
Description copied from interface:FormatEngine
Returns TableStyle of the specified name of the specified book.- Specified by:
getTableStyle
in interfaceFormatEngine
- Returns:
-
getExistTableStyle
public STableStyle getExistTableStyle(SBook book, String name)
Description copied from interface:FormatEngine
Returns TableStyle of the specified name of the specified book if exists; or return null if not exists.- Specified by:
getExistTableStyle
in interfaceFormatEngine
- Returns:
-
-