X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fresources%2FMetaInfo.java;h=8ec98f9935168b9f0dbe231b1af917e5ce21a316;hb=b5313d03641e21b2abfba01bd9454b89c6050fd0;hp=e7a8b7c5fe09b5f0a72e36a1161cfde4f2ecfe6f;hpb=d5026c096121da14c20d69893520594a36d088bb;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/resources/MetaInfo.java b/src/be/nikiroo/utils/resources/MetaInfo.java index e7a8b7c..8ec98f9 100644 --- a/src/be/nikiroo/utils/resources/MetaInfo.java +++ b/src/be/nikiroo/utils/resources/MetaInfo.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.utils.resources.Meta.Format; /** @@ -142,7 +141,7 @@ public class MetaInfo> implements Iterable> { /** * The allowed list of values that a {@link Format#FIXED_LIST} item is * allowed to be, or a list of suggestions for {@link Format#COMBO_LIST} - * items. + * items. Also works for {@link Format#LOCALE}. *

* Will always allow an empty string in addition to the rest. * @@ -160,6 +159,22 @@ public class MetaInfo> implements Iterable> { return withEmpty; } + /** + * Return all the languages known by the program for this bundle. + *

+ * This only works for {@link TransBundle}, and will return an empty list if + * this is not a {@link TransBundle}. + * + * @return the known language codes + */ + public List getKnownLanguages() { + if (bundle instanceof TransBundle) { + return ((TransBundle) bundle).getKnownLanguages(); + } + + return new ArrayList(); + } + /** * This item is a comma-separated list of values instead of a single value. *

@@ -175,8 +190,8 @@ public class MetaInfo> implements Iterable> { } /** - * A manual flag to specify if the {@link MetaData} has been changed or not, - * which can be used by {@link MetaInfo#save(boolean)}. + * A manual flag to specify if the data has been changed or not, which can + * be used by {@link MetaInfo#save(boolean)}. * * @return TRUE if it is dirty (if it has changed) */ @@ -185,8 +200,8 @@ public class MetaInfo> implements Iterable> { } /** - * A manual flag to specify that the {@link MetaData} has been changed, - * which can be used by {@link MetaInfo#save(boolean)}. + * A manual flag to specify that the data has been changed, which can be + * used by {@link MetaInfo#save(boolean)}. */ public void setDirty() { this.dirty = true; @@ -519,7 +534,7 @@ public class MetaInfo> implements Iterable> { * The value stored by this item, as a colour (represented here as an * {@link Integer}) if it represents a colour, or NULL if it doesn't. *

- * The returned colour value is an ARGB value. + * The colour value is an ARGB value. * * @param value * the value