2.17.2: 2011-06-17

net.sf.basedb.clients.web.formatter
Class FormatterSettings

java.lang.Object
  extended by net.sf.basedb.clients.web.formatter.FormatterSettings

public class FormatterSettings
extends Object

This is autility class for getting and setting formatter-related settings for the logged in user.

Version:
2.0
Author:
nicklas
See Also:
FormatterFactory
Last modified
$Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Field Summary
static String DEFAULT_DATE_FORMAT
          The default date format for a date formatter = @value
static String DEFAULT_DATETIME_FORMAT
          The default datetime format for a datetime formatter = @value
static int DEFAULT_NUM_DECIMALS
          The default number of decimals to display by a number formatter = @value
 
Constructor Summary
FormatterSettings()
           
 
Method Summary
static String getDateFormat(SessionControl sc)
          Get format string for a date formatter.
static String getDateTimeFormat(SessionControl sc)
          Get format string for a datetime formatter.
static int getNumDecimals(SessionControl sc)
          Get the number of decimals a number formatter should display.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NUM_DECIMALS

public static final int DEFAULT_NUM_DECIMALS
The default number of decimals to display by a number formatter = @value

See Also:
Constant Field Values

DEFAULT_DATE_FORMAT

public static final String DEFAULT_DATE_FORMAT
The default date format for a date formatter = @value

See Also:
Constant Field Values

DEFAULT_DATETIME_FORMAT

public static final String DEFAULT_DATETIME_FORMAT
The default datetime format for a datetime formatter = @value

See Also:
Constant Field Values
Constructor Detail

FormatterSettings

public FormatterSettings()
Method Detail

getNumDecimals

public static int getNumDecimals(SessionControl sc)
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:
DEFAULT_NUM_DECIMALS, FormatterFactory.getNumberFormatter(SessionControl)

setNumDecimals

public static void setNumDecimals(SessionControl sc,
                                  int numDecimals)
Set the number of decimals a number formatter should display.

Parameters:
sc - The logged in user's session control
numDecimals - The number of decimals
See Also:
DEFAULT_NUM_DECIMALS, FormatterFactory.getNumberFormatter(SessionControl)

getDateFormat

public static String getDateFormat(SessionControl sc)
Get format string for a date formatter.

Parameters:
sc - The logged in user's session control
Returns:
The format string
See Also:
DEFAULT_DATE_FORMAT, FormatterFactory.getDateFormatter(SessionControl)

setDateFormat

public static void setDateFormat(SessionControl sc,
                                 String dateFormat)
Set the format string for a date formatter.

Parameters:
sc - The logged in user's session control
dateFormat - The format string
See Also:
DEFAULT_DATE_FORMAT, FormatterFactory.getDateFormatter(SessionControl), SimpleDateFormat

getDateTimeFormat

public static String getDateTimeFormat(SessionControl sc)
Get format string for a datetime formatter.

Parameters:
sc - The logged in user's session control
Returns:
The format string
See Also:
DEFAULT_DATETIME_FORMAT, FormatterFactory.getDateTimeFormatter(SessionControl)

setDateTimeFormat

public static void setDateTimeFormat(SessionControl sc,
                                     String dateTimeFormat)
Set the format string for a datetime formatter.

Parameters:
sc - The logged in user's session control
dateTimeFormat - The format string
See Also:
DEFAULT_DATETIME_FORMAT, FormatterFactory.getDateTimeFormatter(SessionControl), SimpleDateFormat

2.17.2: 2011-06-17