1 package org.apache.tapestry.pets; 2 3 import org.apache.tapestry.form.IPropertySelectionModel; 4 5 10 public class StringRecordPropertySelectionModel implements 11 IPropertySelectionModel { 12 13 private String [] optionValues; 14 15 private String [] optionLabels; 16 17 22 public StringRecordPropertySelectionModel(String [] optionValues, 23 String [] optionLabels) { 24 this.optionValues = optionValues; 25 this.optionLabels = optionLabels; 26 } 27 28 public int getOptionCount() { 29 return optionValues.length; 30 } 31 32 public Object getOption(int index) { 33 return optionValues[index]; 34 } 35 36 40 public String getLabel(int index) { 41 return optionLabels[index]; 42 } 43 44 48 public String getValue(int index) { 49 return optionValues[index]; 50 } 51 52 public Object translateValue(String value) { 53 return value; 54 } 55 } | Popular Tags |