Class FormatterSettings
java.lang.Object
net.sf.basedb.clients.web.formatter.FormatterSettings
This is autility class for getting and setting formatter-related settings for
the logged in user.
- Version:
- 2.0
- Author:
- nicklas
- See Also:
- Last modified
- $Date: 2023-04-20 09:47:14 +0200 (Thu, 20 Apr 2023) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Get format string for a date formatter.static String
Get format string for a datetime formatter.static int
Get the number of decimals a number formatter should display.static Character
Get the separator character to use as a "thousands" separator in large numbers.static void
setDateFormat
(SessionControl sc, String dateFormat) Set the format string for a date formatter.static void
setDateTimeFormat
(SessionControl sc, String dateTimeFormat) Set the format string for a datetime formatter.static void
setNumDecimals
(SessionControl sc, int numDecimals) Set the number of decimals a number formatter should display.static void
setThousandsSeparator
(SessionControl sc, Character separator) Set the separator character to use as a "thousands" separator in large numbers.
-
Field Details
-
DEFAULT_NUM_DECIMALS
public static final int DEFAULT_NUM_DECIMALSThe default number of decimals to display by a number formatter = @value- See Also:
-
DEFAULT_DATE_FORMAT
The default date format for a date formatter = @value- See Also:
-
DEFAULT_DATETIME_FORMAT
The default datetime format for a datetime formatter = @value- See Also:
-
-
Constructor Details
-
FormatterSettings
public FormatterSettings()
-
-
Method Details
-
getNumDecimals
Get the number of decimals a number formatter should display.- Parameters:
sc
- The logged in user's session control- Returns:
- The number of decimals
- See Also:
-
setNumDecimals
Set the number of decimals a number formatter should display.- Parameters:
sc
- The logged in user's session controlnumDecimals
- The number of decimals- See Also:
-
getThousandsSeparator
Get the separator character to use as a "thousands" separator in large numbers. Typically, a comma (,) or space ( ) is used. Returns null if no separator should be used.- Parameters:
sc
- The logged in user's session control- Returns:
- The separator character or null
- Since:
- 3.19.8
-
setThousandsSeparator
Set the separator character to use as a "thousands" separator in large numbers. Typically, a comma (,) or space ( ) is used. Set to null if no separator should be used.- Parameters:
sc
- The logged in user's session controlseparator
- The separator character or null- Since:
- 3.19.8
-
getDateFormat
Get format string for a date formatter.- Parameters:
sc
- The logged in user's session control- Returns:
- The format string
- See Also:
-
setDateFormat
Set the format string for a date formatter.- Parameters:
sc
- The logged in user's session controldateFormat
- The format string- See Also:
-
getDateTimeFormat
Get format string for a datetime formatter.- Parameters:
sc
- The logged in user's session control- Returns:
- The format string
- See Also:
-
setDateTimeFormat
Set the format string for a datetime formatter.- Parameters:
sc
- The logged in user's session controldateTimeFormat
- The format string- See Also:
-