org.openswing.swing.internationalization.java
Class Resources

java.lang.Object
  extended byorg.openswing.swing.internationalization.java.Resources
All Implemented Interfaces:
java.io.Serializable

public class Resources
extends java.lang.Object
implements java.io.Serializable

Title: OpenSwing Framework

Description: Class for collecting all internationalization properties: translations, data/numeric/currency formats.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
Serialized Form

Field Summary
static int DMY
           
static java.lang.String H_MM_AAA
          example 6:30 PM
static java.lang.String H_MM_SS_AAA
          example 6:30:59 PM
static java.lang.String H_MM_SS_SSS_AAA
          example 6:30:59,123 PM
static java.lang.String HH_MM
          example 18:30
static java.lang.String HH_MM_SS
          example 18:30:59
static java.lang.String HH_MM_SS_SSS
          example 18:30:59,123
static int MDY
           
static int YDM
           
static int YMD
           
 
Constructor Summary
Resources(java.util.Properties dictionary, java.lang.String currencySymbol, char decimalSymbol, char groupingSymbol, int dateFormat, boolean showCenturyInDateFormat, char dateFormatSeparator, java.lang.String timeFormat, java.lang.String languageId, boolean showResourceNotFoundWarning)
          Costructor used to inizialize the dictionary and other settings.
 
Method Summary
 java.lang.String getCurrencySymbol()
           
 int getDateFormat()
           
 char getDateFormatSeparator()
           
 java.lang.String getDateMask(int dateType)
           
 java.lang.String getDateMask(int dateType, int dateFormat, char separator, boolean showCentury, java.lang.String timeFormat)
           
 char getDecimalSymbol()
           
 java.util.Enumeration getEntries()
           
 char getGroupingSymbol()
           
 java.lang.String getLanguageId()
           
 java.lang.String getResource(java.lang.String text)
           
 java.lang.String getTimeFormat()
           
 boolean isShowCenturyInDateFormat()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HH_MM

public static final java.lang.String HH_MM
example 18:30

See Also:
Constant Field Values

H_MM_AAA

public static final java.lang.String H_MM_AAA
example 6:30 PM

See Also:
Constant Field Values

HH_MM_SS

public static final java.lang.String HH_MM_SS
example 18:30:59

See Also:
Constant Field Values

H_MM_SS_AAA

public static final java.lang.String H_MM_SS_AAA
example 6:30:59 PM

See Also:
Constant Field Values

HH_MM_SS_SSS

public static final java.lang.String HH_MM_SS_SSS
example 18:30:59,123

See Also:
Constant Field Values

H_MM_SS_SSS_AAA

public static final java.lang.String H_MM_SS_SSS_AAA
example 6:30:59,123 PM

See Also:
Constant Field Values

YMD

public static final int YMD
See Also:
Constant Field Values

DMY

public static final int DMY
See Also:
Constant Field Values

MDY

public static final int MDY
See Also:
Constant Field Values

YDM

public static final int YDM
See Also:
Constant Field Values
Constructor Detail

Resources

public Resources(java.util.Properties dictionary,
                 java.lang.String currencySymbol,
                 char decimalSymbol,
                 char groupingSymbol,
                 int dateFormat,
                 boolean showCenturyInDateFormat,
                 char dateFormatSeparator,
                 java.lang.String timeFormat,
                 java.lang.String languageId,
                 boolean showResourceNotFoundWarning)
Costructor used to inizialize the dictionary and other settings.

Parameters:
dictionary - dictionary containing the translations
currencySymbol - currency symbol
decimalSymbol - decimal symbol
groupingSymbol - grouping symbol
dateFormat - date format
timeFormat - time format; possibile values: HH_MM, H_MM_AAA, HH_MM_SS, H_MM_SS_AAA
languageId - language identifier
showResourceNotFoundWarning - define if log when a resource is not found
Method Detail

getEntries

public final java.util.Enumeration getEntries()
Returns:
Enumeration of all entries in dictionary

getResource

public final java.lang.String getResource(java.lang.String text)
Parameters:
text - text to translate
Returns:
translated text

getGroupingSymbol

public final char getGroupingSymbol()
Returns:
grouping symbol

getCurrencySymbol

public final java.lang.String getCurrencySymbol()
Returns:
currency symbol

getDecimalSymbol

public final char getDecimalSymbol()
Returns:
decimal symbol

getDateFormat

public final int getDateFormat()
Returns:
date format; possible values: YMD, DMY, MDY, YDM

getTimeFormat

public final java.lang.String getTimeFormat()
Returns:
time format

getLanguageId

public final java.lang.String getLanguageId()
Returns:
language identifier

getDateFormatSeparator

public final char getDateFormatSeparator()
Returns:
date format separator; for example: '-' or '/'

isShowCenturyInDateFormat

public final boolean isShowCenturyInDateFormat()
Returns:
used to show century in the date format

getDateMask

public final java.lang.String getDateMask(int dateType)
Parameters:
dateType - possibile values: Consts.TYPE_DATE, Consts.TYPE_TIME, Consts.TYPE_DATE_TIME
Returns:
date format, according to dateFormat, dateFormatSeparator and showCenturyInDateFormat properties

getDateMask

public final java.lang.String getDateMask(int dateType,
                                          int dateFormat,
                                          char separator,
                                          boolean showCentury,
                                          java.lang.String timeFormat)
Returns:
date format, according to dateType, dateFormat, separator, showCentury and timeFormat arguments