X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fresources%2FMetaInfo.java;h=70c6c43181bbff8f8885c1eca15a792eef03eac1;hp=f7598f190c2f9a5d491fd2b56b9644e06c104d1f;hb=bc4db23ff5c21d7d4716f9b7f97de73b15a6fc21;hpb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5 diff --git a/src/be/nikiroo/utils/resources/MetaInfo.java b/src/be/nikiroo/utils/resources/MetaInfo.java index f7598f1..70c6c43 100644 --- a/src/be/nikiroo/utils/resources/MetaInfo.java +++ b/src/be/nikiroo/utils/resources/MetaInfo.java @@ -27,6 +27,7 @@ public class MetaInfo> implements Iterable> { private List saveListeners = new ArrayList(); private String name; + private boolean hidden; private String description; private boolean dirty; @@ -90,6 +91,7 @@ public class MetaInfo> implements Iterable> { } this.name = name; + this.hidden = meta.hidden(); this.description = description; reload(); @@ -110,6 +112,16 @@ public class MetaInfo> implements Iterable> { public String getName() { return name; } + + /** + * This item should be hidden from the user (she will still be able to + * modify it if she opens the file manually). + * + * @return TRUE if it should stay hidden + */ + public boolean isHidden() { + return hidden; + } /** * A description for this item: what it is or does, how to explain that item @@ -649,6 +661,15 @@ public class MetaInfo> implements Iterable> { return children; } + /** + * The number of sub-items, if any. + * + * @return the number or 0 + */ + public int size() { + return children.size(); + } + @Override public Iterator> iterator() { return children.iterator(); @@ -673,8 +694,10 @@ public class MetaInfo> implements Iterable> { List> shadow = new ArrayList>(); for (E id : type.getEnumConstants()) { MetaInfo info = new MetaInfo(type, bundle, id); - list.add(info); - shadow.add(info); + if (!info.hidden) { + list.add(info); + shadow.add(info); + } } for (int i = 0; i < list.size(); i++) {