001 package org.apache.tapestry.scriptaculous; 002 003 import org.apache.tapestry.IMarkupWriter; 004 import org.apache.tapestry.IRequestCycle; 005 006 import java.util.Iterator; 007 008 /** 009 * Renderer used by {@link Suggest} component to render lists usable 010 * by the currently integrated 011 * <a href="http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter">script.aculo.us</a> 012 * javascript library. 013 * 014 * <p/>This particular library expects the rendered contents of this class to 015 * be an unordered html list. 016 * <p/> 017 * <pre> 018 * <ul> 019 * <li>Apple</li> 020 * <li>Apricot</li> 021 * </ul> 022 * </pre> 023 */ 024 public interface ListItemRenderer { 025 026 /** 027 * Renders an unordered html list to the response, using the specified 028 * collection of values as the contents to fill in the <pre><li></pre> elements 029 * with. 030 * 031 * @param writer 032 * Markup writer to write content in to. 033 * @param cycle 034 * Current request cycle. 035 * @param values 036 * Values used to render list. 037 */ 038 public void renderList(IMarkupWriter writer, IRequestCycle cycle, Iterator values); 039 } 040