From: David ‘Bombe’ Roden Date: Sun, 22 Jun 2008 23:00:18 +0000 (+0200) Subject: add javadoc X-Git-Tag: 0.4.12.2~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=805d52f82be857793ab00a42ee2131ca33d05aad;p=jSite.git add javadoc --- diff --git a/src/de/todesbaum/jsite/i18n/I18nContainer.java b/src/de/todesbaum/jsite/i18n/I18nContainer.java index d3cd314..483c6e2 100644 --- a/src/de/todesbaum/jsite/i18n/I18nContainer.java +++ b/src/de/todesbaum/jsite/i18n/I18nContainer.java @@ -24,26 +24,62 @@ import java.util.Iterator; import java.util.List; /** + * Container that collects {@link Runnable}s that change the texts of GUI + * components when the current locale has changed. + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ public class I18nContainer implements Iterable { + /** The container singleton. */ private static final I18nContainer singleton = new I18nContainer(); + + /** The list of runnables that change texts. */ private final List i18nRunnables = Collections.synchronizedList(new ArrayList()); + + /** + * The list of runnables that change texts and run after + * {@link #i18nRunnables}. + */ private final List i18nPostRunnables = Collections.synchronizedList(new ArrayList()); + /** + * Returns the singleton instance. + * + * @return The singleton instance + */ public static I18nContainer getInstance() { return singleton; } + /** + * Registers an i18n runnable that is run when the current locale has + * changed. + * + * @param i18nRunnable + * The runnable to register + */ public void registerRunnable(Runnable i18nRunnable) { i18nRunnables.add(i18nRunnable); } + /** + * Registers a {@link Runnable} that changes texts when the current locale + * has changed and runs after {@link #i18nRunnables} have run. + * + * @param i18nPostRunnable + * The runnable to register + */ public void registerPostRunnable(Runnable i18nPostRunnable) { i18nPostRunnables.add(i18nPostRunnable); } + /** + * {@inheritDoc} + *

+ * Returns a combined list of {@link #i18nRunnables} and + * {@link #i18nPostRunnables}, in that order. + */ public Iterator iterator() { List allRunnables = new ArrayList(); allRunnables.addAll(i18nRunnables);