@@ -0,0 +1,2364 @@
+package com.primix.tapestry.components;%0A%0Aimport com.primix.tapestry.*;%0Aimport com.primix.foundation.*;%0Aimport java.util.*;%0A%0A/*%0A * Tapestry Web Application Framework%0A * Copyright (c) 2000 by Howard Ship and Primix Solutions%0A *%0A * Primix Solutions%0A * One Arsenal Marketplace%0A * Watertown, MA 02472%0A * http://www.primix.com%0A * mailto:hship@primix.com%0A * %0A * This library is free software.%0A * %0A * You may redistribute it and/or modify it under the terms of the GNU%0A * Lesser General Public License as published by the Free Software Foundation.%0A *%0A * Version 2.1 of the license should be included with this distribution in%0A * the file LICENSE, as well as License.html. If the license is not%0A * included with this distribution, you may find a copy at the FSF web%0A * site at 'www.gnu.org' or 'www.fsf.org', or you may write to the%0A * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A */%0A %0A /**%0A  *  Implementation of %7B@link IPropertySelectionModel%7D that allows one String from%0A  *  an array of Strings to be selected as the property.%0A  *%0A  *  %3Cp%3EUses a simple index number as the value (used to represent the selected String).%0A  *  This assumes that the possible values for the Strings will remain constant between%0A  *  request cycles.%0A  *%0A  *  @version $Id$%0A  *  @author Howard Ship%0A  */%0A  %0Apublic class StringPropertySelectionModel%0Aimplements IPropertySelectionModel%0A%7B%0A%09private String%5B%5D options;%0A%09%0A%09/**%0A%09 * Standard constructor.%0A%09 *%0A%09 * The options are retained (not copied).%0A%09 */%0A%09 %0A%09public StringPropertySelectionModel(String%5B%5D options)%0A%09%7B%0A%09%09this.options = options;%0A%09%7D%0A%09%0A%09public int getOptionCount()%0A%09%7B%0A%09%09return options.length;%0A%09%7D%0A%09%0A%09public Object getOption(int index)%0A%09%7B%0A%09%09return options%5Bindex%5D;%0A%09%7D%0A%09%0A%09/**%0A%09 *  Labels match options.%0A%09 *%0A%09 */%0A%09 %0A%09public String getLabel(int index)%0A%09%7B%0A%09%09return options%5Bindex%5D;%09%0A%09%7D%0A%09%0A%09/**%0A%09 *  Values are indexes into the array of options.%0A%09 *%0A%09 */%0A%09 %0A%09public String getValue(int index)%0A%09%7B%0A%09%09return Integer.toString(index);%0A%09%7D%0A%09%0A%09public Object translateValue(String value)%0A%09%7B%0A%09%09int index;%0A%09%09%0A%09%09index = Integer.parseInt(value);%0A%09%09%0A%09%09return options%5Bindex%5D;%0A%09%7D%0A%09%0A%7D

Add StringPropertySelectionModel, used with a PropertySelection component to choose a string from a list.