Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.common
Interface ILptsCharSetLocaleListener

All Known Implementing Classes:
TLptsConnectionDialog, TLptsSystemInfoPanel, TLptsViewDataDialog, TLptsViewLogPanel

public interface ILptsCharSetLocaleListener

Class Description : Interface for informing of the locale change in the system.

This interface is responsible for the locale changes in the system.

The implementing class will need to update all components that depend on the locale.

$LastChangedRevision: 599 $
$LastChangedDate:: 2010-05-27 11:56:12 $


Method Summary
 void localeHasChanged(java.lang.String language, java.lang.String country)
           Used to inform a listener of the changed locale.
 

Method Detail

localeHasChanged

void localeHasChanged(java.lang.String language,
                      java.lang.String country)

Used to inform a listener of the changed locale.

Notes :
The function TLptsCharSetLocaleUtil.setLocale calls this function on all implementations.
The setLocale function sets the default locale to the specified one, which means that the implementations can call
Locale.getDefault() for the charset that is supplied in the parameters.
If required, use the function TLptsCharSetLocaleUtil.getCharsetList() to get a list of all charsets.
Each charset has the Country and Language, as supplied by this function for the new locale.

Example :

class MyClass implements ILptsCharSetLocaleListener
{
  public static void main(String[] args)
  {
    TLptsCharSetLocaleUtil.addLocaleListener(this);
    ...
    TLptsCharSetLocaleUtil.setLocale("gb","en");
    // This calls the localeHasChanged for every listener registered (like this class)
  }
  public void localeHasChanged(String country, String language)
  {
    // just received notification of a change of locale
  }
}
 

Parameters:
language - The language code of the newly set locale.
country - The country code of the newly set locale.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)