Top Description Fields Constructors Methods
com.dlsc.formsfx.model.util

public abstract Class TranslationService

extends Object
Class Inheritance
Known Direct Subclasses
com.dlsc.formsfx.model.util.ResourceBundleService
Imports
java.util.ArrayList, .List

A general purpose translation service that is used to translate values into multiple locales based on keys. A concrete sample implementation is provided in the ResourceBundleService.
Authors
Sacha Schmid, Rinesch Murugathas

Field Summary

Modifier and TypeField and Description
private List<Runnable>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected void
notifyListeners()

Notifies all listeners of a locale change.

public void
public abstract String

Returns:

The translated string.
translate
(String
The key to use for the lookup.
key
)

Looks up a key in the translation service and returns the translate string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listenersback to summary
private List<Runnable> listeners

Constructor Detail

TranslationServiceback to summary
public TranslationService()

Method Detail

addListenerback to summary
public void addListener(Runnable listener)
notifyListenersback to summary
protected void notifyListeners()

Notifies all listeners of a locale change. Concrete implementations must call this method after every locale change.

removeListenerback to summary
public void removeListener(Runnable listener)
translateback to summary
public abstract String translate(String key)

Looks up a key in the translation service and returns the translate string.

Parameters
key:String

The key to use for the lookup.

Returns:String

The translated string.