com.mucommander.text
Class CustomDateFormat

java.lang.Object
  extended by com.mucommander.text.CustomDateFormat
All Implemented Interfaces:
ConfigurationListener

public class CustomDateFormat
extends java.lang.Object
implements ConfigurationListener

CustomDateFormat allows custom date formatting, according to the date format stored in the preferences.

Author:
Maxence Bernard

Method Summary
 void configurationChanged(ConfigurationEvent event)
          Listens to some configuration variables.
static java.lang.String format(java.util.Date date)
          Formats the given with custom date format and returns a formatted date string.
static java.lang.String getDateFormatString()
          Returns the date format stored in the preferences and used by this class to format dates.
static void init()
          Forces static fields to be initialized
static java.lang.String replaceDateSeparator(java.lang.String dateFormatString, java.lang.String separator)
          Replace the default '/' separator in the given format string, by the given custom separator.
static void updateDateFormat()
          Forces CustomDateFormat to update the date format by looking it up in the preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init()
Forces static fields to be initialized


replaceDateSeparator

public static java.lang.String replaceDateSeparator(java.lang.String dateFormatString,
                                                    java.lang.String separator)
Replace the default '/' separator in the given format string, by the given custom separator.

Returns:
the given format string with '/' separator characters replaced by the given separator character.

getDateFormatString

public static java.lang.String getDateFormatString()
Returns the date format stored in the preferences and used by this class to format dates. The format of the returned string is the one used by the java.text.SimpleDateFormat class.


updateDateFormat

public static void updateDateFormat()
Forces CustomDateFormat to update the date format by looking it up in the preferences.


format

public static java.lang.String format(java.util.Date date)
Formats the given with custom date format and returns a formatted date string.

Returns:
a formatted string representing the given date.

configurationChanged

public void configurationChanged(ConfigurationEvent event)
Listens to some configuration variables.

Specified by:
configurationChanged in interface ConfigurationListener
Parameters:
event - describes the configuration modification.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard