package org.schoellerfamily.gedbrowser.renderer;

import java.util.ArrayList;
import java.util.List;

import org.schoellerfamily.gedbrowser.datamodel.GedObject;
import org.schoellerfamily.gedbrowser.datamodel.Head;

/**
 * Render a Head.
 *
 * @author Dick Schoeller
 */
public final class HeadRenderer extends GedRenderer<Head>
        implements IndexHrefRenderer<Head>, AttributesRenderer<Head> {
    /**
     * @param gedObject the Head that we are going to render.
     * @param rendererFactory the factory that creates the renderers for the
     *        attributes
     * @param renderingContext the context that we are rendering in
     */
    public HeadRenderer(final Head gedObject,
            final GedRendererFactory rendererFactory,
            final RenderingContext renderingContext) {
        super(gedObject, rendererFactory, renderingContext);
    }


    /**
     * Return the list of renderers that can be rendered in a list format.
     *
     * @return the list of attribute renderers.
     */
    public List<GedRenderer<?>> getAttributes() {
        final List<GedRenderer<?>> rendererList =
                new ArrayList<GedRenderer<?>>();
        final Head head = getGedObject();
        for (final GedObject attribute : head.getAttributes()) {
            final GedRenderer<?> attributeRenderer =
                    createGedRenderer(attribute);
            if (!attributeRenderer.getListItemContents().isEmpty()) {
                rendererList.add(attributeRenderer);
            }
        }
        return rendererList;
    }
}

@@ -47,119 +47,8 @@
 r;%0A%0A
-import java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.schoellerfamily.gedbrowser.datamodel.GedObject;%0A
 impo
@@ -756,695 +756,6 @@
   %7D%0A
-%0A%0A    /**%0A     * Return the list of renderers that can be rendered in a list format.%0A     *%0A     * @return the list of attribute renderers.%0A     */%0A    public List%3CGedRenderer%3C?%3E%3E getAttributes() %7B%0A        final List%3CGedRenderer%3C?%3E%3E rendererList =%0A                new ArrayList%3CGedRenderer%3C?%3E%3E();%0A        final Head head = getGedObject();%0A        for (final GedObject attribute : head.getAttributes()) %7B%0A            final GedRenderer%3C?%3E attributeRenderer =%0A                    createGedRenderer(attribute);%0A            if (!attributeRenderer.getListItemContents().isEmpty()) %7B%0A                rendererList.add(attributeRenderer);%0A            %7D%0A        %7D%0A        return rendererList;%0A    %7D%0A
 %7D%0A

remove redundant method