public class UserSettingsBean extends Object implements Serializable
Constructor and Description |
---|
UserSettingsBean()
Public constructor to make this a bean.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultDatePattern()
Gets the default date pattern for the current locale.
|
String |
getDefaultDateTimePattern()
Gets the default date/time pattern for the current locale.
|
String |
getDefaultMonthYearPattern()
Gets the default month/year pattern for the current locale.
|
String |
getDefaultShortDatePattern()
Gets the default short date pattern for the current locale.
|
String |
getDefaultShortDateTimePattern()
Gets the default short date/time pattern for the current locale.
|
String |
getLanguage()
Gets the current language.
|
Locale |
getLocale()
Gets the current locale.
|
boolean |
getLoggedIn()
Determines whether the current user is logged in or not.
|
String |
getStyleSheet()
Gets the current style sheet.
|
TimeZone |
getTimeZone()
Gets the current time zone.
|
String |
getTimeZoneAsString()
Gets the current time zone as a String.
|
String |
getUserName()
Gets the name of the currently logged in user.
|
boolean |
isDebugMode()
Gets the debug mode.
|
String |
logout()
Executes a logout by invalidating the session, provided the user is
logged in.
|
void |
setDebugMode(boolean debugMode)
Sets the debug mode on or off.
|
void |
setLocale(Locale locale)
Sets the locale.
|
void |
setStyleSheet(String styleSheet)
Sets the style sheet.
|
void |
setTimeZone(TimeZone timeZone)
Sets the time zone.
|
void |
timeZoneListener(javax.faces.event.ComponentSystemEvent event)
Checks whether the
CCookie.TIMEZONE cookie exists and if it does, sets the time zone for the current user. |
void |
updateLocale(javax.faces.event.ValueChangeEvent event)
Updates the locale.
|
void |
updateStyleSheet(javax.faces.event.ValueChangeEvent event)
Updates the style sheet.
|
void |
updateTimeZone(javax.faces.event.ValueChangeEvent event)
Called when the time zone has been changed by the user.
|
public UserSettingsBean()
public Locale getLocale()
public void setLocale(Locale locale)
locale
- The locale.
IllegalArgumentException
- When the supplied locale is not one of
the supported locales.public void updateLocale(javax.faces.event.ValueChangeEvent event)
event
- The value change event.public String getStyleSheet()
Level.SEVERE
is logged.ApplicationSettingsBean.getSupportedLocales()
public void setStyleSheet(String styleSheet)
styleSheet
- The style sheet.public void updateStyleSheet(javax.faces.event.ValueChangeEvent event)
event
- The value change event.public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
timeZone
- The time zone.public String getTimeZoneAsString()
public void timeZoneListener(javax.faces.event.ComponentSystemEvent event)
CCookie.TIMEZONE
cookie exists and if it does, sets the time zone for the current user.event
- The event.public void updateTimeZone(javax.faces.event.ValueChangeEvent event)
event
- The ValueChangeEvent.public boolean isDebugMode()
public void setDebugMode(boolean debugMode)
debugMode
- True to turn debug mode on, false to turn it off.public String getUserName()
public boolean getLoggedIn()
public String logout()
public String getLanguage()
public String getDefaultDatePattern()
MissingResourceException
- When the key
FormatterFactory.KEY_DATE_PATTERN_UNLOCALIZED
, could not be found in Formatter.properties.public String getDefaultShortDatePattern()
MissingResourceException
- When the key FormatterFactory.KEY_SHORT_DATE_PATTERN
, could not be found in
Formatter.properties.public String getDefaultDateTimePattern()
MissingResourceException
- When the key FormatterFactory.KEY_DATE_TIME_PATTERN
, could not be found in
Formatter.properties.public String getDefaultShortDateTimePattern()
MissingResourceException
- When the key FormatterFactory.KEY_SHORT_DATE_TIME_PATTERN
, could not be found
in Formatter.properties.public String getDefaultMonthYearPattern()
MissingResourceException
- When the key FormatterFactory.KEY_MONTH_YEAR_PATTERN_UNLOCALIZED
, could not
be found in Formatter.properties.Copyright © 2008–2018. All rights reserved.