final ArrayList<?> contents) {
images.clear();
if ((this.pattern == null) || (this.pattern.trim().length() == 0)) {
images.addAll(contents);
} else {
final StringMatcher ma = new StringMatcher("*" + this.pattern + "*", true, false);
for (final Object o : contents) {
if (o instanceof ItemGroup) {
final ItemGroup ga = (ItemGroup) o;
if (ma.match(ga.getName())) {
images.add(o);
} else {
final ArrayList<IImageEntry> z = new ArrayList<IImageEntry>();
for (int a = 0; a < ga.getChildCount(); a++) {
final IImageEntry image = ga.getImage(a);
if (ma.match(image.getName())) {
z.add(image);
}
}
if (!z.isEmpty()) {
images.add(new ItemGroup(ga.getName(), z));